ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkDetDescr
TrkGeometry
src
AssociatedMaterial.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// AssociatedMaterial.cxx, (c) ATLAS Detector software
8
9
#include "
TrkGeometry/AssociatedMaterial.h
"
10
11
#include "
TrkGeometry/Layer.h
"
12
#include "
TrkGeometry/TrackingVolume.h
"
13
// Gaudi
14
#include "GaudiKernel/MsgStream.h"
15
// STD
16
#include <iostream>
17
18
Trk::AssociatedMaterial::AssociatedMaterial
()
19
:
m_materialPosition
(
Amg
::
Vector3D
(0., 0., 0.)),
20
m_correctionFactor
(0.),
21
m_materialProperties
(nullptr),
22
m_materialStep
(nullptr),
23
m_trackingVolume
(nullptr),
24
m_layer
(nullptr),
25
m_cleanup
(false) {}
26
27
Trk::AssociatedMaterial::AssociatedMaterial
(
const
Amg::Vector3D
& hitpos,
28
float
steplength
,
float
X0,
29
float
L0
,
float
A
,
float
Z
,
30
float
rho
,
float
cFactor,
31
const
TrackingVolume
* tvol,
32
const
Layer
* lay)
33
:
m_materialPosition
(hitpos),
34
m_correctionFactor
(cFactor),
35
m_materialProperties
(nullptr),
36
m_materialStep
(new
Trk
::
MaterialStep
(hitpos.
x
(), hitpos.
y
(), hitpos.
z
(),
37
steplength
, X0,
L0
,
A
,
Z
,
rho
)),
38
m_trackingVolume
(tvol),
39
m_layer
(lay),
40
m_cleanup
(true) {}
41
42
Trk::AssociatedMaterial::AssociatedMaterial
(
43
const
Amg::Vector3D
& hitpos,
float
steplength
,
const
Trk::Material
& mat,
44
float
cFactor,
const
TrackingVolume
* tvol,
const
Layer
* lay)
45
:
m_materialPosition
(hitpos),
46
m_correctionFactor
(cFactor),
47
m_materialProperties
(new
Trk
::
MaterialProperties
(mat,
steplength
)),
48
m_materialStep
(nullptr),
49
m_trackingVolume
(tvol),
50
m_layer
(lay),
51
m_cleanup
(true) {}
52
53
Trk::AssociatedMaterial::AssociatedMaterial
(
54
const
Amg::Vector3D
& hitpos,
const
Trk::MaterialProperties
* mprop,
55
float
cFactor,
const
Trk::TrackingVolume
* tvol,
const
Trk::Layer
* lay)
56
:
m_materialPosition
(hitpos),
57
m_correctionFactor
(cFactor),
58
m_materialProperties
(mprop),
59
m_materialStep
(nullptr),
60
m_trackingVolume
(tvol),
61
m_layer
(lay),
62
m_cleanup
(false)
63
64
{}
65
66
Trk::AssociatedMaterial::AssociatedMaterial
(
const
Trk::MaterialStep
* ms,
67
float
cFactor,
68
const
Trk::TrackingVolume
* tvol,
69
const
Trk::Layer
* lay)
70
:
m_materialPosition
(
Amg
::
Vector3D
(ms->hitX(), ms->hitY(), ms->hitZ())),
71
m_correctionFactor
(cFactor),
72
m_materialProperties
(nullptr),
73
m_materialStep
(ms),
74
m_trackingVolume
(tvol),
75
m_layer
(lay),
76
m_cleanup
(false) {}
77
78
Trk::AssociatedMaterial::AssociatedMaterial
(
const
Amg::Vector3D
& hitpos,
79
const
Trk::TrackingVolume
* tvol,
80
const
Trk::Layer
* lay)
81
:
m_materialPosition
(hitpos),
82
m_correctionFactor
(0.),
83
m_materialProperties
(nullptr),
84
m_materialStep
(nullptr),
85
m_trackingVolume
(tvol),
86
m_layer
(lay),
87
m_cleanup
(false) {}
88
89
Trk::AssociatedMaterial::AssociatedMaterial
(
const
Trk::AssociatedMaterial
& am)
90
:
m_materialPosition
(am.
m_materialPosition
),
91
m_correctionFactor
(am.
m_correctionFactor
),
92
m_materialProperties
(am.
m_cleanup
&& am.
m_materialProperties
93
? am.
m_materialProperties
->clone()
94
: am.
m_materialProperties
),
95
m_materialStep
((am.
m_cleanup
&& am.
m_materialStep
)
96
? new
Trk
::
MaterialStep
(*am.
m_materialStep
)
97
: am.
m_materialStep
),
98
m_trackingVolume
(am.
m_trackingVolume
),
99
m_layer
(am.
m_layer
),
100
m_cleanup
(am.
m_cleanup
) {}
101
102
Trk::AssociatedMaterial::AssociatedMaterial
(
103
Trk::AssociatedMaterial
&& am) noexcept
104
:
m_materialPosition
(std::move(am.m_materialPosition)),
105
m_correctionFactor
(am.m_correctionFactor),
106
m_materialProperties
(am.m_materialProperties),
107
m_materialStep
(am.m_materialStep),
108
m_trackingVolume
(am.m_trackingVolume),
109
m_layer
(am.m_layer),
110
m_cleanup
(am.m_cleanup) {
111
am.m_materialProperties =
nullptr
;
112
am.m_materialStep =
nullptr
;
113
am.m_cleanup =
false
;
114
}
115
116
Trk::AssociatedMaterial
&
Trk::AssociatedMaterial::operator=
(
117
const
Trk::AssociatedMaterial
& am) {
118
if
(&am !=
this
) {
119
if
(
m_cleanup
) {
120
delete
m_materialStep
;
121
delete
m_materialProperties
;
122
}
123
m_materialPosition
= am.
m_materialPosition
;
124
m_correctionFactor
= am.
m_correctionFactor
;
125
m_materialProperties
= (am.
m_cleanup
&& am.
m_materialProperties
)
126
? am.
m_materialProperties
->
clone
()
127
: am.
m_materialProperties
;
128
m_materialStep
= (am.
m_cleanup
&& am.
m_materialStep
)
129
?
new
Trk::MaterialStep
(*am.
m_materialStep
)
130
: am.
m_materialStep
;
131
m_trackingVolume
= am.
m_trackingVolume
;
132
m_layer
= am.
m_layer
;
133
m_cleanup
= am.
m_cleanup
;
134
}
135
return
(*
this
);
136
}
137
138
Trk::AssociatedMaterial
&
Trk::AssociatedMaterial::operator=
(
139
Trk::AssociatedMaterial
&& am)
noexcept
{
140
m_materialPosition
= std::move(am.m_materialPosition);
141
m_correctionFactor
= am.m_correctionFactor;
142
m_trackingVolume
= am.m_trackingVolume;
143
m_layer
= am.m_layer;
144
m_cleanup
= am.m_cleanup;
145
146
if
(
m_materialProperties
&&
m_materialProperties
!= am.m_materialProperties) {
147
delete
m_materialProperties
;
148
}
149
m_materialProperties
= am.m_materialProperties;
150
am.m_materialProperties =
nullptr
;
151
152
if
(
m_materialStep
&&
m_materialStep
!= am.m_materialStep) {
153
delete
m_materialStep
;
154
}
155
m_materialStep
= am.m_materialStep;
156
am.m_materialStep =
nullptr
;
157
158
am.m_cleanup =
false
;
159
return
*
this
;
160
}
161
162
Trk::AssociatedMaterial::~AssociatedMaterial
() {
163
if
(
m_cleanup
) {
164
delete
m_materialStep
;
165
delete
m_materialProperties
;
166
}
167
}
168
169
MsgStream&
Trk::AssociatedMaterial::dump
(MsgStream& sl)
const
{
170
sl <<
"----> AssociatedMaterial - recorded at (x/y/z) | r : ("
171
<<
m_materialPosition
.x() <<
"/ "
;
172
sl <<
m_materialPosition
.y() <<
"/ "
;
173
sl <<
m_materialPosition
.z() <<
")"
<< std::endl;
174
sl <<
" Material (t/x0/l0/A/Z/rho) : ("
<<
steplength
() <<
"/ "
;
175
sl <<
x0
() <<
"/ "
;
176
sl <<
l0
() <<
"/ "
;
177
sl <<
A
() <<
"/ "
;
178
sl <<
Z
() <<
"/ "
;
179
sl <<
rho
() <<
")"
<< std::endl;
180
if
(
m_trackingVolume
)
181
sl <<
" Associated to TrackingVolume : "
182
<<
m_trackingVolume
->volumeName() << std::endl;
183
if
(
m_layer
)
184
sl <<
" and Layer with Index : "
185
<<
m_layer
->layerIndex().value() << std::endl;
186
return
sl;
187
}
188
189
std::ostream&
Trk::AssociatedMaterial::dump
(std::ostream& sl)
const
{
190
sl <<
"----> AssociatedMaterial - recorded at (x/y/z) | r : ("
191
<<
m_materialPosition
.x() <<
"/ "
;
192
sl <<
m_materialPosition
.y() <<
"/ "
;
193
sl <<
m_materialPosition
.z() <<
")"
<< std::endl;
194
sl <<
" Material (t/x0/l0/A/Z/rho) : ("
<<
steplength
() <<
"/ "
;
195
sl <<
x0
() <<
"/ "
;
196
sl <<
l0
() <<
"/ "
;
197
sl <<
A
() <<
"/ "
;
198
sl <<
Z
() <<
"/ "
;
199
sl <<
rho
() <<
")"
<< std::endl;
200
if
(
m_trackingVolume
)
201
sl <<
" Associated to TrackingVolume : "
202
<<
m_trackingVolume
->volumeName() << std::endl;
203
if
(
m_layer
)
204
sl <<
" and Layer with Index : "
205
<<
m_layer
->layerIndex().value() << std::endl;
206
return
sl;
207
}
208
209
MsgStream&
Trk::operator<<
(MsgStream& sl,
210
const
Trk::AssociatedMaterial
& mstep) {
211
return
mstep.
dump
(sl);
212
}
213
214
std::ostream&
Trk::operator<<
(std::ostream& sl,
215
const
Trk::AssociatedMaterial
& mstep) {
216
return
mstep.
dump
(sl);
217
}
218
AssociatedMaterial.h
Layer.h
Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
TrackingVolume.h
Trk::AssociatedMaterial
It is used in the Mapping process ( using MaterialSteps ), the validation and recostruction ( using M...
Definition
AssociatedMaterial.h:33
Trk::AssociatedMaterial::x0
double x0() const
Access method : material X0/A/Z/rho.
Definition
AssociatedMaterial.h:160
Trk::AssociatedMaterial::Z
double Z() const
Definition
AssociatedMaterial.h:201
Trk::AssociatedMaterial::m_trackingVolume
const Trk::TrackingVolume * m_trackingVolume
Definition
AssociatedMaterial.h:122
Trk::AssociatedMaterial::l0
double l0() const
Definition
AssociatedMaterial.h:189
Trk::AssociatedMaterial::m_cleanup
bool m_cleanup
Definition
AssociatedMaterial.h:124
Trk::AssociatedMaterial::rho
double rho() const
Definition
AssociatedMaterial.h:207
Trk::AssociatedMaterial::A
double A() const
Definition
AssociatedMaterial.h:195
Trk::AssociatedMaterial::steplength
double steplength() const
Access method : steplength.
Definition
AssociatedMaterial.h:167
Trk::AssociatedMaterial::m_materialPosition
Amg::Vector3D m_materialPosition
Definition
AssociatedMaterial.h:118
Trk::AssociatedMaterial::~AssociatedMaterial
~AssociatedMaterial()
Destructor.
Definition
AssociatedMaterial.cxx:162
Trk::AssociatedMaterial::AssociatedMaterial
AssociatedMaterial()
Default constructor.
Definition
AssociatedMaterial.cxx:18
Trk::AssociatedMaterial::operator=
AssociatedMaterial & operator=(const AssociatedMaterial &am)
Assignment operator.
Definition
AssociatedMaterial.cxx:116
Trk::AssociatedMaterial::dump
MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
Definition
AssociatedMaterial.cxx:169
Trk::AssociatedMaterial::m_correctionFactor
float m_correctionFactor
Definition
AssociatedMaterial.h:119
Trk::AssociatedMaterial::m_layer
const Trk::Layer * m_layer
Definition
AssociatedMaterial.h:123
Trk::AssociatedMaterial::m_materialStep
const Trk::MaterialStep * m_materialStep
Definition
AssociatedMaterial.h:121
Trk::AssociatedMaterial::m_materialProperties
const Trk::MaterialProperties * m_materialProperties
Definition
AssociatedMaterial.h:120
Trk::Layer
Base Class for a Detector Layer in the Tracking realm.
Definition
Layer.h:72
Trk::MaterialProperties
Material with information about thickness of material.
Definition
MaterialProperties.h:40
Trk::MaterialProperties::clone
MaterialProperties * clone() const
Pseudo-Constructor clone().
Definition
MaterialProperties.cxx:33
Trk::MaterialStep
is needed for the recording of MaterialProperties from Geant4 and read them in with the mapping algor...
Definition
MaterialStep.h:34
Trk::Material
A common object to be contained by.
Definition
Material.h:117
Trk::TrackingVolume
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
Definition
TrackingVolume.h:119
Amg
Definition of ATLAS Math & Geometry primitives (Amg).
Definition
AmgStringHelpers.h:19
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition
AlignModule.cxx:204
Trk::x
@ x
Definition
ParamDefs.h:55
Trk::z
@ z
global position (cartesian)
Definition
ParamDefs.h:57
Trk::y
@ y
Definition
ParamDefs.h:56
Trk::L0
@ L0
Definition
AlignModuleList.h:32
Generated on
for ATLAS Offline Software by
1.17.0