ATLAS Offline Software
MaterialStep.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 // MaterialStep.cxx, (c) ATLAS Detector software
8 
10 // Gaudi
11 #include "GaudiKernel/MsgStream.h"
12 // STD
13 #include <cmath>
14 #include <iostream>
15 
16 Trk::MaterialStep::MaterialStep(float x, float y, float z, float stepL,
17  float matX0, float matL0, float matA,
18  float matZ, float matRho, float matdEdX)
19  : m_steplength(stepL),
20  m_hitX(x),
21  m_hitY(y),
22  m_hitZ(z),
23  m_hitR(std::sqrt(x * x + y * y)),
24  m_material(matX0, matL0, matA, matZ, matRho, matdEdX) {}
25 
26 Trk::MaterialStep::MaterialStep(float x, float y, float z, float stepL,
27  float matX0, float matL0, float matA,
28  float matZ, float matRho,
29  const std::vector<unsigned char>& elements,
30  const std::vector<unsigned char>& fractions,
31  float matdEdX)
32  : m_steplength(stepL),
33  m_hitX(x),
34  m_hitY(y),
35  m_hitZ(z),
36  m_hitR(std::sqrt(x * x + y * y)),
37  m_material(matX0, matL0, matA, matZ, matRho, matdEdX,
38  new Trk::MaterialComposition(elements, fractions))
39 
40 {}
41 
42 MsgStream& Trk::MaterialStep::dump(MsgStream& sl) const {
43  sl << "----> MaterialStep - recorded at (x/y/z) | r : (" << hitX() << "/ ";
44  sl << hitY() << "/ ";
45  sl << hitZ() << ") | ";
46  sl << hitR() << std::endl;
47  sl << " Material (t/x0/l0/A/Z/rho) : (" << steplength() << "/ ";
48  sl << x0() << "/ ";
49  sl << l0() << "/ ";
50  sl << A() << "/ ";
51  sl << Z() << "/ ";
52  sl << rho() << ")" << std::endl;
53  return sl;
54 }
55 
56 std::ostream& Trk::MaterialStep::dump(std::ostream& sl) const {
57  sl << "----> MaterialStep - recorded at (x/y/z) | r : (" << hitX() << "/ ";
58  sl << hitY() << "/ ";
59  sl << hitZ() << ") | ";
60  sl << hitR() << std::endl;
61  sl << " Material (t/x0/l0/A/Z/rho) : (" << steplength() << "/ ";
62  sl << x0() << "/ ";
63  sl << l0() << "/ ";
64  sl << A() << "/ ";
65  sl << Z() << "/ ";
66  sl << rho() << ")" << std::endl;
67  return sl;
68 }
69 
70 MsgStream& Trk::operator<<(MsgStream& sl, const Trk::MaterialStep& mstep) {
71  return mstep.dump(sl);
72 }
73 
74 std::ostream& Trk::operator<<(std::ostream& sl,
75  const Trk::MaterialStep& mstep) {
76  return mstep.dump(sl);
77 }
78 
Trk::y
@ y
Definition: ParamDefs.h:56
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:57
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
Trk::MaterialComposition
Definition: Material.h:60
x
#define x
Trk::MaterialStep::dump
MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
Definition: MaterialStep.cxx:42
Trk::MaterialStep
Definition: MaterialStep.h:34
A
z
#define z
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
y
#define y
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
ReadCellNoiseFromCoolCompare.l0
l0
Definition: ReadCellNoiseFromCoolCompare.py:359
Trk::MaterialStep::MaterialStep
MaterialStep()=default
Default Constructor needed for POOL.
Trk::x
@ x
Definition: ParamDefs.h:55
fitman.rho
rho
Definition: fitman.py:532
MaterialStep.h