Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:12

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4MAIN_READEICFILES_H
0004 #define G4MAIN_READEICFILES_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <phhepmc/PHHepMCGenHelper.h>
0009 
0010 #include <string>
0011 
0012 class PHCompositeNode;
0013 class TChain;
0014 
0015 namespace erhic
0016 {
0017   class EventMC;
0018 }
0019 
0020 class ReadEICFiles : public SubsysReco, public PHHepMCGenHelper
0021 {
0022  public:
0023   ReadEICFiles(const std::string &name = "EICReader");
0024   ~ReadEICFiles() override;
0025 
0026   int Init(PHCompositeNode *topNode) override;
0027   int process_event(PHCompositeNode *topNode) override;
0028 
0029   /** Specify name of input file to open */
0030   bool OpenInputFile(const std::string &name);
0031 
0032   /** Set first entry from input tree to be used */
0033   void SetFirstEntry(int e) { entry = e; }
0034   /** Set name of output node */
0035   void SetNodeName(const std::string &s) { _node_name = s; }
0036 
0037  private:
0038   /** Get tree from input file */
0039   void GetTree();
0040 
0041   /** Creade node on node tree */
0042   int CreateNodeTree(PHCompositeNode *topNode);
0043 
0044   enum EvtGen
0045   {
0046     Milou = 1,
0047     DEMP = 2,
0048     Unknown = 100
0049   };
0050 
0051   /** Name of file containing input tree */
0052   std::string filename;
0053 
0054   /** Input tree created with eic-smear tree builder */
0055   TChain *Tin;
0056 
0057   /** Number of events in input tree */
0058   int nEntries;
0059 
0060   /** Number of current event being used from input tree */
0061   int entry;
0062 
0063   /** Event Generator id */
0064   int m_EvtGenId;
0065 
0066   /** Pinter to event record in tree (= branch).
0067       Use 'abstract' EventMC class pointer from which all
0068       event types (erhic::EventMilou etc) inherit from. */
0069   erhic::EventMC *GenEvent;
0070 
0071   // output
0072   std::string _node_name;
0073 };
0074 
0075 #endif /* READEICFILES_H__ */