Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FillTruthRecoMatchTree.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FillTruthRecoMatchTree.h
1 #ifndef FILLTRUTHRECOMATCHTREE_H
2 #define FILLTRUTHRECOMATCHTREE_H
3 
46 #include "g4evaltools.h"
47 
48 #include <fun4all/SubsysReco.h>
49 #include <string>
50 #include <vector>
51 
53 class PHCompositeNode;
57 class PHCompositeNode;
61 class SvtxTrack;
62 class SvtxTrackMap;
63 class TrackSeedContainer;
64 class TrkrCluster;
65 /* class TrkrClusterContainer; */
66 class TrkrTruthTrack;
68 class TTree;
69 class TH2D;
70 
72 {
73  public:
75  bool _fill_clusters = true, bool _fill_svtxnomatch = false, float _cluster_nzwidths = 0.5, float _cluster_nphiwidths = 0.5, const std::string &tfile_name = "trackclusmatch.root");
76 
77  virtual ~FillTruthRecoMatchTree();
78 
79  int Init(PHCompositeNode *) override;
80  int InitRun(PHCompositeNode *topNode) override;
81  int process_event(PHCompositeNode * /*topNode*/) override;
82  int End(PHCompositeNode *topNode) override;
83 
84  void clear_clusvecs(const std::string &tag = "");
85 
87 
88  private:
89  int createNodes(PHCompositeNode *topNode);
90 
93 
94  // contianer used to fill the other track matches
98  /* TrkrClusterContainer *m_TruthClusterContainer {nullptr}; */
99  /* TrkrClusterContainer *m_RecoClusterContainer {nullptr}; */
101  /* PHG4TpcCylinderGeomContainer *m_PHG4TpcCylinderGeomContainer {nullptr}; */
102 
103  TTree *m_ttree;
105  bool m_fill_SvU; // unmatched Svtx tracks
107 
108  // Tree Branch members:
109  int nevent{-1};
110  int nphg4{0};
111  int nsvtx{0};
113  int nphg4_part{0};
114  float centrality{0.};
115 
116  // Tracks and clustes
117  //
118  // lables:
119  // tracks:
120  // g4 : phg4track matched
121  // sv : svtx_track matched
122  // gU : phg4track not-matched
123  // sU : svtx_track not-matched
124  // clusters:
125  // M : matched
126  // U : unmatched
131 
132  // Track tree
133  int b_trackid{};
134  bool b_is_g4track{};
135  bool b_is_Svtrack{};
136  bool b_is_matched{};
137 
138  float b_trkpt{};
139  float b_trkphi{};
140  float b_trketa{};
141 
142  int b_nclus{};
143  int b_nclustpc{};
144  int b_nclusmvtx{};
145  int b_nclusintt{};
146 
147  float b_matchrat{};
150  float b_matchrat_tpc{};
151 
152  std::vector<bool> b_clusmatch{};
153  std::vector<float> b_clus_x{};
154  std::vector<float> b_clus_y{};
155  std::vector<float> b_clus_z{};
156  std::vector<float> b_clus_r{};
157  std::vector<int> b_clus_layer{};
158  std::vector<int> b_clus_nphibins{};
159  std::vector<int> b_clus_ntbins{};
160 
161  /* std::vector<int> b_G4M_trackid {}; // g4-track-matched */
162  /* std::vector<int> b_G4M_nclus {}; */
163  /* std::vector<int> b_G4M_nclusmvtx {}; */
164  /* std::vector<int> b_G4M_nclusintt {}; */
165  /* std::vector<int> b_G4M_nclustpc {}; */
166  /* std::vector<float> b_G4M_nclus_matchrat {}; */
167  /* std::vector<float> b_G4M_nclusmvtx_matchrat {}; */
168  /* std::vector<float> b_G4M_nclusintt_matchrat {}; */
169  /* std::vector<float> b_G4M_nclustpc_matchrat {}; */
170  /* std::vector<float> b_G4M_pt {}; */
171  /* std::vector<float> b_G4M_phi {}; */
172  /* std::vector<float> b_G4M_eta {}; */
173  /* std::vector<int> b_SvM_trackid {}; // Svtx-track-matched */
174  /* std::vector<int> b_SvM_nclus {}; */
175  /* std::vector<int> b_SvM_nclusmvtx {}; */
176  /* std::vector<int> b_SvM_nclusintt {}; */
177  /* std::vector<int> b_SvM_nclustpc {}; */
178  /* std::vector<float> b_SvM_nclus_matchrat {}; */
179  /* std::vector<float> b_SvM_nclusmvtx_matchrat {}; */
180  /* std::vector<float> b_SvM_nclusintt_matchrat {}; */
181  /* std::vector<float> b_SvM_nclustpc_matchrat {}; */
182  /* std::vector<float> b_SvM_pt {}; */
183  /* std::vector<float> b_SvM_phi {}; */
184  /* std::vector<float> b_SvM_eta {}; */
185  /* std::vector<int> b_clusM_i0 {}; // if storing clusters -- matched clusters */
186  /* std::vector<int> b_clusM_i1 {}; */
187  /* std::vector<float> b_clusM_layer {}; */
188  /* std::vector<float> b_clusM_x {}; */
189  /* std::vector<float> b_clusM_y {}; */
190  /* std::vector<float> b_clusM_z {}; */
191  /* std::vector<float> b_clusM_r {}; */
192  /* std::vector<int> b_G4M_clusU_i0 {}; // matched phg4 unmatched clusters */
193  /* std::vector<int> b_G4M_clusU_i1 {}; */
194  /* std::vector<float> b_G4M_clusU_layer {}; */
195  /* std::vector<float> b_G4M_clusU_x {}; */
196  /* std::vector<float> b_G4M_clusU_y {}; */
197  /* std::vector<float> b_G4M_clusU_z {}; */
198  /* std::vector<float> b_G4M_clusU_r {}; */
199  /* std::vector<int> b_SvM_clusU_i0 {}; // matched phg4 unmatched clusters */
200  /* std::vector<int> b_SvM_clusU_i1 {}; */
201  /* std::vector<float> b_SvM_clusU_layer {}; */
202  /* std::vector<float> b_SvM_clusU_x {}; */
203  /* std::vector<float> b_SvM_clusU_y {}; */
204  /* std::vector<float> b_SvM_clusU_z {}; */
205  /* std::vector<float> b_SvM_clusU_r {}; */
206  /* std::vector<int> b_G4U_trackid {}; // unmatched tracks */
207  /* std::vector<int> b_G4U_nclus {}; */
208  /* std::vector<int> b_G4U_nclusmvtx {}; */
209  /* std::vector<int> b_G4U_nclusintt {}; */
210  /* std::vector<int> b_G4U_nclustpc {}; */
211  /* std::vector<float> b_G4U_pt {}; */
212  /* std::vector<float> b_G4U_phi {}; */
213  /* std::vector<float> b_G4U_eta {}; */
214  /* std::vector<int> b_SvU_trackid {}; // Svtx-track-matched */
215  /* std::vector<int> b_SvU_nclus {}; */
216  /* std::vector<int> b_SvU_nclusmvtx {}; */
217  /* std::vector<int> b_SvU_nclusintt {}; */
218  /* std::vector<int> b_SvU_nclustpc {}; */
219  /* std::vector<float> b_SvU_pt {}; */
220  /* std::vector<float> b_SvU_phi {}; */
221  /* std::vector<float> b_SvU_eta {}; */
222  /* std::vector<int> b_G4U_clusU_i0 {}; // unmatched phg4 unmatched clusters */
223  /* std::vector<int> b_G4U_clusU_i1 {}; */
224  /* std::vector<float> b_G4U_clusU_layer {}; */
225  /* std::vector<float> b_G4U_clusU_x {}; */
226  /* std::vector<float> b_G4U_clusU_y {}; */
227  /* std::vector<float> b_G4U_clusU_z {}; */
228  /* std::vector<float> b_G4U_clusU_r {}; */
229  /* std::vector<int> b_SvU_clusU_i0 {}; // unmatched phg4 unmatched clusters */
230  /* std::vector<int> b_SvU_clusU_i1 {}; */
231  /* std::vector<float> b_SvU_clusU_layer {}; */
232  /* std::vector<float> b_SvU_clusU_x {}; */
233  /* std::vector<float> b_SvU_clusU_y {}; */
234  /* std::vector<float> b_SvU_clusU_z {}; */
235  /* std::vector<float> b_SvU_clusU_r {}; */
236 };
237 
238 #endif // FILLTRUTHRECOMATCHTREE_H