EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RootMaterialTrackReader.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RootMaterialTrackReader.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 
17 
18 #include <mutex>
19 #include <vector>
20 
21 class TChain;
22 
23 namespace ActsExamples {
24 
31  public:
33  struct Config {
34  std::string collection =
35  "material-tracks";
36  std::string filePath = "";
37  std::string treeName = "material-tracks";
38  std::vector<std::string> fileList;
39 
40  unsigned int batchSize = 1;
41 
43  std::shared_ptr<const Acts::Logger> logger;
44 
46  std::string name;
47 
51  Config(const std::string& lname = "MaterialReader",
53  : logger(Acts::getDefaultLogger(lname, lvl)), name(lname) {}
54  };
55 
58  RootMaterialTrackReader(const Config& cfg);
59 
62 
64  std::string name() const final override;
65 
67  std::pair<size_t, size_t> availableEvents() const final override;
68 
73  const ActsExamples::AlgorithmContext& context) final override;
74 
75  private:
77  const Acts::Logger& logger() const { return *m_cfg.logger; }
78 
81 
83  std::mutex m_read_mutex;
84 
86  size_t m_events = 0;
87 
89  TChain* m_inputChain = nullptr;
90 
91  float m_v_x;
92  float m_v_y;
93  float m_v_z;
94  float m_v_px;
95  float m_v_py;
96  float m_v_pz;
97  float m_v_phi;
98  float m_v_eta;
99  float m_tX0;
100  float m_tL0;
101 
102  std::vector<float>* m_step_x = new std::vector<float>;
103  std::vector<float>* m_step_y = new std::vector<float>;
104  std::vector<float>* m_step_z = new std::vector<float>;
105  std::vector<float>* m_step_dx = new std::vector<float>;
106  std::vector<float>* m_step_dy = new std::vector<float>;
107  std::vector<float>* m_step_dz = new std::vector<float>;
108  std::vector<float>* m_step_length = new std::vector<float>;
109  std::vector<float>* m_step_X0 = new std::vector<float>;
110  std::vector<float>* m_step_L0 = new std::vector<float>;
111  std::vector<float>* m_step_A = new std::vector<float>;
112  std::vector<float>* m_step_Z = new std::vector<float>;
113  std::vector<float>* m_step_rho =
114  new std::vector<float>;
115 };
116 
117 } // namespace ActsExamples