|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #ifndef TRKGEOMETRY_MATERIAL_H
10 #define TRKGEOMETRY_MATERIAL_H
23 static const double s_oneOverUcharMax = 1. /
double(UCHAR_MAX);
41 const std::pair<unsigned char, unsigned char>&
ef) {
43 std::pair<unsigned char, unsigned char>::operator=(
ef);
50 return static_cast<unsigned int>((*this).first);
55 return (
static_cast<unsigned int>((*this).second)) * s_oneOverUcharMax;
72 const std::vector<unsigned char>& ifrac) {
74 for (std::size_t elvc = 0; elvc < iel.size() && !ifrac.empty(); ++elvc)
80 const std::vector<std::pair<unsigned char, unsigned char> >& efracs) {
81 reserve(efracs.size());
82 for (
auto& efracIt : efracs) push_back(efracIt);
92 std::vector<ElementFraction>::operator=(
mc);
99 const std::vector<std::pair<unsigned char, unsigned char> >& efracs) {
101 reserve(efracs.size());
102 for (
auto& efracIt : efracs) push_back(efracIt);
140 Material(
float iX0,
float iL0,
float iA,
float iZ,
float iRho,
154 zOaTr = iA > 0 ? iZ / iA * iRho : 0.;
179 amc.composition =
nullptr;
217 amc.composition =
nullptr;
226 float x0()
const {
return (*this).X0; }
231 std::ostringstream sout;
232 sout << std::setiosflags(std::ios::fixed) << std::setprecision(4);
233 sout <<
"(" <<
X0 <<
" | " <<
L0 <<
" | " <<
A <<
" | " <<
Z <<
" | " <<
rho
Material()
Default Constructor needed for POOL.
#define CXXUTILS_TRAPPING_FP
MaterialComposition & operator=(const std::vector< std::pair< unsigned char, unsigned char > > &efracs)
assignment operator for persistency (2)
ElementFraction()
Default Constructor.
virtual ~Material()
Destructor - delete the composition if there.
Material(float iX0, float iL0, float iA, float iZ, float iRho, float idEdX=0., MaterialComposition *mc=nullptr)
Constructor with arguments.
float zOverAtimesRho() const
access to members
ElementFraction & operator=(const std::pair< unsigned char, unsigned char > &ef)
assignment operator from base class
MaterialComposition & operator=(MaterialComposition &&)=default
MaterialComposition(MaterialComposition &&)=default
Material(const Material &amc)
Copy Constructor.
unsigned int element() const
Return in a nice format.
Material(Material &&amc)
Move Constructor.
ElementFraction(const std::pair< unsigned char, unsigned char > &ef)
Copy Constructor from base class.
MaterialComposition(const std::vector< ElementFraction > &mc)
Copy constructor from base class.
MaterialComposition()
default constructors
Tell the compiler to optimize assuming that FP may trap.
Material & operator=(const Material &amc)
Assignment operator.
Ensure that the ATLAS eigen extensions are properly loaded.
ElementFraction(unsigned char iz, unsigned char ifrac)
Constructor from arguments.
std::string toString() const
spit out as a string
MaterialComposition & operator=(const MaterialComposition &)=default
Material & operator=(Material &&amc)
Move Assignment operator.
MaterialComposition * composition
MaterialComposition(const std::vector< unsigned char > &iel, const std::vector< unsigned char > &ifrac)
constructor for persistency (1), size optimized
MaterialComposition(const MaterialComposition &)=default
Material * scale(float sf) const
scaling method
double fraction() const
Return in a nice format.
MaterialComposition & operator=(const std::vector< ElementFraction > &mc)
assignment operator from base class
MaterialComposition(const std::vector< std::pair< unsigned char, unsigned char > > &efracs)
constructor for persistency (2), size optimized