36int 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);
 
   64  for (vector<JRootObjectID>::const_iterator input = inputFile.begin(); input != inputFile.end(); ++input) {
 
   66    DEBUG(
"Input: " << *input << endl);
 
   68    TDirectory* dir = getDirectory(*input);
 
   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) && isTObject(key)) {
 
   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);
 
  108    convertToPDF(**h1, option);