EIC 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 
13 
14 #include <mutex>
15 
16 class TFile;
17 class TTree;
18 
19 namespace ActsExamples {
20 
23 
25 
27  public:
28  struct Config {
29  std::string collection;
30  std::string filePath;
31  std::string fileMode = "RECREATE";
32  std::string treeName = "trackparameters";
33  TFile* rootFile = nullptr;
34  };
35 
42 
44  ~RootTrackParameterWriter() override;
45 
47  ProcessCode endRun() final override;
48 
49  protected:
54  const AlgorithmContext& ctx,
55  const std::vector<BoundTrackParameters>& trackParams) final override;
56 
57  private:
59  std::mutex m_writeMutex;
60  TFile* m_outputFile{nullptr};
61  TTree* m_outputTree{nullptr};
62  int m_eventNr{0};
63  float m_d0{0.};
64  float m_z0{0.};
65  float m_phi{0.};
66  float m_theta{0.};
67  float m_qp{0.};
68 };
69 
70 } // namespace ActsExamples