11 #include "TProfile2D.h"
42 int main(
int argc,
char **argv)
54 JParser<> zap(
"Auxiliary program to convert 2D histograms to PDFs.");
56 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
63 catch(
const exception &error) {
64 FATAL(error.what() << endl);
72 DEBUG(
"Input: " << *input << endl);
77 ERROR(
"File: " << input->getFullFilename() <<
" not opened." << endl);
81 const TRegexp regexp(input->getObjectName());
83 TIter iter(dir->GetListOfKeys());
85 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
87 const TString tag(key->GetName());
89 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
93 if (tag.Contains(regexp)) {
95 TObject*
object = key->ReadObj();
97 TH2* h2 =
dynamic_cast<TH2*
>(object);
99 try { h2 =
dynamic_cast<TProfile2D&
>(*object).ProjectionXY(); }
catch(exception&) {}
102 listOfObjects.push_back(h2);
104 ERROR(
"Incompatible object " << object->GetName() << endl);
Utility class to parse command line options.
int main(int argc, char *argv[])
#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.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer.