EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
RootMaterialTrackWriter.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file RootMaterialTrackWriter.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017-2019 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 "
ActsExamples/Framework/IService.hpp
"
12
#include "
ActsExamples/Framework/ProcessCode.hpp
"
13
#include "
ActsExamples/Framework/WriterT.hpp
"
14
#include <
Acts/Propagator/MaterialInteractor.hpp
>
15
#include <
Acts/Utilities/Logger.hpp
>
16
17
#include <mutex>
18
19
class
TFile;
20
class
TTree;
21
22
namespace
Acts {
23
// Using some short hands for Recorded Material
24
using
RecordedMaterial
=
MaterialInteractor::result_type
;
25
// And recorded material track
26
// - this is start: position, start momentum
27
// and the Recorded material
28
using
RecordedMaterialTrack
=
29
std::pair<std::pair<Acts::Vector3D, Acts::Vector3D>,
RecordedMaterial
>;
30
}
// namespace Acts
31
32
namespace
ActsExamples {
33
41
class
RootMaterialTrackWriter
42
:
public
WriterT
<std::vector<Acts::RecordedMaterialTrack>> {
43
public
:
44
struct
Config
{
45
std::string
collection
=
46
"material-tracks"
;
47
std::string
filePath
=
""
;
48
std::string
fileMode
=
"RECREATE"
;
49
std::string
treeName
=
"material-tracks"
;
50
TFile*
rootFile
=
nullptr
;
51
53
bool
recalculateTotals
=
false
;
55
bool
prePostStep
=
false
;
57
bool
storeSurface
=
false
;
59
bool
storeVolume
=
false
;
60
};
61
65
RootMaterialTrackWriter
(
const
Config
& cfg,
66
Acts::Logging::Level
level =
Acts::Logging::INFO
);
67
69
~RootMaterialTrackWriter
()
override
;
70
72
ActsExamples::ProcessCode
endRun
() final override;
73
74
protected:
75
// This implementation holds the actual writing method
80
ProcessCode
writeT
(const
AlgorithmContext
& ctx,
81
const std::
vector
<Acts::
RecordedMaterialTrack
>&
82
materialtracks) final override;
83
84
private:
86
Config
m_cfg
;
88
std::mutex
m_writeMutex
;
90
TFile*
m_outputFile
;
92
TTree*
m_outputTree
;
93
94
float
m_v_x
;
95
float
m_v_y
;
96
float
m_v_z
;
97
float
m_v_px
;
98
float
m_v_py
;
99
float
m_v_pz
;
100
float
m_v_phi
;
101
float
m_v_eta
;
102
float
m_tX0
;
103
float
m_tL0
;
104
105
std::
vector
<
float
>
m_step_sx
;
106
std::
vector
<
float
>
m_step_sy
;
107
std::
vector
<
float
>
m_step_sz
;
108
std::
vector
<
float
>
m_step_x
;
109
std::
vector
<
float
>
m_step_y
;
110
std::
vector
<
float
>
m_step_z
;
111
std::
vector
<
float
>
m_step_ex
;
112
std::
vector
<
float
>
m_step_ey
;
113
std::
vector
<
float
>
m_step_ez
;
114
std::
vector
<
float
>
m_step_dx
;
115
std::
vector
<
float
>
m_step_dy
;
116
std::
vector
<
float
>
m_step_dz
;
117
std::
vector
<
float
>
m_step_length
;
118
std::
vector
<
float
>
m_step_X0
;
119
std::
vector
<
float
>
m_step_L0
;
120
std::
vector
<
float
>
m_step_A
;
121
std::
vector
<
float
>
m_step_Z
;
122
std::
vector
<
float
>
m_step_rho
;
123
124
std::
vector
<std::uint64_t>
125
m_sur_id
;
126
std::
vector
<int32_t>
127
m_sur_type
;
128
std::
vector
<
float
>
m_sur_x
;
129
130
std::
vector
<
float
>
m_sur_y
;
131
132
std::
vector
<
float
>
m_sur_z
;
133
134
std::
vector
<
float
>
135
m_sur_range_min
;
136
std::
vector
<
float
>
137
m_sur_range_max
;
138
139
std::
vector
<std::uint64_t>
140
m_vol_id
;
141
};
142
143
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Io
Root
include
ActsExamples
Io
Root
RootMaterialTrackWriter.hpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:25
using
1.8.2 with
EIC GitHub integration