ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventEvaluator.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EventEvaluator.h
1 #ifndef G4EVAL_EVENTEVALUATOR_H
2 #define G4EVAL_EVENTEVALUATOR_H
3 
4 //===============================================
8 //===============================================
9 
10 #include <fun4all/SubsysReco.h>
11 
12 #include <set>
13 #include <string>
14 
15 class CaloEvalStack;
16 class PHCompositeNode;
17 class PHHepMCGenEventMap;
18 class PHHepMCGenEvent;
19 class TFile;
20 class TNtuple;
21 class TTree; //Added by Barak
22 
31 class EventEvaluator : public SubsysReco
32 {
33  public:
34  enum class TrackSource_t : unsigned short
35  {
36  all = 0,
37  inner = 1
38  };
39 
40  EventEvaluator(const std::string& name = "EventEvaluator",
41  const std::string& filename = "g4eval_cemc.root");
42  ~EventEvaluator() override{};
43 
44  int Init(PHCompositeNode* topNode) override;
45  int process_event(PHCompositeNode* topNode) override;
46  int End(PHCompositeNode* topNode) override;
47 
48  void set_strict(bool b) { _strict = b; }
49 
51  void set_do_HCALIN(bool b) { _do_HCALIN = b; }
52  void set_do_HCALOUT(bool b) { _do_HCALOUT = b; }
53  void set_do_CEMC(bool b) { _do_CEMC = b; }
54  void set_do_HITS(bool b) { _do_HITS = b; }
55  void set_do_TRACKS(bool b) { _do_TRACKS = b; }
56  void set_do_CLUSTERS(bool b) { _do_CLUSTERS = b; }
57  void set_do_VERTEX(bool b) { _do_VERTEX = b; }
60  void set_do_HEPMC(bool b) { _do_HEPMC = b; }
61  void set_do_GEOMETRY(bool b) { _do_GEOMETRY = b; }
62 
63  // limit the tracing of towers and clusters back to the truth particles
64  // to only those reconstructed objects above a particular energy
65  // threshold (evaluation for objects above threshold unaffected)
67  {
68  _reco_e_threshold = thresh;
69  }
71  {
72  _reco_e_threshold_BECAL = thresh;
73  }
74 
76  void set_depth_MCstack(int d)
77  {
78  _depth_MCstack = d;
79  }
80 
81  private:
83  bool _do_HCALIN;
85  bool _do_CEMC;
86  bool _do_HITS;
87  bool _do_TRACKS;
89  bool _do_VERTEX;
92  bool _do_HEPMC;
94  unsigned int _ievent;
95 
96  // Event level info
100 
101  // track hits
105  float* _hits_x;
106  float* _hits_y;
107  float* _hits_z;
108  float* _hits_t;
109 
110  // towers
116 
122 
128 
129  // clusters
136 
143 
150 
151  // vertex
152  float _vertex_x;
153  float _vertex_y;
154  float _vertex_z;
159 
160  // tracks
161  int _nTracks;
162  float* _track_ID;
163  float* _track_px;
164  float* _track_py;
165  float* _track_pz;
166  float* _track_dca;
169  unsigned short* _track_source;
170 
174  float* _track_TLP_x;
175  float* _track_TLP_y;
176  float* _track_TLP_z;
177  float* _track_TLP_t;
182 
183  // MC particles
184  int _nMCPart;
188  float* _mcpart_E;
189  float* _mcpart_px;
190  float* _mcpart_py;
191  float* _mcpart_pz;
193 
194  // MC particles
195  int _nHepmcp;
197  float _hepmcp_x1;
198  float _hepmcp_x2;
199  // float* _hepmcp_ID_parent;
202  float* _hepmcp_E;
203  float* _hepmcp_px;
204  float* _hepmcp_py;
205  float* _hepmcp_pz;
209 
210 
211  int _calo_ID;
221 
225 
229 
230  //----------------------------------
231  // evaluator output ntuples
232 
233  bool _strict;
234 
235  TTree* _event_tree; //Added by Barak
236  TTree* _geometry_tree; //Added by Barak
237 
238  // evaluator output file
239  std::string _filename;
240  TFile* _tfile;
242 
243  // subroutines
244  int GetProjectionIndex(std::string projname);
245  std::string GetProjectionNameFromIndex(int projindex);
246  void fillOutputNtuples(PHCompositeNode* topNode);
247  void resetGeometryArrays();
248  void resetBuffer();
249 
250  const int _maxNHits = 10000;
251  const int _maxNTowersCentral = 2000;
252  const int _maxNTowersCalo = 5000000;
253  const int _maxNclustersCentral = 2000;
254  const int _maxNTracks = 200;
255  const int _maxNProjections = 2000;
256  const int _maxNMCPart = 100000;
257  const int _maxNHepmcp = 1000;
258 
259  enum calotype {
260  kCEMC = 0,
261  kHCALIN = 1,
263  };
264 
265 };
266 
267 #endif // G4EVAL_EVENTEVALUATOR_H