EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RootPlanarClusterWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RootPlanarClusterWriter.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 
14 
15 #include <mutex>
16 
17 class TFile;
18 class TTree;
19 
20 namespace ActsExamples {
21 
34  : public WriterT<GeometryIdMultimap<Acts::PlanarModuleCluster>> {
35  public:
36  struct Config {
38  std::string inputClusters;
40  std::string inputSimulatedHits;
41  std::string filePath = "";
42  std::string fileMode = "RECREATE";
43  std::string treeName = "clusters";
44  TFile* rootFile = nullptr;
45  };
46 
51 
53  ~RootPlanarClusterWriter() override;
54 
56  ProcessCode endRun() final override;
57 
58  protected:
65  const GeometryIdMultimap<Acts::PlanarModuleCluster>&
66  clusters) final override;
67 
68  private:
70  std::mutex m_writeMutex;
71  TFile* m_outputFile;
72  TTree* m_outputTree;
73  int m_eventNr;
74  int m_volumeID;
75  int m_layerID;
77  float m_x;
78  float m_y;
79  float m_z;
80  float m_t;
81  float m_lx;
82  float m_ly;
83  float m_cov_lx;
84  float m_cov_ly;
85  std::vector<int> m_cell_IDx;
86  std::vector<int> m_cell_IDy;
87  std::vector<float> m_cell_lx;
88  std::vector<float> m_cell_ly;
89  std::vector<float> m_cell_data;
90 
91  // (optional) the truth position
92  std::vector<float> m_t_gx;
93  std::vector<float> m_t_gy;
94  std::vector<float> m_t_gz;
95  std::vector<float> m_t_gt;
96  std::vector<float> m_t_lx;
97  std::vector<float> m_t_ly;
98  std::vector<unsigned long>
100 };
101 
102 } // namespace ActsExamples