ATLAS Offline Software
MaterialStep.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // MaterialStep.h, (c) ATLAS Detector software
8 
9 #ifndef TRKGEOMETRY_MATERIALSTEP_H
10 #define TRKGEOMETRY_MATERIALSTEP_H
11 
12 #include <iostream>
13 #include <vector>
14 
15 #include "TrkGeometry/Material.h"
16 
17 class MsgStream;
18 
19 class MaterialStepCnv_p1;
20 
21 namespace Trk {
22 
34 class MaterialStep {
35  public:
37  MaterialStep() = default;
38 
40  MaterialStep(float x, float y, float z, float t, float matX0, float matL0,
41  float matA, float matZ, float matRho, float matdEdX = 0.);
42 
44  MaterialStep(float x, float y, float z, float t, float matX0, float matL0,
45  float matA, float matZ, float matRho,
46  const std::vector<unsigned char>& elements,
47  const std::vector<unsigned char>& fractions, float matdEdX = 0.);
48 
50  MaterialStep(const MaterialStep& mstep) = default;
51  MaterialStep(MaterialStep&& mstep) = default;
52 
54  MaterialStep& operator=(const MaterialStep& mstep) = default;
55  MaterialStep& operator=(MaterialStep&& mstep) = default;
56 
58  ~MaterialStep() = default;
59 
61  MsgStream& dump(MsgStream& sl) const;
62 
64  std::ostream& dump(std::ostream& sl) const;
65 
67  double steplength() const;
68 
70  double steplengthInX0() const;
71 
73  double steplengthInL0() const;
74 
76  double hitX() const;
77  double hitY() const;
78  double hitZ() const;
79  double hitR() const;
80 
82  double x0() const;
83  double l0() const;
84  double A() const;
85  double Z() const;
86  double rho() const;
87 
88  const Material& fullMaterial() const;
89 
90  protected:
91  friend class ::MaterialStepCnv_p1;
92  float m_steplength = 0;
93  float m_hitX = 0;
94  float m_hitY = 0;
95  float m_hitZ = 0;
96  float m_hitR = 0;
98 };
99 
100 inline double MaterialStep::steplength() const { return m_steplength; }
101 
102 inline double MaterialStep::steplengthInX0() const {
103  return (m_steplength / m_material.X0);
104 }
105 
106 inline double MaterialStep::steplengthInL0() const {
107  return (m_steplength / m_material.L0);
108 }
109 
110 inline double MaterialStep::hitX() const { return m_hitX; }
111 
112 inline double MaterialStep::hitY() const { return m_hitY; }
113 
114 inline double MaterialStep::hitZ() const { return m_hitZ; }
115 
116 inline double MaterialStep::hitR() const { return m_hitR; }
117 
118 inline double MaterialStep::x0() const { return m_material.X0; }
119 
120 inline double MaterialStep::l0() const { return m_material.L0; }
121 
122 inline double MaterialStep::A() const { return m_material.A; }
123 
124 inline double MaterialStep::Z() const { return m_material.Z; }
125 
126 inline double MaterialStep::rho() const { return m_material.rho; }
127 
128 inline const Material& MaterialStep::fullMaterial() const { return m_material; }
129 
132 MsgStream& operator<<(MsgStream& sl, const MaterialStep& mstep);
133 std::ostream& operator<<(std::ostream& sl, const MaterialStep& mstep);
134 
135 } // namespace Trk
136 
137 #endif
Trk::MaterialStep::operator=
MaterialStep & operator=(const MaterialStep &mstep)=default
Assignment operators.
Trk::MaterialStep::A
double A() const
Definition: MaterialStep.h:122
Trk::y
@ y
Definition: ParamDefs.h:56
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:57
Trk::Material::L0
float L0
Definition: Material.h:120
Trk::MaterialStep::hitX
double hitX() const
Access method : hitX,Y,Z,R.
Definition: MaterialStep.h:110
Trk::Material::Z
float Z
Definition: Material.h:122
Trk::MaterialStep::fullMaterial
const Material & fullMaterial() const
Definition: MaterialStep.h:128
Trk::MaterialStep::steplengthInX0
double steplengthInX0() const
Access method : steplength.
Definition: MaterialStep.h:102
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::MaterialStep::hitR
double hitR() const
Definition: MaterialStep.h:116
MaterialStepCnv_p1
Definition: MaterialStepCnv_p1.h:20
Trk::MaterialStep::x0
double x0() const
Access method : material X0/A/Z/rho.
Definition: MaterialStep.h:118
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
Trk::MaterialStep::steplength
double steplength() const
Access method : steplength.
Definition: MaterialStep.h:100
Trk::Material::A
float A
Definition: Material.h:121
Trk::MaterialStep::l0
double l0() const
Definition: MaterialStep.h:120
Trk::MaterialStep::hitY
double hitY() const
Definition: MaterialStep.h:112
Trk::MaterialStep::operator=
MaterialStep & operator=(MaterialStep &&mstep)=default
Trk::Material::X0
float X0
Definition: Material.h:119
Trk::MaterialStep::m_hitY
float m_hitY
Definition: MaterialStep.h:94
Trk::MaterialStep::steplengthInL0
double steplengthInL0() const
Access method : steplength.
Definition: MaterialStep.h:106
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::MaterialStep::m_hitX
float m_hitX
Definition: MaterialStep.h:93
Trk::MaterialStep::m_material
Material m_material
Definition: MaterialStep.h:97
Trk::Material::rho
float rho
Definition: Material.h:123
Trk::MaterialStep::m_steplength
float m_steplength
Definition: MaterialStep.h:92
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
Trk::MaterialStep::MaterialStep
MaterialStep(MaterialStep &&mstep)=default
Trk::MaterialStep::~MaterialStep
~MaterialStep()=default
Destructor.
Trk::MaterialStep::MaterialStep
MaterialStep()=default
Default Constructor needed for POOL.
Trk::Material
Definition: Material.h:116
Trk::MaterialStep::rho
double rho() const
Definition: MaterialStep.h:126
Trk::x
@ x
Definition: ParamDefs.h:55
Trk::MaterialStep::m_hitZ
float m_hitZ
Definition: MaterialStep.h:95
Material.h
Trk::MaterialStep::m_hitR
float m_hitR
Definition: MaterialStep.h:96
Trk::MaterialStep::Z
double Z() const
Definition: MaterialStep.h:124
Trk::MaterialStep::hitZ
double hitZ() const
Definition: MaterialStep.h:114
Trk::MaterialStep::MaterialStep
MaterialStep(const MaterialStep &mstep)=default
Copy / Move Constructors.