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
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 "
Acts/Definitions/Algebra.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 <cstddef>
18
#include <cstdint>
19
#include <mutex>
20
#include <string>
21
#include <unordered_map>
22
#include <utility>
23
#include <vector>
24
25
class
TFile;
26
class
TTree;
27
namespace
ActsExamples {
28
struct
AlgorithmContext;
29
}
// namespace ActsExamples
30
31
namespace
Acts {
32
// Using some short hands for Recorded Material
33
using
RecordedMaterial
=
MaterialInteractor::result_type
;
34
// And recorded material track
35
// - this is start: position, start momentum
36
// and the Recorded material
37
using
RecordedMaterialTrack
=
38
std::pair<std::pair<Acts::Vector3, Acts::Vector3>,
RecordedMaterial
>;
39
}
// namespace Acts
40
41
namespace
ActsExamples {
42
50
class
RootMaterialTrackWriter
51
:
public
WriterT
<std::unordered_map<size_t, Acts::RecordedMaterialTrack>> {
52
public
:
53
struct
Config
{
54
std::string
collection
=
55
"material-tracks"
;
56
std::string
filePath
=
""
;
57
std::string
fileMode
=
"RECREATE"
;
58
std::string
treeName
=
"material-tracks"
;
59
61
bool
recalculateTotals
=
false
;
63
bool
prePostStep
=
false
;
65
bool
storeSurface
=
false
;
67
bool
storeVolume
=
false
;
70
bool
collapseInteractions
=
false
;
71
};
72
76
RootMaterialTrackWriter
(
const
Config
&
config
,
77
Acts::Logging::Level
level
=
Acts::Logging::INFO
);
78
80
~RootMaterialTrackWriter
()
override
;
81
83
ActsExamples::ProcessCode
finalize
()
override
;
84
86
const
Config
&
config
()
const
{
return
m_cfg
; }
87
88
protected
:
89
// This implementation holds the actual writing method
94
ProcessCode
writeT
(
95
const
AlgorithmContext
& ctx,
96
const
std::unordered_map<size_t, Acts::RecordedMaterialTrack>&
97
materialtracks)
override
;
98
99
private
:
101
Config
m_cfg
;
103
std::mutex
m_writeMutex
;
105
TFile*
m_outputFile
=
nullptr
;
107
TTree*
m_outputTree
=
nullptr
;
108
110
uint32_t
m_eventId
= 0;
111
112
float
m_v_x
= 0;
113
float
m_v_y
= 0;
114
float
m_v_z
= 0;
115
float
m_v_px
= 0;
116
float
m_v_py
= 0;
117
float
m_v_pz
= 0;
118
float
m_v_phi
= 0;
119
float
m_v_eta
= 0;
120
float
m_tX0
= 0;
121
float
m_tL0
= 0;
122
123
std::vector<float>
m_step_sx
;
124
std::vector<float>
m_step_sy
;
125
std::vector<float>
m_step_sz
;
126
std::vector<float>
m_step_x
;
127
std::vector<float>
m_step_y
;
128
std::vector<float>
m_step_z
;
129
std::vector<float>
m_step_ex
;
130
std::vector<float>
m_step_ey
;
131
std::vector<float>
m_step_ez
;
132
std::vector<float>
m_step_dx
;
133
std::vector<float>
m_step_dy
;
134
std::vector<float>
m_step_dz
;
135
std::vector<float>
m_step_length
;
136
std::vector<float>
m_step_X0
;
137
std::vector<float>
m_step_L0
;
138
std::vector<float>
m_step_A
;
139
std::vector<float>
m_step_Z
;
140
std::vector<float>
m_step_rho
;
141
142
std::vector<std::uint64_t>
143
m_sur_id
;
144
std::vector<int32_t>
145
m_sur_type
;
146
std::vector<float>
m_sur_x
;
147
148
std::vector<float>
m_sur_y
;
149
150
std::vector<float>
m_sur_z
;
151
152
std::vector<float>
153
m_sur_pathCorrection
;
154
155
std::vector<float>
156
m_sur_range_min
;
157
std::vector<float>
158
m_sur_range_max
;
159
160
std::vector<std::uint64_t>
161
m_vol_id
;
162
};
163
164
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Io
Root
include
ActsExamples
Io
Root
RootMaterialTrackWriter.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:38
using
1.8.2 with
sPHENIX GitHub integration