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);