Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackClusterEvaluator.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackClusterEvaluator.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef TRACKCLUSTEREVALUATOR_H
4 #define TRACKCLUSTEREVALUATOR_H
5 
6 #include <fun4all/SubsysReco.h>
7 #include <trackbase/TrkrDefs.h>
9 
10 #include <string>
11 #include <vector>
12 #include <map>
13 #include <set>
14 
15 class PHCompositeNode;
17 class SvtxTrackMap;
19 class SvtxEvalStack;
20 class SvtxTrack;
21 class TTree;
22 class TFile;
23 
25 {
26  public:
27  TrackClusterEvaluator(const std::string &name = "TrackClusterEvaluator");
28 
29  virtual ~TrackClusterEvaluator();
30 
31  int Init(PHCompositeNode *topNode) override;
32  int InitRun(PHCompositeNode *topNode) override;
33  int process_event(PHCompositeNode *topNode) override;
34  int ResetEvent(PHCompositeNode *topNode) override;
35  int EndRun(const int runnumber) override;
36  int End(PHCompositeNode *topNode) override;
37  int Reset(PHCompositeNode * /*topNode*/) override;
38 
39  void setProcess(const int proc) { m_proc = proc; }
40  void setnEvent(const int nevent) { m_nevent = nevent; }
43  void scanForPrimaries(bool scan) { m_scanForPrimaries = scan; }
44  void scanForEmbedded(bool scan) { m_scanForEmbedded = scan; }
45  void trackMatch(bool match) { m_trackMatch = match; }
46  void Print(const std::string &what = "ALL") const override;
47 
48  private:
49  int getNodes(PHCompositeNode *topNode);
50  void processTruthTracks(PHCompositeNode *topNode);
51  void processRecoTracks(PHCompositeNode *topNode);
52  void setupTrees();
53  void clearVectors();
54  void resetTreeValues();
55 
60  std::string m_trackMapName = "SvtxTrackMap";
61 
62  bool m_scanForEmbedded = true;
63  bool m_scanForPrimaries = true;
64  bool m_trackMatch = true;
65 
66  int m_proc = 0;
67  int m_nevent = 1;
68  TFile *m_outfile = nullptr;
69  std::string m_outfilename = "TrackClusterEvaluator.root";
70  TTree *m_recotree = nullptr;
71  TTree *m_truthtree = nullptr;
72  TTree *m_duplicatetree = nullptr;
73 
74  int event = -9999;
75  int gflavor = -9999;
76  int gntracks = -9999;
77  int gtrackID = -9999;
78  int gnmaps = -9999;
79  int gnintt = -9999;
80  int gntpc = -9999;
81  int gnmms = -9999;
82  float gpx = -9999;
83  float gpy = -9999;
84  float gpz = -9999;
85  float gpt = -9999;
86  float geta = -9999;
87  float gphi = -9999;
88  float gvx = -9999;
89  float gvy = -9999;
90  float gvz = -9999;
91  float gvt = -9999;
92  int gembed = -9999;
93  int gprimary = -9999;
94  int isDuplicate = -9999;
95  std::vector<TrkrDefs::cluskey> gclusterkeys;
98  int trackID = -9999;
99  float px = -9999;
100  float py = -9999;
101  float pz = -9999;
102  float pt = -9999;
103  float eta = -9999;
104  float phi = -9999;
105  int charge = -9999;
106  float quality = -9999;
107  int nmaps = -9999;
108  int nintt = -9999;
109  int ntpc = -9999;
110  int nmms = -9999;
111  float dca3dxy = -9999;
112  float dca3dz = -9999;
113  float pcax = -9999;
114  float pcay = -9999;
115  float pcaz = -9999;
116  int matchedTrackID = -9999;
117 
118  int dtrackID = -9999;
119  float dpx = -9999;
120  float dpy = -9999;
121  float dpz = -9999;
122  float dpt = -9999;
123  float deta = -9999;
124  float dphi = -9999;
125  int dcharge = -9999;
126  float dquality = -9999;
127  int dnmaps = -9999;
128  int dnintt = -9999;
129  int dntpc = -9999;
130  int dnmms = -9999;
131  float ddca3dxy = -9999;
132  float ddca3dz = -9999;
133  float dpcax = -9999;
134  float dpcay = -9999;
135  float dpcaz = -9999;
136  std::vector<TrkrDefs::cluskey> dclusterkeys;
137  std::vector<float> dclusterx, dclustery, dclusterz;
138  std::vector<float> dclusterrphierr, dclusterzerr;
139 
140  std::vector<TrkrDefs::cluskey> clusterkeys;
142  std::vector<unsigned int> matchedRecoTracksID;
143 
144 
145 };
146 
147 #endif // TRACKCLUSTEREVALUATOR_H