Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RootTrackParameterWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RootTrackParameterWriter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-2018 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 
20 
21 #include <mutex>
22 #include <string>
23 
24 class TFile;
25 class TTree;
26 namespace ActsFatras {
27 class Barcode;
28 } // namespace ActsFatras
29 
30 namespace ActsExamples {
31 struct AlgorithmContext;
32 
34 
41  public:
44 
45  struct Config {
59  std::string filePath = "estimatedparams.root";
61  std::string treeName = "estimatedparams";
63  std::string fileMode = "RECREATE";
64  };
65 
72 
74  ~RootTrackParameterWriter() override;
75 
77  ProcessCode finalize() override;
78 
80  const Config& config() const { return m_cfg; }
81 
82  protected:
87  const TrackParametersContainer& trackParams) override;
88 
89  private:
91 
93  "InputProtoTracks"};
97  this, "InputMeasurementParticlesMap"};
99  this, "InputMeasurementSimHitsMap"};
100 
101  std::mutex m_writeMutex;
102  TFile* m_outputFile{nullptr};
103  TTree* m_outputTree{nullptr};
104  int m_eventNr{0};
105 
106  float m_loc0{NaNfloat};
107  float m_loc1{NaNfloat};
108  float m_phi{NaNfloat};
109  float m_theta{NaNfloat};
110  float m_qop{NaNfloat};
111  float m_time{NaNfloat};
112  float m_p{NaNfloat};
113  float m_pt{NaNfloat};
114  float m_eta{NaNfloat};
115 
116  int m_t_charge{0};
119  float m_t_phi{NaNfloat};
121  float m_t_qop{NaNfloat};
123  bool m_truthMatched = false;
124 };
125 
126 } // namespace ActsExamples