EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventEvaluatorEIC.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EventEvaluatorEIC.h
1 #ifndef G4EVAL_EVENTEVALUATOREIC_H
2 #define G4EVAL_EVENTEVALUATOREIC_H
3 
4 //===============================================
8 //===============================================
9 
10 #include <fun4all/SubsysReco.h>
11 
12 #include <set>
13 #include <string>
14 #include <vector>
15 
16 class CaloEvalStack;
17 class PHCompositeNode;
18 class PHHepMCGenEventMap;
19 class PHHepMCGenEvent;
20 class TFile;
21 class TNtuple;
22 class TTree; //Added by Barak
23 
33 {
34  public:
35  enum class TrackSource_t : unsigned short
36  {
37  all = 0,
38  inner = 1,
39  silicon = 2,
40  ttl = 3
41  };
42 
43  EventEvaluatorEIC(const std::string& name = "EventEvaluatorEIC",
44  const std::string& filename = "g4eval_cemc.root");
45  ~EventEvaluatorEIC() override{};
46 
47  int Init(PHCompositeNode* topNode) override;
48  int process_event(PHCompositeNode* topNode) override;
49  int End(PHCompositeNode* topNode) override;
50 
51  void set_strict(bool b) { _strict = b; }
52 
54  void set_do_FHCAL(bool b) { _do_FHCAL = b; }
55  void set_do_BECAL(bool b) { _do_BECAL = b; }
56  void set_do_HCALIN(bool b) { _do_HCALIN = b; }
57  void set_do_HCALOUT(bool b) { _do_HCALOUT = b; }
58  void set_do_EHCAL(bool b) { _do_EHCAL = b; }
59  void set_do_FEMC(bool b) { _do_FEMC = b; }
60  void set_do_CEMC(bool b) { _do_CEMC = b; }
61  void set_do_EEMC(bool b) { _do_EEMC = b; }
62  void set_do_EEMCG(bool b) { _do_EEMCG = b; }
63  void set_do_DRCALO(bool b) { _do_DRCALO = b; }
64  void set_do_FOCAL(bool b) { _do_FOCAL = b; }
65  void set_do_LFHCAL(bool b) { _do_LFHCAL = b; }
66  void set_do_HITS(bool b) { _do_HITS = b; }
68  void set_do_HITS_CALO(bool b) { _do_HITS_CALO = b; }
69  void set_do_TRACKS(bool b) { _do_TRACKS = b; }
71  void set_do_CLUSTERS(bool b) { _do_CLUSTERS = b; }
72  void set_do_VERTEX(bool b) { _do_VERTEX = b; }
73  void set_do_PROJECTIONS(bool b) { _do_PROJECTIONS = b; }
74  void set_do_MCPARTICLES(bool b) { _do_MCPARTICLES = b; }
75  void set_do_HEPMC(bool b) { _do_HEPMC = b; }
76  void set_do_GEOMETRY(bool b) { _do_GEOMETRY = b; }
77  void set_do_BLACKHOLE(bool b) { _do_BLACKHOLE = b; }
78 
79  // limit the tracing of towers and clusters back to the truth particles
80  // to only those reconstructed objects above a particular energy
81  // threshold (evaluation for objects above threshold unaffected)
82  void set_reco_tracing_energy_threshold(float thresh, int caloid)
83  {
84  _reco_e_threshold[caloid] = thresh;
85  }
87  {
88  _reco_e_thresholdMC = thresh;
89  }
90 
92  void set_depth_MCstack(int d)
93  {
94  _depth_MCstack = d;
95  }
96 
97  private:
99  bool _do_FHCAL;
100  bool _do_BECAL;
103  bool _do_EHCAL;
104  bool _do_FEMC;
105  bool _do_CEMC;
106  bool _do_EEMC;
107  bool _do_EEMCG;
109  bool _do_FOCAL;
111  bool _do_HITS;
118  bool _do_PID_LogLikelihood = false;
120  bool _do_HEPMC;
123  unsigned int _ievent;
124 
125  // Event level info
129 
130  // track hits
134  float* _hits_x;
135  float* _hits_y;
136  float* _hits_z;
137  float* _hits_x2;
138  float* _hits_y2;
139  float* _hits_z2;
140  float* _hits_t;
141  float* _hits_edep;
144 
145  // towers
151 
152  // towers
158 
159  // towers
165 
166  // towers
172 
178 
186 
194 
201 
207 
213 
219 
225 
226  // clusters
233 
240 
247 
254 
261 
268 
275 
282 
283  // vertex
284  float _vertex_x;
285  float _vertex_y;
286  float _vertex_z;
291 
292  // tracks
293  int _nTracks;
294  float* _track_ID;
296  float* _track_px;
297  float* _track_py;
298  float* _track_pz;
299  float* _track_x;
300  float* _track_y;
301  float* _track_z;
302  float* _track_ndf;
303  float* _track_chi2;
304  float* _track_dca;
307  unsigned short* _track_source;
308 
309  // log likelihood summary for PID detectors, per track information
310  std::vector<float> _track_pion_LL;
311  std::vector<float> _track_kaon_LL;
312  std::vector<float> _track_proton_LL;
313 
317  float* _track_TLP_x;
318  float* _track_TLP_y;
319  float* _track_TLP_z;
320  float* _track_TLP_t;
328 
329  // MC particles
330  int _nMCPart;
334  float* _mcpart_E;
335  float* _mcpart_px;
336  float* _mcpart_py;
337  float* _mcpart_pz;
338  float* _mcpart_x;
339  float* _mcpart_y;
340  float* _mcpart_z;
342 
343  // MC particles
344  int _nHepmcp;
346  float _hepmcp_x1;
347  float _hepmcp_x2;
348  float _hepmcp_Q2;
353  // float* _hepmcp_ID_parent;
356  float* _hepmcp_E;
357  float* _hepmcp_px;
358  float* _hepmcp_py;
359  float* _hepmcp_pz;
363 
364  int _calo_ID;
375 
379 
392 
393  //----------------------------------
394  // evaluator output ntuples
395 
396  bool _strict;
397 
398  TTree* _event_tree; //Added by Barak
399  TTree* _geometry_tree; //Added by Barak
400 
401  // evaluator output file
402  std::string _filename;
403  TFile* _tfile;
405 
406  // subroutines
407  int GetProjectionIndex(std::string projname);
408  std::string GetProjectionNameFromIndex(int projindex);
409  void fillOutputNtuples(PHCompositeNode* topNode);
410  void resetGeometryArrays();
411  void resetBuffer();
412 
413  const int _maxNHits = 1000000;
414  const int _maxNTowers = 50 * 50;
415  const int _maxNTowersCentral = 2000;
416  const int _maxNTowersDR = 3000 * 3000;
417  const int _maxNTowersCalo = 5000000;
418  const int _maxNclusters = 100;
419  const int _maxNclustersCentral = 2000;
420  const int _maxNTracks = 200;
421  const int _maxNProjections = 2000;
422  const int _maxNMCPart = 100000;
423  const int _maxNHepmcp = 1000;
424  const int _maxNCalo = 15;
425 
426  enum calotype
427  {
428  kFHCAL = 0,
429  kFEMC = 1,
430  kDRCALO = 2,
431  kEEMC = 3,
432  kCEMC = 4,
433  kEHCAL = 5,
434  kHCALIN = 6,
435  kHCALOUT = 7,
436  kLFHCAL = 8,
437  kEEMCG = 9,
438  kBECAL = 10,
439  kFOCAL = 11
440  };
441 };
442 
443 #endif // G4EVAL_EVENTEVALUATOR_H