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 
16 
17 #include <mutex>
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 ActsExamples {
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;
59  bool storeVolume = false;
60  };
61 
67 
69  ~RootMaterialTrackWriter() override;
70 
72  ActsExamples::ProcessCode endRun() final override;
73 
74  protected:
75  // This implementation holds the actual writing method
81  const std::vector<Acts::RecordedMaterialTrack>&
82  materialtracks) final override;
83 
84  private:
88  std::mutex m_writeMutex;
90  TFile* m_outputFile;
92  TTree* m_outputTree;
93 
94  float m_v_x;
95  float m_v_y;
96  float m_v_z;
97  float m_v_px;
98  float m_v_py;
99  float m_v_pz;
100  float m_v_phi;
101  float m_v_eta;
102  float m_tX0;
103  float m_tL0;
104 
105  std::vector<float> m_step_sx;
106  std::vector<float> m_step_sy;
107  std::vector<float> m_step_sz;
108  std::vector<float> m_step_x;
109  std::vector<float> m_step_y;
110  std::vector<float> m_step_z;
111  std::vector<float> m_step_ex;
112  std::vector<float> m_step_ey;
113  std::vector<float> m_step_ez;
114  std::vector<float> m_step_dx;
115  std::vector<float> m_step_dy;
116  std::vector<float> m_step_dz;
117  std::vector<float> m_step_length;
118  std::vector<float> m_step_X0;
119  std::vector<float> m_step_L0;
120  std::vector<float> m_step_A;
121  std::vector<float> m_step_Z;
122  std::vector<float> m_step_rho;
123 
124  std::vector<std::uint64_t>
126  std::vector<int32_t>
128  std::vector<float> m_sur_x;
129 
130  std::vector<float> m_sur_y;
131 
132  std::vector<float> m_sur_z;
133 
134  std::vector<float>
136  std::vector<float>
138 
139  std::vector<std::uint64_t>
141 };
142 
143 } // namespace ActsExamples