ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkDetDescr
TrkGeometry
src
MaterialProperties.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
// MaterialProperties.cxx, (c) ATLAS Detector software
8
9
#include "
TrkGeometry/MaterialProperties.h
"
10
11
#include <iostream>
12
13
Trk::MaterialProperties::MaterialProperties
(
float
path,
float
Xo,
float
Lo,
14
float
averageA
,
float
averageZ
,
15
float
averageRho
,
float
dEdX
)
16
:
m_material
(Xo, Lo,
averageA
,
averageZ
,
averageRho
,
dEdX
),
17
m_dInX0
(Xo * Xo > 10e-10 ? path / Xo : 0.),
18
m_dInL0
(Lo * Lo > 10e-10 ? path / Lo : 0.),
19
m_zOaTrTd
(
averageA
*
averageA
> 10e-10
20
?
averageZ
/
averageA
*
averageRho
* path
21
: 0.) {}
22
23
// TODO add constructor with element composition
24
Trk::MaterialProperties::MaterialProperties
(
const
Trk::Material
&
material
,
25
float
path)
26
:
m_material
(
material
),
27
m_dInX0
(
material
.X0 *
material
.X0 > 10e-10 ? path /
material
.X0 : 0.),
28
m_dInL0
(
material
.
L0
*
material
.
L0
> 10e-10 ? path /
material
.
L0
: 0.),
29
m_zOaTrTd
(
material
.
A
*
material
.
A
> 10e-10
30
? path *
material
.Z /
material
.
A
*
material
.rho
31
: 0.) {}
32
33
Trk::MaterialProperties
*
Trk::MaterialProperties::clone
()
const
{
34
return
new
Trk::MaterialProperties
(*
this
);
35
}
36
37
Trk::MaterialProperties
&
Trk::MaterialProperties::operator*=
(
float
scale) {
38
// assuming rescaling of the material thickness
39
m_dInX0
*= scale;
40
m_dInL0
*= scale;
41
m_zOaTrTd
*= scale;
42
43
return
(*
this
);
44
}
45
46
void
Trk::MaterialProperties::addMaterial
(
const
Trk::Material
& mat,
47
float
dInX0) {
49
// averaging factors based on thickness
50
float
fnew = dInX0 * mat.X0 / (
m_dInX0
*
m_material
.X0 + dInX0 * mat.X0);
51
float
fold = 1. - fnew;
52
53
// updated material thickness
54
m_dInX0
+= dInX0;
55
56
// updated material
57
m_material
=
Trk::Material
(1. / (fnew / mat.X0 + fold /
m_material
.X0),
58
1. / (fnew / mat.L0 + fold /
m_material
.L0),
59
fnew * mat.A + fold *
m_material
.A,
60
fnew * mat.Z + fold *
m_material
.Z,
61
fnew * mat.rho + fold *
m_material
.rho);
62
63
// updated derived members
64
m_dInL0
=
m_dInX0
*
m_material
.X0 /
m_material
.L0;
65
m_zOaTrTd
=
m_material
.A > 0 ?
m_dInX0
*
m_material
.X0 *
m_material
.Z /
66
m_material
.A *
m_material
.rho
67
: 0;
68
}
69
70
void
Trk::MaterialProperties::setMaterial
(
const
Trk::Material
& mat,
71
float
thickness
) {
72
// just overwrite what you have
73
m_material
= mat;
74
m_dInX0
=
thickness
/ mat.X0;
75
m_dInL0
=
thickness
/ mat.L0;
76
m_zOaTrTd
= mat.Z / mat.A * mat.rho *
thickness
;
77
}
78
79
void
Trk::MaterialProperties::setDeDx
(
float
dEdX
) {
80
// set the DE/DX value
81
m_material
.dEdX =
dEdX
;
82
}
83
84
MsgStream&
Trk::operator<<
(MsgStream& sl,
85
const
Trk::MaterialProperties
& mprop) {
86
sl <<
"Trk::MaterialProperties: "
<<
endmsg
;
87
sl <<
" - thickness/X0 = "
<< mprop.
thicknessInX0
()
88
<<
endmsg
;
89
sl <<
" - thickness [mm] = "
<< mprop.
thickness
()
90
<<
endmsg
;
91
sl <<
" - radiation length X0 [mm] = "
<< mprop.
x0
() <<
endmsg
;
92
sl <<
" - nuclear interaction length L0 [mm] = "
<< mprop.
l0
() <<
endmsg
;
93
sl <<
" - average material Z/A*rho [gram/mm^3] = "
94
<< mprop.
zOverAtimesRho
() <<
endmsg
;
95
return
sl;
96
}
97
98
std::ostream&
Trk::operator<<
(std::ostream& sl,
99
const
MaterialProperties
& mprop) {
100
sl <<
"Trk::MaterialProperties: "
<< std::endl;
101
sl <<
" - thickness/X0 = "
<< mprop.
thicknessInX0
()
102
<< std::endl;
103
sl <<
" - thickness [mm] = "
<< mprop.
thickness
()
104
<< std::endl;
105
sl <<
" - radiation length X0 [mm] = "
<< mprop.
x0
()
106
<< std::endl;
107
sl <<
" - nuclear interaction length L0 [mm] = "
<< mprop.
l0
()
108
<< std::endl;
109
sl <<
" - average material Z/A*rho [gram/mm^3] = "
110
<< mprop.
zOverAtimesRho
() << std::endl;
111
return
sl;
112
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:61
MaterialProperties.h
Trk::MaterialProperties
Material with information about thickness of material.
Definition
MaterialProperties.h:40
Trk::MaterialProperties::averageRho
float averageRho() const
Return the average density of the material.
Trk::MaterialProperties::clone
MaterialProperties * clone() const
Pseudo-Constructor clone().
Definition
MaterialProperties.cxx:33
Trk::MaterialProperties::m_material
Material m_material
Definition
MaterialProperties.h:121
Trk::MaterialProperties::thicknessInX0
float thicknessInX0() const
Return the radiationlength fraction.
Trk::MaterialProperties::zOverAtimesRho
float zOverAtimesRho() const
Return the .
Trk::MaterialProperties::averageA
float averageA() const
Return the average A of the material [gram/mole].
Trk::MaterialProperties::addMaterial
void addMaterial(const Material &mp, float dInX0)
Material averaging.
Definition
MaterialProperties.cxx:46
Trk::MaterialProperties::averageZ
float averageZ() const
Returns the average Z of the material.
Trk::MaterialProperties::material
const Material & material() const
Return the stored Material.
Trk::MaterialProperties::dEdX
float dEdX() const
Return method for .
Trk::MaterialProperties::m_zOaTrTd
float m_zOaTrTd
- in ATLAS units
Definition
MaterialProperties.h:124
Trk::MaterialProperties::setDeDx
void setDeDx(float dEdX)
Set dEdX - important for material calibarion.
Definition
MaterialProperties.cxx:79
Trk::MaterialProperties::l0
float l0() const
Return the nuclear interaction length.
Trk::MaterialProperties::setMaterial
void setMaterial(const Material &mp, float thickness=1.)
Set Material.
Definition
MaterialProperties.cxx:70
Trk::MaterialProperties::m_dInX0
float m_dInX0
thickness in units of radiation length
Definition
MaterialProperties.h:122
Trk::MaterialProperties::m_dInL0
float m_dInL0
thickness in units of nuclear interaction length
Definition
MaterialProperties.h:123
Trk::MaterialProperties::x0
float x0() const
Return the radiation length.
Trk::MaterialProperties::operator*=
MaterialProperties & operator*=(float scale)
Scale operator - scales the material thickness.
Definition
MaterialProperties.cxx:37
Trk::MaterialProperties::thickness
float thickness() const
Return the thickness in mm.
Trk::MaterialProperties::MaterialProperties
MaterialProperties()=default
Default Constructor.
Trk::Material
A common object to be contained by.
Definition
Material.h:117
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition
AlignModule.cxx:204
Trk::L0
@ L0
Definition
AlignModuleList.h:32
A
hold the test vectors and ease the comparison
Generated on
for ATLAS Offline Software by
1.17.0