44int main(
int argc, 
char **argv)
 
   56    JParser<> zap(
"Auxiliary program to convert 2D histograms to PDFs.");
 
   58    zap[
'f'] = 
make_field(inputFile,  
"<input file>:<object name>");
 
   65  catch(
const exception &error) {
 
   66    FATAL(error.what() << endl);
 
   72  for (vector<JRootObjectID>::const_iterator input = inputFile.begin(); input != inputFile.end(); ++input) {
 
   74    DEBUG(
"Input: " << *input << endl);
 
   76    TDirectory* dir = getDirectory(*input);
 
   79      ERROR(
"File: " << input->getFullFilename() << 
" not opened." << endl);
 
   83    const TRegexp regexp(input->getObjectName());
 
   85    TIter iter(dir->GetListOfKeys());
 
   87    for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
 
   89      const TString tag(key->GetName());
 
   91      DEBUG(
"Key: " << tag << 
" match = " << tag.Contains(regexp) << endl);
 
   95      if (tag.Contains(regexp) && isTObject(key)) {
 
   97        TObject* 
object = key->ReadObj();
 
   99        TH2*  h2 = 
dynamic_cast<TH2*
>(object);
 
  101        try { h2 = 
dynamic_cast<TProfile2D&
>(*object).ProjectionXY(); } 
catch(exception&) {}
 
  104          listOfObjects.push_back(h2);
 
  106          ERROR(
"Incompatible object " << object->GetName() << endl);
 
  116    convertToPDF(**h2, option);