EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EicRunAna.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EicRunAna.h
1 //
2 // AYK (ayk@bnl.gov), 2015/07/15
3 //
4 // A trivial (for now) extension of FairRunAna class;
5 //
6 
7 #include <TString.h>
8 #include <TVirtualMC.h>
9 
10 #include <FairRunAna.h>
11 
12 #include <EicRunSim.h>
13 
14 #ifndef _EIC_RUN_ANA_
15 #define _EIC_RUN_ANA_
16 
17 class EicRunAna : public FairRunAna
18 {
19  public:
20  EicRunAna();
21  ~EicRunAna() {};
22 
23  // Singelton instance get method;
24  static EicRunAna* Instance() { return mInstance; };
25 
26  void SetSeed(unsigned seed) { mSeed = seed; };
27 
28  void SetInputFile(TString fname);
29  const TString &GetInputFileName() const { return mInputFileName; };
30 
31  int AddFriend(const char *fName) {
32  if (!fName) return -1;
33 
34  TString strName(fName);
35 
36  mFriendFiles.push_back(strName);
37 
38  FairRunAna::AddFriend(fName);
39 
40  return 0;
41  };
42 
43  void Init();
44  void Run(Int_t NStart = 0, Int_t NStop = 0);
45  void RunCoreStart(Int_t NStart = 0, Int_t NStop = 0);
46  bool RunCoreImportNextEvent( void );
47  void RunCoreProcessNextEvent( void );
48  void RunCoreFinish( void );
49  //int GetCurrentEventIndex( void ) const { return mEvCurrent; }
50 
51  const std::vector<TString> &GetFriendFiles() { return mFriendFiles; };
52 
53  private:
54  // THINK: can probably live with dynamic cast to respective FairRunSim method?;
55  static EicRunAna *mInstance;
56 
57  // It is not that easy to pull this name from FairRunAna -> just store
58  // this local copy and intercept SetInputFile() call;
59  TString mInputFileName; // input file name
60 
62 
63  // Well, there is some duplication here and in few other places between
64  // EicRunSim and EicRunAna; but I have to inherit from FairRunSim and
65  // FairRunAna (so after the split) and do not want to add another base
66  // class because of TObject inheritance (really a problem?);
67  UInt_t mSeed; // random seed; default: 0x12345678
68 
69  // Want to extract digitization info from all friend files in HTC pass;
70  // so store the file names and intercept AddFriend() call;
71  std::vector<TString> mFriendFiles; // friend file names
72 
73  unsigned mEvStart, mEvEnd; // event range
74 
75  ClassDef(EicRunAna, 7)
76 };
77 
78 #endif