Fork me on GitHub

Changeset 457 in svn


Ignore:
Timestamp:
Jul 10, 2009, 12:46:53 AM (15 years ago)
Author:
Xavier Rouby
Message:

new class for inputing directly rootfiles from Delphes (with GEN tree)

Location:
trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r455 r457  
    55   - additional data in the logfile : all names of used input files
    66     (input event files, detector card, trigger card, beam files, particle table)
     7   - it is now possible to read "delphes root files" as an input for Delphes (GEN tree)
    78
    89 /-----------------------------------------\
  • trunk/Delphes.cpp

    r453 r457  
    5151#include "STDHEPConverter.h"
    5252#include "LHCOConverter.h"
     53#include "DelphesRootConverter.h"
    5354
    5455#include "SmearUtil.h"
     
    232233    }
    233234  else if(line.rfind(".root") < line.length())
     235  // can be either a root file from h2root (i.e. with "h101" tree)
     236  // or a root file from Delphes  (i.e. with "GEN" tree)
    234237    {
    235       cout <<"**                   h2root file format detected                   **"<<endl;
    236       cout <<"**                  This can take several minutes                  **"<< endl;
    237       HEPEVTConverter converter(inputFileList,outputfilename,DET->PDGtable,DET->NEvents);
    238     }
     238      TFile f(line.c_str());
     239      if (f.FindKey("GEN")) {
     240        cout <<"**                Delphes ROOT file format detected                **"<<endl;
     241        cout <<"**                  This can take several minutes                  **"<< endl;
     242        DelphesRootConverter converter(inputFileList,outputfilename,DET->NEvents);
     243      }
     244      else
     245      if (f.FindKey("h101")) {
     246        cout <<"**                   h2root file format detected                   **"<<endl;
     247        cout <<"**                  This can take several minutes                  **"<< endl;
     248        HEPEVTConverter converter(inputFileList,outputfilename,DET->PDGtable,DET->NEvents);
     249      }
     250      else {
     251            cerr << left  << setw(4) <<"**  "<<""
     252                 << left  << setw(63) << line.c_str() <<""
     253                 << right << setw(2) <<"**"<<endl;
     254            cerr <<"**         ERROR: File format not identified --  Exiting...        **"<< endl;
     255            cout <<"**                                                                 **"<< endl;
     256            cout <<"*********************************************************************"<< endl;
     257            return -1;
     258        } // not found any interesting input tree
     259        f.Close();
     260      } // .root file
    239261  else {
    240262    cerr << left  << setw(4) <<"**  "<<""
Note: See TracChangeset for help on using the changeset viewer.