EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ActsEvaluator.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ActsEvaluator.h
1 #ifndef ACTSEVALUATOR_H
2 #define ACTSEVALUATOR_H
3 
4 #include <fun4all/SubsysReco.h>
5 
6 #include <trackbase/TrkrDefs.h>
9 
11 
15 
16 #include <boost/bimap.hpp>
17 
18 class TTree;
19 class TFile;
20 class PHG4Particle;
21 class SvtxTrack;
22 class SvtxVertexMap;
23 class SvtxEvalStack;
24 class SvtxTrackMap;
27 class SvtxEvaluator;
28 
29 #include <map>
30 #include <string>
31 #include <vector>
32 
44 
45 typedef boost::bimap<TrkrDefs::cluskey, unsigned int> CluskeyBimap;
46 
47 
56 class ActsEvaluator : public SubsysReco
57 {
58  public:
59  ActsEvaluator(const std::string &name = "ActsEvaluator.root",
60  SvtxEvaluator *svtxEvaluator = nullptr);
61  ~ActsEvaluator() override;
62 
63  int Init(PHCompositeNode *topNode) override;
64  int process_event(PHCompositeNode *topNode) override;
65  int ResetEvent(PHCompositeNode *topNode) override;
66  int End(PHCompositeNode *topNode) override;
67  void setEvalCKF(bool evalCKF) {m_evalCKF = evalCKF;}
68 
69  private:
70  int getNodes(PHCompositeNode *topNode);
71 
73  void evaluateTrackFits(PHCompositeNode *topNode);
74 
75  void initializeTree();
76 
78 
79  void fillProtoTrack(SvtxTrack* track, PHCompositeNode *topNode);
80 
81  void fillFittedTrackParams(const Trajectory traj,
82  const size_t &trackTip,
83  const Acts::Vector3D vertex);
84 
85  void visitTrackStates(const Trajectory traj,
86  const size_t &trackTip,
87  PHCompositeNode *topNode);
88 
89  void clearTrackVariables();
90 
91  void calculateDCA(const Acts::BoundTrackParameters param,
92  const Acts::Vector3D vertex);
93 
98 
99 
102  float &_gt);
103 
105 
110  std::map<const unsigned int, std::map<const size_t,
111  const unsigned int>> *m_actsTrackKeyMap{nullptr};
112  std::map<const unsigned int, Trajectory> *m_actsFitResults{nullptr};
113 
117 
121  bool m_evalCKF;
122 
123  TFile *m_trackFile{nullptr};
124  TTree *m_trackTree{nullptr};
125 
127  int m_eventNr{0};
128  int m_trajNr{0};
129  int m_trackNr{0};
130 
131  unsigned long m_t_barcode{0};
132  int m_t_charge{0};
133  float m_t_time{0};
134  float m_t_vx{-99.};
135  float m_t_vy{-99.};
136  float m_t_vz{-99.};
137  float m_t_px{-99.};
138  float m_t_py{-99.};
139  float m_t_pz{-99.};
140  float m_t_theta{-99.};
141  float m_t_phi{-99.};
142  float m_t_pT{-99.};
143  float m_t_eta{-99.};
144 
145  std::vector<float> m_t_x;
146  std::vector<float> m_t_y;
147  std::vector<float> m_t_z;
148  std::vector<float> m_t_r;
149  std::vector<float>
151  std::vector<float>
153  std::vector<float>
155 
156  std::vector<float> m_t_eLOC0;
157  std::vector<float> m_t_eLOC1;
158  std::vector<float> m_t_ePHI;
159  std::vector<float> m_t_eTHETA;
160  std::vector<float> m_t_eQOP;
161  std::vector<float> m_t_eT;
162 
163  int m_nHoles{0};
164  int m_nOutliers{0};
165  int m_nStates{0};
167  std::vector<int> m_volumeID;
168  std::vector<int> m_layerID;
169  std::vector<int> m_moduleID;
170  std::vector<float> m_lx_hit;
171  std::vector<float> m_ly_hit;
172  std::vector<float> m_x_hit;
173  std::vector<float> m_y_hit;
174  std::vector<float> m_z_hit;
175  std::vector<float> m_res_x_hit;
176  std::vector<float> m_res_y_hit;
177  std::vector<float> m_err_x_hit;
178  std::vector<float> m_err_y_hit;
179  std::vector<float> m_pull_x_hit;
180  std::vector<float> m_pull_y_hit;
181  std::vector<int> m_dim_hit;
182 
183  bool m_hasFittedParams{false};
184  float m_eLOC0_fit{-99.};
185  float m_eLOC1_fit{-99.};
186  float m_ePHI_fit{-99.};
187  float m_eTHETA_fit{-99.};
188  float m_eQOP_fit{-99.};
189  float m_eT_fit{-99.};
190  float m_err_eLOC0_fit{-99.};
191  float m_err_eLOC1_fit{-99.};
192  float m_err_ePHI_fit{-99.};
193  float m_err_eTHETA_fit{-99.};
194  float m_err_eQOP_fit{-99.};
195  float m_err_eT_fit{-99.};
196  float m_px_fit{-99.};
197  float m_py_fit{-99.};
198  float m_pz_fit{-99.};
199  float m_x_fit{-99.};
200  float m_y_fit{-99.};
201  float m_z_fit{-99.};
202  float m_chi2_fit{-99.};
203  float m_quality{-99.};
204  float m_ndf_fit{-99.};
205  float m_dca3Dxy{-99.};
206  float m_dca3Dz{-99.};
207  float m_dca3DxyCov{-99.};
208  float m_dca3DzCov{-99.};
209  int m_charge_fit{-99};
210 
211  int m_nPredicted{0};
212  std::vector<bool> m_prt;
213  std::vector<float> m_eLOC0_prt;
214  std::vector<float> m_eLOC1_prt;
215  std::vector<float> m_ePHI_prt;
216  std::vector<float> m_eTHETA_prt;
217  std::vector<float> m_eQOP_prt;
218  std::vector<float> m_eT_prt;
219  std::vector<float> m_res_eLOC0_prt;
220  std::vector<float> m_res_eLOC1_prt;
221  std::vector<float> m_res_ePHI_prt;
222  std::vector<float> m_res_eTHETA_prt;
223  std::vector<float> m_res_eQOP_prt;
224  std::vector<float> m_res_eT_prt;
225  std::vector<float> m_err_eLOC0_prt;
226  std::vector<float> m_err_eLOC1_prt;
227  std::vector<float> m_err_ePHI_prt;
228  std::vector<float> m_err_eTHETA_prt;
229  std::vector<float> m_err_eQOP_prt;
230  std::vector<float> m_err_eT_prt;
231  std::vector<float> m_pull_eLOC0_prt;
232  std::vector<float> m_pull_eLOC1_prt;
233  std::vector<float> m_pull_ePHI_prt;
234  std::vector<float> m_pull_eTHETA_prt;
235  std::vector<float> m_pull_eQOP_prt;
236  std::vector<float> m_pull_eT_prt;
237  std::vector<float> m_x_prt;
238  std::vector<float> m_y_prt;
239  std::vector<float> m_z_prt;
240  std::vector<float> m_px_prt;
241  std::vector<float> m_py_prt;
242  std::vector<float> m_pz_prt;
243  std::vector<float> m_eta_prt;
244  std::vector<float> m_pT_prt;
245 
246  int m_nFiltered{0};
247  std::vector<bool> m_flt;
248  std::vector<float> m_eLOC0_flt;
249  std::vector<float> m_eLOC1_flt;
250  std::vector<float> m_ePHI_flt;
251  std::vector<float> m_eTHETA_flt;
252  std::vector<float> m_eQOP_flt;
253  std::vector<float> m_eT_flt;
254  std::vector<float> m_res_eLOC0_flt;
255  std::vector<float> m_res_eLOC1_flt;
256  std::vector<float> m_res_ePHI_flt;
257  std::vector<float> m_res_eTHETA_flt;
258  std::vector<float> m_res_eQOP_flt;
259  std::vector<float> m_res_eT_flt;
260  std::vector<float> m_err_eLOC0_flt;
261  std::vector<float> m_err_eLOC1_flt;
262  std::vector<float> m_err_ePHI_flt;
263  std::vector<float> m_err_eTHETA_flt;
264  std::vector<float> m_err_eQOP_flt;
265  std::vector<float> m_err_eT_flt;
266  std::vector<float> m_pull_eLOC0_flt;
267  std::vector<float> m_pull_eLOC1_flt;
268  std::vector<float> m_pull_ePHI_flt;
269  std::vector<float> m_pull_eTHETA_flt;
270  std::vector<float> m_pull_eQOP_flt;
271  std::vector<float> m_pull_eT_flt;
272  std::vector<float> m_x_flt;
273  std::vector<float> m_y_flt;
274  std::vector<float> m_z_flt;
275  std::vector<float> m_px_flt;
276  std::vector<float> m_py_flt;
277  std::vector<float> m_pz_flt;
278  std::vector<float> m_eta_flt;
279  std::vector<float> m_pT_flt;
280  std::vector<float> m_chi2;
281 
282  int m_nSmoothed{0};
283  std::vector<bool> m_smt;
284  std::vector<float> m_eLOC0_smt;
285  std::vector<float> m_eLOC1_smt;
286  std::vector<float> m_ePHI_smt;
287  std::vector<float> m_eTHETA_smt;
288  std::vector<float> m_eQOP_smt;
289  std::vector<float> m_eT_smt;
290  std::vector<float> m_res_eLOC0_smt;
291  std::vector<float> m_res_eLOC1_smt;
292  std::vector<float> m_res_ePHI_smt;
293  std::vector<float> m_res_eTHETA_smt;
294  std::vector<float> m_res_eQOP_smt;
295  std::vector<float> m_res_eT_smt;
296  std::vector<float> m_err_eLOC0_smt;
297  std::vector<float> m_err_eLOC1_smt;
298  std::vector<float> m_err_ePHI_smt;
299  std::vector<float> m_err_eTHETA_smt;
300  std::vector<float> m_err_eQOP_smt;
301  std::vector<float> m_err_eT_smt;
302  std::vector<float> m_pull_eLOC0_smt;
303  std::vector<float> m_pull_eLOC1_smt;
304  std::vector<float> m_pull_ePHI_smt;
305  std::vector<float> m_pull_eTHETA_smt;
306  std::vector<float> m_pull_eQOP_smt;
307  std::vector<float> m_pull_eT_smt;
308  std::vector<float> m_x_smt;
309  std::vector<float> m_y_smt;
310  std::vector<float> m_z_smt;
311  std::vector<float> m_px_smt;
312  std::vector<float> m_py_smt;
313  std::vector<float> m_pz_smt;
314  std::vector<float> m_eta_smt;
315  std::vector<float> m_pT_smt;
316 
317  float m_protoTrackPx{-9999.};
318  float m_protoTrackPy{-9999.};
319  float m_protoTrackPz{-9999.};
320  float m_protoTrackX{-9999.};
321  float m_protoTrackY{-9999.};
322  float m_protoTrackZ{-9999.};
323  float m_protoD0Cov{-9999.};
324  float m_protoZ0Cov{-9999.};
325  float m_protoPhiCov{-9999.};
326  float m_protoThetaCov{-9999.};
327  float m_protoQopCov{-9999.};
328 
329 
330  std::vector<float> m_SL_lx;
331  std::vector<float> m_SL_ly;
332  std::vector<float> m_SLx;
333  std::vector<float> m_SLy;
334  std::vector<float> m_SLz;
335  std::vector<float> m_t_SL_lx;
336  std::vector<float> m_t_SL_ly;
337  std::vector<float> m_t_SL_gx;
338  std::vector<float> m_t_SL_gy;
339  std::vector<float> m_t_SL_gz;
340 
341 };
342 
343 #endif