ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RootMaterialTrackWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RootMaterialTrackWriter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-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 
13 #include <mutex>
14 
18 
19 class TFile;
20 class TTree;
21 
22 namespace Acts {
23 // Using some short hands for Recorded Material
25 // And recorded material track
26 // - this is start: position, start momentum
27 // and the Recorded material
29  std::pair<std::pair<Acts::Vector3D, Acts::Vector3D>, RecordedMaterial>;
30 } // namespace Acts
31 
32 namespace FW {
33 
42  : public WriterT<std::vector<Acts::RecordedMaterialTrack>> {
43  public:
44  struct Config {
45  std::string collection =
46  "material-tracks";
47  std::string filePath = "";
48  std::string fileMode = "RECREATE";
49  std::string treeName = "material-tracks";
50  TFile* rootFile = nullptr;
51 
53  bool recalculateTotals = false;
55  bool prePostStep = false;
57  bool storesurface = false;
58  };
59 
65 
67  ~RootMaterialTrackWriter() override;
68 
70  FW::ProcessCode endRun() final override;
71 
72  protected:
73  // This implementation holds the actual writing method
79  const std::vector<Acts::RecordedMaterialTrack>&
80  materialtracks) final override;
81 
82  private:
88  TFile* m_outputFile;
90  TTree* m_outputTree;
91 
92  float m_v_x;
93  float m_v_y;
94  float m_v_z;
95  float m_v_px;
96  float m_v_py;
97  float m_v_pz;
98  float m_v_phi;
99  float m_v_eta;
100  float m_tX0;
101  float m_tL0;
102 
103  std::vector<float> m_step_sx;
104  std::vector<float> m_step_sy;
105  std::vector<float> m_step_sz;
106  std::vector<float> m_step_x;
107  std::vector<float> m_step_y;
108  std::vector<float> m_step_z;
109  std::vector<float> m_step_ex;
110  std::vector<float> m_step_ey;
111  std::vector<float> m_step_ez;
112  std::vector<float> m_step_length;
113  std::vector<float> m_step_X0;
114  std::vector<float> m_step_L0;
115  std::vector<float> m_step_A;
116  std::vector<float> m_step_Z;
117  std::vector<float> m_step_rho;
118 
119  std::vector<std::uint64_t>
121  std::vector<int32_t>
123  std::vector<float> m_sur_x;
124 
125  std::vector<float> m_sur_y;
126 
127  std::vector<float> m_sur_z;
128 
129 
130  std::vector<float>
132  std::vector<float>
134 };
135 
136 } // namespace FW