ECCE @ EIC Software
Reference for
ECCE @ 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 <
Acts/Propagator/MaterialInteractor.hpp
>
12
#include <
Acts/Utilities/Logger.hpp
>
13
#include <mutex>
14
15
#include "
ACTFW/Framework/IService.hpp
"
16
#include "
ACTFW/Framework/ProcessCode.hpp
"
17
#include "
ACTFW/Framework/WriterT.hpp
"
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
FW {
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
;
58
};
59
63
RootMaterialTrackWriter
(
const
Config
& cfg,
64
Acts::Logging::Level
level =
Acts::Logging::INFO
);
65
67
~RootMaterialTrackWriter
()
override
;
68
70
FW::ProcessCode
endRun
() final override;
71
72
protected:
73
// This implementation holds the actual writing method
78
ProcessCode
writeT
(const
AlgorithmContext
& ctx,
79
const std::vector<Acts::
RecordedMaterialTrack
>&
80
materialtracks) final override;
81
82
private:
84
Config
m_cfg
;
86
std::
mutex
m_writeMutex
;
88
TFile*
m_outputFile
;
90
TTree*
m_outputTree
;
91
92
float
m_v_x
;
93
float
m_v_y
;
94
float
m_v_z
;
95
float
m_v_px
;
96
float
m_v_py
;
97
float
m_v_pz
;
98
float
m_v_phi
;
99
float
m_v_eta
;
100
float
m_tX0
;
101
float
m_tL0
;
102
103
std::vector<
float
>
m_step_sx
;
104
std::vector<
float
>
m_step_sy
;
105
std::vector<
float
>
m_step_sz
;
106
std::vector<
float
>
m_step_x
;
107
std::vector<
float
>
m_step_y
;
108
std::vector<
float
>
m_step_z
;
109
std::vector<
float
>
m_step_ex
;
110
std::vector<
float
>
m_step_ey
;
111
std::vector<
float
>
m_step_ez
;
112
std::vector<
float
>
m_step_length
;
113
std::vector<
float
>
m_step_X0
;
114
std::vector<
float
>
m_step_L0
;
115
std::vector<
float
>
m_step_A
;
116
std::vector<
float
>
m_step_Z
;
117
std::vector<
float
>
m_step_rho
;
118
119
std::vector<std::uint64_t>
120
m_sur_id
;
121
std::vector<int32_t>
122
m_sur_type
;
123
std::vector<
float
>
m_sur_x
;
124
125
std::vector<
float
>
m_sur_y
;
126
127
std::vector<
float
>
m_sur_z
;
128
129
130
std::vector<
float
>
131
m_sur_range_min
;
132
std::vector<
float
>
133
m_sur_range_max
;
134
};
135
136
}
// namespace FW
acts
blob
master
Examples
Io
Root
include
ACTFW
Io
Root
RootMaterialTrackWriter.hpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:24
using
1.8.2 with
ECCE GitHub integration