Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RootPropagationStepsWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RootPropagationStepsWriter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018-2022 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 
15 
16 #include <cstddef>
17 #include <mutex>
18 #include <string>
19 #include <vector>
20 
21 class TFile;
22 class TTree;
23 
24 namespace ActsExamples {
25 struct AlgorithmContext;
26 
27 using PropagationSteps = std::vector<Acts::detail::Step>;
28 
41  : public WriterT<std::vector<PropagationSteps>> {
42  public:
43  struct Config {
45  "propagation_steps";
47  std::string fileMode = "RECREATE";
48  std::string treeName = "propagation_steps";
49  TFile* rootFile = nullptr;
50  };
51 
57 
59  ~RootPropagationStepsWriter() override;
60 
62  ProcessCode finalize() override;
63 
65  const Config& config() const { return m_cfg; }
66 
67  protected:
74  const AlgorithmContext& context,
75  const std::vector<PropagationSteps>& stepCollection) override;
76 
77  private:
79  std::mutex m_writeMutex;
80  TFile* m_outputFile = nullptr;
81  TTree* m_outputTree = nullptr;
82  int m_eventNr = 0;
83  std::vector<int> m_volumeID;
84  std::vector<int> m_boundaryID;
85  std::vector<int> m_layerID;
86  std::vector<int> m_approachID;
87  std::vector<int> m_sensitiveID;
88  std::vector<int> m_material;
89  std::vector<float> m_x;
90  std::vector<float> m_y;
91  std::vector<float> m_z;
92  std::vector<float> m_dx;
93  std::vector<float> m_dy;
94  std::vector<float> m_dz;
95  std::vector<int> m_step_type;
96  std::vector<float> m_step_acc;
97  std::vector<float> m_step_act;
98  std::vector<float> m_step_abt;
99  std::vector<float> m_step_usr;
100  std::vector<size_t>
102 
103 };
104 
105 } // namespace ActsExamples