Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
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
11
#include "
Acts/Digitization/PlanarModuleCluster.hpp
"
12
#include "
Acts/Geometry/TrackingGeometry.hpp
"
13
#include "
Acts/Utilities/Logger.hpp
"
14
#include "
ActsExamples/EventData/GeometryContainers.hpp
"
15
#include "
ActsExamples/EventData/SimHit.hpp
"
16
#include "
ActsExamples/Framework/DataHandle.hpp
"
17
#include "
ActsExamples/Framework/ProcessCode.hpp
"
18
#include "
ActsExamples/Framework/WriterT.hpp
"
19
20
#include <cstdint>
21
#include <memory>
22
#include <mutex>
23
#include <string>
24
#include <vector>
25
26
class
TFile;
27
class
TTree;
28
namespace
Acts {
29
class
PlanarModuleCluster;
30
class
TrackingGeometry
;
31
}
// namespace Acts
32
33
namespace
ActsExamples {
34
struct
AlgorithmContext;
35
47
class
RootPlanarClusterWriter
48
:
public
WriterT
<GeometryIdMultimap<Acts::PlanarModuleCluster>> {
49
public
:
50
struct
Config
{
52
std::string
inputClusters
;
54
std::string
inputSimHits
;
55
std::string
filePath
=
""
;
56
std::string
fileMode
=
"RECREATE"
;
57
std::string
treeName
=
"clusters"
;
58
59
std::shared_ptr<const Acts::TrackingGeometry>
trackingGeometry
;
60
};
61
65
RootPlanarClusterWriter
(
const
Config
&
config
,
Acts::Logging::Level
level
);
66
68
~RootPlanarClusterWriter
()
override
;
69
71
ProcessCode
finalize
()
override
;
72
74
const
Config
&
config
()
const
{
return
m_cfg
; }
75
76
protected
:
82
ProcessCode
writeT
(
83
const
AlgorithmContext
& ctx,
84
const
GeometryIdMultimap<Acts::PlanarModuleCluster>
&
clusters
)
override
;
85
86
private
:
87
Config
m_cfg
;
88
std::mutex
m_writeMutex
;
89
TFile*
m_outputFile
{
nullptr
};
90
TTree*
m_outputTree
{
nullptr
};
91
int
m_eventNr
= 0;
92
int
m_volumeID
= 0;
93
int
m_layerID
= 0;
94
int
m_surfaceID
= 0;
95
float
m_x
= 0;
96
float
m_y
= 0;
97
float
m_z
= 0;
98
float
m_t
= 0;
99
float
m_lx
= 0;
100
float
m_ly
= 0;
101
float
m_cov_lx
= 0;
102
float
m_cov_ly
= 0;
103
std::vector<int>
m_cell_IDx
;
104
std::vector<int>
m_cell_IDy
;
105
std::vector<float>
m_cell_lx
;
106
std::vector<float>
m_cell_ly
;
107
std::vector<float>
m_cell_data
;
108
109
// (optional) the truth position
110
std::vector<float>
m_t_gx
;
111
std::vector<float>
m_t_gy
;
112
std::vector<float>
m_t_gz
;
113
std::vector<float>
m_t_gt
;
114
std::vector<float>
m_t_lx
;
115
std::vector<float>
m_t_ly
;
116
std::vector<uint64_t>
m_t_barcode
;
117
118
ReadDataHandle<SimHitContainer>
m_inputSimHits
{
this
,
"InputSimHits"
};
119
};
120
121
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Io
Root
include
ActsExamples
Io
Root
RootPlanarClusterWriter.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:38
using
1.8.2 with
sPHENIX GitHub integration