ATLAS Offline Software
Loading...
Searching...
No Matches
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
16Trk::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
26Trk::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
42MsgStream& 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
56std::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
70MsgStream& Trk::operator<<(MsgStream& sl, const Trk::MaterialStep& mstep) {
71 return mstep.dump(sl);
72}
73
74std::ostream& Trk::operator<<(std::ostream& sl,
75 const Trk::MaterialStep& mstep) {
76 return mstep.dump(sl);
77}
78
is needed for the recording of MaterialProperties from Geant4 and read them in with the mapping algor...
double rho() const
double Z() const
MaterialStep()=default
Default Constructor needed for POOL.
double l0() const
double hitY() const
double steplength() const
Access method : steplength.
double hitR() const
MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
double A() const
double x0() const
Access method : material X0/A/Z/rho.
double hitX() const
Access method : hitX,Y,Z,R.
double hitZ() const
Ensure that the ATLAS eigen extensions are properly loaded.
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
@ x
Definition ParamDefs.h:55
@ z
global position (cartesian)
Definition ParamDefs.h:57
@ y
Definition ParamDefs.h:56
STL namespace.