ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
Trk::Material Class Reference

#include <Material.h>

Inheritance diagram for Trk::Material:
Collaboration diagram for Trk::Material:

Public Member Functions

 Material ()
 Default Constructor needed for POOL. More...
 
 Material (float iX0, float iL0, float iA, float iZ, float iRho, float idEdX=0., MaterialComposition *mc=nullptr)
 Constructor with arguments. More...
 
 Material (const Material &amc)
 Copy Constructor. More...
 
 Material (Material &&amc)
 Move Constructor. More...
 
virtual ~Material ()
 Destructor - delete the composition if there. More...
 
Materialoperator= (const Material &amc)
 Assignment operator. More...
 
Materialoperator= (Material &&amc)
 Move Assignment operator. More...
 
Materialscale (float sf) const
 scaling method More...
 
float zOverAtimesRho () const
 access to members More...
 
float x0 () const
 
float averageZ () const
 
std::string toString () const
 spit out as a string More...
 

Public Attributes

float X0
 
float L0
 
float A
 
float Z
 
float rho
 
float dEdX
 
float zOaTr
 
MaterialCompositioncomposition
 

Detailed Description

A common object to be contained by

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 116 of file Material.h.

Constructor & Destructor Documentation

◆ Material() [1/4]

Trk::Material::Material ( )
inline

Default Constructor needed for POOL.

Definition at line 129 of file Material.h.

130  : X0(10.e10),
131  L0(10.e10),
132  A(0.),
133  Z(0.),
134  rho(0.),
135  dEdX(0.),
136  zOaTr(0.),
137  composition(nullptr) {}

◆ Material() [2/4]

Trk::Material::Material ( float  iX0,
float  iL0,
float  iA,
float  iZ,
float  iRho,
float  idEdX = 0.,
MaterialComposition mc = nullptr 
)
inline

Constructor with arguments.

Definition at line 140 of file Material.h.

142  : X0(iX0),
143  L0(iL0),
144  A(iA),
145  Z(iZ),
146  rho(iRho),
147  dEdX(idEdX),
148  composition(mc)
149  {
150  // Tell clang to optimize assuming that FP exceptions can trap.
151  // Otherwise, it can vectorize the division, which can lead to
152  // spurious division-by-zero traps from unused vector lanes.
154  zOaTr = iA > 0 ? iZ / iA * iRho : 0.;
155  }

◆ Material() [3/4]

Trk::Material::Material ( const Material amc)
inline

Copy Constructor.

Definition at line 158 of file Material.h.

159  : X0(amc.X0),
160  L0(amc.L0),
161  A(amc.A),
162  Z(amc.Z),
163  rho(amc.rho),
164  dEdX(amc.dEdX),
165  zOaTr(amc.zOaTr),
166  composition(amc.composition ? new MaterialComposition(*amc.composition)
167  : nullptr) {}

◆ Material() [4/4]

Trk::Material::Material ( Material &&  amc)
inline

Move Constructor.

Definition at line 170 of file Material.h.

171  : X0(amc.X0),
172  L0(amc.L0),
173  A(amc.A),
174  Z(amc.Z),
175  rho(amc.rho),
176  dEdX(amc.dEdX),
177  zOaTr(amc.zOaTr),
178  composition(amc.composition) {
179  amc.composition = nullptr;
180  }

◆ ~Material()

virtual Trk::Material::~Material ( )
inlinevirtual

Destructor - delete the composition if there.

Definition at line 183 of file Material.h.

183  {
184  if (composition) delete composition;
185  }

Member Function Documentation

◆ averageZ()

float Trk::Material::averageZ ( ) const
inline

Definition at line 227 of file Material.h.

227 { return (*this).Z; }

◆ operator=() [1/2]

Material& Trk::Material::operator= ( const Material amc)
inline

Assignment operator.

Definition at line 188 of file Material.h.

188  {
189  if (this != &amc) {
190  X0 = amc.X0;
191  L0 = amc.L0;
192  A = amc.A;
193  Z = amc.Z;
194  rho = amc.rho;
195  dEdX = amc.dEdX;
196  zOaTr = amc.zOaTr;
197  delete composition;
198  composition =
199  amc.composition ? new MaterialComposition(*amc.composition) : nullptr;
200  }
201  return (*this);
202  }

◆ operator=() [2/2]

Material& Trk::Material::operator= ( Material &&  amc)
inline

Move Assignment operator.

Definition at line 205 of file Material.h.

205  {
206  X0 = amc.X0;
207  L0 = amc.L0;
208  A = amc.A;
209  Z = amc.Z;
210  rho = amc.rho;
211  dEdX = amc.dEdX;
212  zOaTr = amc.zOaTr;
213  if (composition && composition != amc.composition) {
214  delete composition;
215  }
216  composition = amc.composition;
217  amc.composition = nullptr;
218  return *this;
219  }

◆ scale()

Material * Trk::Material::scale ( float  sf) const
inline

scaling method

Definition at line 239 of file Material.h.

239  {
240  // Tell clang to optimize assuming that FP exceptions can trap.
241  // Otherwise, it can vectorize the division, which can lead to
242  // spurious division-by-zero traps from unused vector lanes.
244  return new Material(X0 / sf, L0 / sf, sf * A, sf * Z, sf * rho);
245 }

◆ toString()

std::string Trk::Material::toString ( ) const
inline

spit out as a string

Definition at line 230 of file Material.h.

230  {
231  std::ostringstream sout;
232  sout << std::setiosflags(std::ios::fixed) << std::setprecision(4);
233  sout << "(" << X0 << " | " << L0 << " | " << A << " | " << Z << " | " << rho
234  << ")";
235  return sout.str();
236  }

◆ x0()

float Trk::Material::x0 ( ) const
inline

Definition at line 226 of file Material.h.

226 { return (*this).X0; }

◆ zOverAtimesRho()

float Trk::Material::zOverAtimesRho ( ) const
inline

access to members

Definition at line 225 of file Material.h.

225 { return (*this).zOaTr; }

Member Data Documentation

◆ A

float Trk::Material::A

Definition at line 121 of file Material.h.

◆ composition

MaterialComposition* Trk::Material::composition

Definition at line 126 of file Material.h.

◆ dEdX

float Trk::Material::dEdX

Definition at line 124 of file Material.h.

◆ L0

float Trk::Material::L0

Definition at line 120 of file Material.h.

◆ rho

float Trk::Material::rho

Definition at line 123 of file Material.h.

◆ X0

float Trk::Material::X0

Definition at line 119 of file Material.h.

◆ Z

float Trk::Material::Z

Definition at line 122 of file Material.h.

◆ zOaTr

float Trk::Material::zOaTr

Definition at line 125 of file Material.h.


The documentation for this class was generated from the following file:
Trk::Material::Material
Material()
Default Constructor needed for POOL.
Definition: Material.h:129
CXXUTILS_TRAPPING_FP
#define CXXUTILS_TRAPPING_FP
Definition: trapping_fp.h:24
Trk::Material::L0
float L0
Definition: Material.h:120
Trk::Material::Z
float Z
Definition: Material.h:122
A
mc
Definition: mc.PG_single_nu_valid.py:1
Trk::Material::A
float A
Definition: Material.h:121
Trk::Material::X0
float X0
Definition: Material.h:119
Trk::Material::rho
float rho
Definition: Material.h:123
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
Trk::Material::composition
MaterialComposition * composition
Definition: Material.h:126
Trk::Material::dEdX
float dEdX
Definition: Material.h:124
Trk::Material::zOaTr
float zOaTr
Definition: Material.h:125