59 int main(
int argc,
char **argv)
71 JParser<> zap(
"Auxiliary program to convert 2D histograms to PDFs.");
73 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
80 catch(
const exception &error) {
81 FATAL(error.what() << endl);
89 DEBUG(
"Input: " << *input << endl);
94 ERROR(
"File: " << input->getFullFilename() <<
" not opened." << endl);
98 const TRegexp regexp(input->getObjectName());
100 TIter iter(dir->GetListOfKeys());
102 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
104 const TString tag(key->GetName());
106 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
110 if (tag.Contains(regexp) &&
isTObject(key)) {
112 TObject*
object = key->ReadObj();
114 TH3* h3 =
dynamic_cast<TH3*
>(object);
117 listOfObjects.push_back(h3);
119 ERROR(
"Incompatible object " << object->GetName() << endl);
int main(int argc, char **argv)
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
void convertToPDF(TH1 &h1, const std::string &option="NW", const double factor=1.0)
Convert 1D histogram to PDF.
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer.
bool isTObject(const TKey *key)
Check if given key corresponds to a TObject.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).