Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
truthDecayTester.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file truthDecayTester.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef GEANTTESTER_H
4 #define GEANTTESTER_H
5 
6 #include <fun4all/SubsysReco.h>
7 
8 #include <decayfinder/DecayFinderContainer_v1.h> // for DecayFinderContainer_v1
9 
10 #include <g4main/PHG4Particle.h>
12 #include <g4main/PHG4VtxPoint.h>
13 
14 #include <TBranch.h>
15 #include <TFile.h>
16 #include <TTree.h>
17 
18 #include <string>
19 
20 class PHCompositeNode;
22 class PHG4Particle;
23 class PHG4VtxPoint;
24 
26 {
27  public:
28  truthDecayTester(const std::string &name = "truthDecayTester");
29 
30  virtual ~truthDecayTester();
31 
37  int Init(PHCompositeNode *topNode) override;
38 
42  int process_event(PHCompositeNode *topNode) override;
43 
45 
47  int End(PHCompositeNode *topNode) override;
48 
49  void setMotherPDG(int PDGID) { m_decay_pdg_id = PDGID; }
50  void setMinPT(float value) { m_min_pt = value; }
51  void setEtaRange(float min, float max)
52  {
53  m_min_eta = min;
54  m_max_eta = max;
55  }
59 
60  private:
61  unsigned int m_nTracks;
62  float m_min_pt;
63  float m_min_eta;
64  ;
65  float m_max_eta;
68 
73  TFile *m_outfile;
74  TTree *m_tree;
77 
78  void initializeBranches();
79  void getMotherPDG(PHCompositeNode *topNode);
80  std::vector<int> getDecayFinderMothers(PHCompositeNode *topNode);
81  bool isInRange(float min, float value, float max);
82  void resetValues();
83 
84  static const int max_tracks = 20;
85  unsigned int m_event_number = 0;
86  float m_mother_mass = -99;
88  float m_mother_decayLength = -99;
89  float m_mother_decayTime = -99;
90  int m_mother_pdg_id = -99;
91  float m_mother_px = 0;
92  float m_mother_py = 0;
93  float m_mother_pz = 0;
94  float m_mother_pE = 0;
95  float m_mother_pT = 0;
96  float m_mother_eta = 0;
97  int m_mother_barcode = -99;
99  float m_track_px[max_tracks] = {0};
100  float m_track_py[max_tracks] = {0};
101  float m_track_pz[max_tracks] = {0};
102  float m_track_pE[max_tracks] = {0};
103  float m_track_pT[max_tracks] = {0};
104  float m_track_eta[max_tracks] = {0};
105  float m_track_mass[max_tracks] = {0};
107  float m_delta_px = 0;
108  float m_delta_py = 0;
109  float m_delta_pz = 0;
110  float m_delta_pE = 0;
111  bool m_accept_px_1percent = false;
112  bool m_accept_py_1percent = false;
113  bool m_accept_pz_1percent = false;
114  bool m_accept_pE_1percent = false;
115  bool m_accept_px_5percent = false;
116  bool m_accept_py_5percent = false;
117  bool m_accept_pz_5percent = false;
118  bool m_accept_pE_5percent = false;
119  bool m_accept_px_15percent = false;
120  bool m_accept_py_15percent = false;
121  bool m_accept_pz_15percent = false;
122  bool m_accept_pE_15percent = false;
123  bool m_accept_eta = true;
124  bool m_accept_pT = true;
125 };
126 
127 #endif // GEANTTESTER_H