EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RootSimHitWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RootSimHitWriter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 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 <cstdint>
15 #include <mutex>
16 #include <string>
17 
18 class TFile;
19 class TTree;
20 
21 namespace ActsExamples {
22 
31 class RootSimHitWriter final : public WriterT<SimHitContainer> {
32  public:
33  struct Config {
35  std::string inputSimulatedHits;
37  std::string filePath;
39  std::string fileMode = "RECREATE";
41  std::string treeName = "hits";
42  };
43 
49 
51  ~RootSimHitWriter() final override;
52 
54  ProcessCode endRun() final override;
55 
56  protected:
62  const SimHitContainer& hits) final override;
63 
64  private:
66  std::mutex m_writeMutex;
67  TFile* m_outputFile = nullptr;
68  TTree* m_outputTree = nullptr;
72  uint64_t m_geometryId;
74  uint64_t m_particleId;
76  float m_tx, m_ty, m_tz;
77  // True global hit time in ns.
78  float m_tt;
80  float m_tpx, m_tpy, m_tpz, m_te;
84  int32_t m_index;
85  // Decoded hit surface identifier components.
91 };
92 
93 } // namespace ActsExamples