ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RootTrajectoryWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RootTrajectoryWriter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
11 #include <mutex>
12 #include <vector>
13 
17 
18 class TFile;
19 class TTree;
20 
21 namespace FW {
22 
38 class RootTrajectoryWriter final : public WriterT<TrajectoryContainer> {
39  public:
41  struct Config {
42  std::string inputParticles;
43  std::string inputTrajectories;
44  std::string outputDir;
45  std::string outputFilename = "tracks.root";
46  std::string outputTreename = "tracks";
47  std::string fileMode = "RECREATE";
48  TFile* rootFile = nullptr;
49  };
50 
56 
58  ~RootTrajectoryWriter() final override;
59 
61  ProcessCode endRun() final override;
62 
63  protected:
68  const TrajectoryContainer& trajectories) final override;
69 
70  private:
73  TFile* m_outputFile{nullptr};
74  TTree* m_outputTree{nullptr};
75  int m_eventNr{0};
76  int m_trajNr{0};
77 
78  unsigned long m_t_barcode{0};
79  int m_t_charge{0};
80  float m_t_time{0};
81  float m_t_vx{-99.};
82  float m_t_vy{-99.};
83  float m_t_vz{-99.};
84  float m_t_px{-99.};
85  float m_t_py{-99.};
86  float m_t_pz{-99.};
87  float m_t_theta{-99.};
88  float m_t_phi{-99.};
89  float m_t_pT{-99.};
90  float m_t_eta{-99.};
91 
92  std::vector<float> m_t_x;
93  std::vector<float> m_t_y;
94  std::vector<float> m_t_z;
95  std::vector<float> m_t_r;
96  std::vector<float>
98  std::vector<float>
100  std::vector<float>
102 
103  std::vector<float> m_t_eLOC0;
104  std::vector<float> m_t_eLOC1;
105  std::vector<float> m_t_ePHI;
106  std::vector<float> m_t_eTHETA;
107  std::vector<float> m_t_eQOP;
108  std::vector<float> m_t_eT;
109 
110  int m_nStates{0};
112  std::vector<int> m_volumeID;
113  std::vector<int> m_layerID;
114  std::vector<int> m_moduleID;
115  std::vector<float> m_lx_hit;
116  std::vector<float> m_ly_hit;
117  std::vector<float> m_x_hit;
118  std::vector<float> m_y_hit;
119  std::vector<float> m_z_hit;
120  std::vector<float> m_res_x_hit;
121  std::vector<float> m_res_y_hit;
122  std::vector<float> m_err_x_hit;
123  std::vector<float> m_err_y_hit;
124  std::vector<float> m_pull_x_hit;
125  std::vector<float> m_pull_y_hit;
126  std::vector<int> m_dim_hit;
127 
129  float m_eLOC0_fit{-99.};
130  float m_eLOC1_fit{-99.};
131  float m_ePHI_fit{-99.};
132  float m_eTHETA_fit{-99.};
133  float m_eQOP_fit{-99.};
134  float m_eT_fit{-99.};
135  float m_err_eLOC0_fit{-99.};
136  float m_err_eLOC1_fit{-99.};
137  float m_err_ePHI_fit{-99.};
138  float m_err_eTHETA_fit{-99.};
139  float m_err_eQOP_fit{-99.};
140  float m_err_eT_fit{-99.};
141 
142  int m_nPredicted{0};
143  std::vector<bool> m_prt;
144  std::vector<float> m_eLOC0_prt;
145  std::vector<float> m_eLOC1_prt;
146  std::vector<float> m_ePHI_prt;
147  std::vector<float> m_eTHETA_prt;
148  std::vector<float> m_eQOP_prt;
149  std::vector<float> m_eT_prt;
150  std::vector<float> m_res_eLOC0_prt;
151  std::vector<float> m_res_eLOC1_prt;
152  std::vector<float> m_res_ePHI_prt;
153  std::vector<float> m_res_eTHETA_prt;
154  std::vector<float> m_res_eQOP_prt;
155  std::vector<float> m_res_eT_prt;
156  std::vector<float> m_err_eLOC0_prt;
157  std::vector<float> m_err_eLOC1_prt;
158  std::vector<float> m_err_ePHI_prt;
159  std::vector<float> m_err_eTHETA_prt;
160  std::vector<float> m_err_eQOP_prt;
161  std::vector<float> m_err_eT_prt;
162  std::vector<float> m_pull_eLOC0_prt;
163  std::vector<float> m_pull_eLOC1_prt;
164  std::vector<float> m_pull_ePHI_prt;
165  std::vector<float> m_pull_eTHETA_prt;
166  std::vector<float> m_pull_eQOP_prt;
167  std::vector<float> m_pull_eT_prt;
168  std::vector<float> m_x_prt;
169  std::vector<float> m_y_prt;
170  std::vector<float> m_z_prt;
171  std::vector<float> m_px_prt;
172  std::vector<float> m_py_prt;
173  std::vector<float> m_pz_prt;
174  std::vector<float> m_eta_prt;
175  std::vector<float> m_pT_prt;
176 
177  int m_nFiltered{0};
178  std::vector<bool> m_flt;
179  std::vector<float> m_eLOC0_flt;
180  std::vector<float> m_eLOC1_flt;
181  std::vector<float> m_ePHI_flt;
182  std::vector<float> m_eTHETA_flt;
183  std::vector<float> m_eQOP_flt;
184  std::vector<float> m_eT_flt;
185  std::vector<float> m_res_eLOC0_flt;
186  std::vector<float> m_res_eLOC1_flt;
187  std::vector<float> m_res_ePHI_flt;
188  std::vector<float> m_res_eTHETA_flt;
189  std::vector<float> m_res_eQOP_flt;
190  std::vector<float> m_res_eT_flt;
191  std::vector<float> m_err_eLOC0_flt;
192  std::vector<float> m_err_eLOC1_flt;
193  std::vector<float> m_err_ePHI_flt;
194  std::vector<float> m_err_eTHETA_flt;
195  std::vector<float> m_err_eQOP_flt;
196  std::vector<float> m_err_eT_flt;
197  std::vector<float> m_pull_eLOC0_flt;
198  std::vector<float> m_pull_eLOC1_flt;
199  std::vector<float> m_pull_ePHI_flt;
200  std::vector<float> m_pull_eTHETA_flt;
201  std::vector<float> m_pull_eQOP_flt;
202  std::vector<float> m_pull_eT_flt;
203  std::vector<float> m_x_flt;
204  std::vector<float> m_y_flt;
205  std::vector<float> m_z_flt;
206  std::vector<float> m_px_flt;
207  std::vector<float> m_py_flt;
208  std::vector<float> m_pz_flt;
209  std::vector<float> m_eta_flt;
210  std::vector<float> m_pT_flt;
211  std::vector<float> m_chi2;
212 
213  int m_nSmoothed{0};
214  std::vector<bool> m_smt;
215  std::vector<float> m_eLOC0_smt;
216  std::vector<float> m_eLOC1_smt;
217  std::vector<float> m_ePHI_smt;
218  std::vector<float> m_eTHETA_smt;
219  std::vector<float> m_eQOP_smt;
220  std::vector<float> m_eT_smt;
221  std::vector<float> m_res_eLOC0_smt;
222  std::vector<float> m_res_eLOC1_smt;
223  std::vector<float> m_res_ePHI_smt;
224  std::vector<float> m_res_eTHETA_smt;
225  std::vector<float> m_res_eQOP_smt;
226  std::vector<float> m_res_eT_smt;
227  std::vector<float> m_err_eLOC0_smt;
228  std::vector<float> m_err_eLOC1_smt;
229  std::vector<float> m_err_ePHI_smt;
230  std::vector<float> m_err_eTHETA_smt;
231  std::vector<float> m_err_eQOP_smt;
232  std::vector<float> m_err_eT_smt;
233  std::vector<float> m_pull_eLOC0_smt;
234  std::vector<float> m_pull_eLOC1_smt;
235  std::vector<float> m_pull_ePHI_smt;
236  std::vector<float> m_pull_eTHETA_smt;
237  std::vector<float> m_pull_eQOP_smt;
238  std::vector<float> m_pull_eT_smt;
239  std::vector<float> m_x_smt;
240  std::vector<float> m_y_smt;
241  std::vector<float> m_z_smt;
242  std::vector<float> m_px_smt;
243  std::vector<float> m_py_smt;
244  std::vector<float> m_pz_smt;
245  std::vector<float> m_eta_smt;
246  std::vector<float> m_pT_smt;
247 };
248 
249 } // namespace FW