36 int main(
int argc,
char **argv)
48 JParser<> zap(
"Auxiliary program to convert 1D histograms to PDFs.");
50 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
57 catch(
const exception &error) {
58 FATAL(error.what() << endl);
66 DEBUG(
"Input: " << *input << endl);
71 ERROR(
"File: " << input->getFullFilename() <<
" not opened." << endl);
75 const TRegexp regexp(input->getObjectName());
77 TIter iter(dir->GetListOfKeys());
79 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
81 const TString tag(key->GetName());
83 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
87 if (tag.Contains(regexp)) {
89 TObject*
object = key->ReadObj();
91 TH1*
h1 =
dynamic_cast<TH1*
>(object);
93 try { h1 =
dynamic_cast<TProfile&
>(*object).ProjectionX(); }
catch(exception&) {}
96 listOfObjects.push_back(h1);
98 ERROR(
"Incompatible object " << object->GetName() << endl);
Utility class to parse command line options.
int main(int argc, char *argv[])
then for HISTOGRAM in h0 h1
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void convertToPDF(TH1 &h1, const std::string &option="NW", const double factor=1.0)
Convert 1D histogram to PDF.
General purpose messaging.
Utility class to parse command line options.
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer.
#define DEBUG(A)
Message macros.