ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::CompoundLayerMaterial Class Referencefinal

It extends the LayerMaterialProperties base class, and has a intrinsic accuracy of about 0.5 % on the dynamic range from using unsigned char. More...

#include <CompoundLayerMaterial.h>

Inheritance diagram for Trk::CompoundLayerMaterial:
Collaboration diagram for Trk::CompoundLayerMaterial:

Public Member Functions

 CompoundLayerMaterial ()=default
 Default Constructor - needed by POOL.
 CompoundLayerMaterial (const Trk::BinUtility &binutility, const ValueStore &thicknessBins, const ValueStore &x0Bins, const ValueStore &l0Bins, const ValueStore &aBins, const ValueStore &zBins, const ValueStore &rhoBins, const std::vector< std::vector< MaterialComposition > > &composition, bool fComposition=false)
 Explizit constructor.
 CompoundLayerMaterial (const CompoundLayerMaterial &mprop)
 Copy Constructor.
virtual ~CompoundLayerMaterial () override
 Destructor.
virtual CompoundLayerMaterialclone () const override final
 Pseudo-Constructor clone()
CompoundLayerMaterialoperator= (const CompoundLayerMaterial &lmp)
 Assignment operator.
virtual CompoundLayerMaterialoperator*= (double scale) override final
 Scale operator.
virtual const BinUtilitybinUtility () const override final
 Return the BinUtility.
virtual void updateBinning (BinUtility *bu) override final
 Update the BinUtility if necessary - passing ownership of the utility class.
virtual const MaterialPropertiesfullMaterial (const Amg::Vector3D &gp) const override final
 Return method for full material description of the Layer.
virtual const MaterialPropertiesmaterial (size_t bin0, size_t bin1) const override final
 Access the single bin.
void updateElementTable (const std::shared_ptr< const ElementTable > &set)
 Update the ElementTable.
const ElementTableelementTable () const
 Get the ElementTable.
virtual MsgStream & dump (MsgStream &sl) const override final
 Output Method for MsgStream, to be overloaded by child classes.
virtual std::ostream & dump (std::ostream &sl) const override final
 Output Method for std::ostream, to be overloaded by child classes.
void updateElementTable (const std::shared_ptr< const ElementTable > &) const
 Update the ElementTable.
double factor (PropDirection pDir, MaterialUpdateStage mStage) const
 Update pre factor.
double alongPreFactor () const
 Return method for pre update material description of the Layer along normalvector.
double alongPostFactor () const
 Return method for post update material description of the Layer along normalvector.
double oppositePreFactor () const
 Return method for pre update material description of the Layer along normalvector.
double oppositePostFactor () const
 Return method for post update material description of the Layer along normalvector.

Protected Attributes

double m_splitFactor
 the split factor in favour of oppositePre

Private Types

using MaterialPropertiesCUP = CxxUtils::CachedUniquePtr<MaterialProperties>

Private Member Functions

void resizeMaterialProperties ()

Private Attributes

std::vector< std::vector< MaterialPropertiesCUP > > m_materialProperties
 the ones you return
BinUtilitym_binUtility {nullptr}
 the helper for the bin finding
ValueStore m_thicknessBins {}
 thickness parameter
ValueStore m_x0Bins {}
 x0 parameter
ValueStore m_l0Bins {}
 l0 parameter
ValueStore m_aBins {}
 A parameters (averaged)
ValueStore m_zBins {}
 Z parameter (averaged)
ValueStore m_rhoBins {}
 rho parameter (averaged)
std::vector< std::vector< MaterialComposition > > m_composition
 composition matrix
bool m_fullComposition {false}
 full composition calculation
std::shared_ptr< const ElementTablem_elementTable

Friends

class ::CompoundLayerMaterialCnv_p1

Detailed Description

It extends the LayerMaterialProperties base class, and has a intrinsic accuracy of about 0.5 % on the dynamic range from using unsigned char.

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

Definition at line 60 of file CompoundLayerMaterial.h.

Member Typedef Documentation

◆ MaterialPropertiesCUP

Constructor & Destructor Documentation

◆ CompoundLayerMaterial() [1/3]

Trk::CompoundLayerMaterial::CompoundLayerMaterial ( )
default

Default Constructor - needed by POOL.

◆ CompoundLayerMaterial() [2/3]

Trk::CompoundLayerMaterial::CompoundLayerMaterial ( const Trk::BinUtility & binutility,
const ValueStore & thicknessBins,
const ValueStore & x0Bins,
const ValueStore & l0Bins,
const ValueStore & aBins,
const ValueStore & zBins,
const ValueStore & rhoBins,
const std::vector< std::vector< MaterialComposition > > & composition,
bool fComposition = false )

Explizit constructor.

Definition at line 14 of file CompoundLayerMaterial.cxx.

20 : m_binUtility(binutility.clone()),
21 m_thicknessBins(thicknessBins),
22 m_x0Bins(x0Bins),
23 m_l0Bins(l0Bins),
24 m_aBins(aBins),
25 m_zBins(zBins),
26 m_rhoBins(rhoBins),
27 m_composition(composition),
28 m_fullComposition(fComposition),
29 m_elementTable(std::shared_ptr<const Trk::ElementTable>(nullptr))
30{
32}
BinUtility * clone() const
Implizit Constructor.
Definition BinUtility.h:120
ValueStore m_rhoBins
rho parameter (averaged)
bool m_fullComposition
full composition calculation
std::shared_ptr< const ElementTable > m_elementTable
ValueStore m_thicknessBins
thickness parameter
ValueStore m_x0Bins
x0 parameter
ValueStore m_aBins
A parameters (averaged)
ValueStore m_zBins
Z parameter (averaged)
std::vector< std::vector< MaterialComposition > > m_composition
composition matrix
BinUtility * m_binUtility
the helper for the bin finding
ValueStore m_l0Bins
l0 parameter

◆ CompoundLayerMaterial() [3/3]

Trk::CompoundLayerMaterial::CompoundLayerMaterial ( const CompoundLayerMaterial & mprop)

Copy Constructor.

Definition at line 34 of file CompoundLayerMaterial.cxx.

36 : Trk::LayerMaterialProperties(clm),
37 m_binUtility(clm.m_binUtility->clone()),
38 m_thicknessBins(clm.m_thicknessBins),
39 m_x0Bins(clm.m_x0Bins),
40 m_l0Bins(clm.m_l0Bins),
41 m_aBins(clm.m_aBins),
42 m_zBins(clm.m_zBins),
43 m_rhoBins(clm.m_rhoBins),
44 m_composition(clm.m_composition),
45 m_fullComposition(clm.m_fullComposition),
46 m_elementTable(clm.m_elementTable)
47{
49}

◆ ~CompoundLayerMaterial()

Trk::CompoundLayerMaterial::~CompoundLayerMaterial ( )
overridevirtual

Destructor.

Definition at line 73 of file CompoundLayerMaterial.cxx.

73 {
74 delete m_binUtility;
75}

Member Function Documentation

◆ alongPostFactor()

double Trk::LayerMaterialProperties::alongPostFactor ( ) const
inlineinherited

Return method for post update material description of the Layer along normalvector.

Definition at line 142 of file LayerMaterialProperties.h.

142 {
143 return m_splitFactor;
144}
double m_splitFactor
the split factor in favour of oppositePre

◆ alongPreFactor()

double Trk::LayerMaterialProperties::alongPreFactor ( ) const
inlineinherited

Return method for pre update material description of the Layer along normalvector.

inline return methods for the pre/post factors

Definition at line 138 of file LayerMaterialProperties.h.

138 {
139 return (1. - m_splitFactor);
140}

◆ binUtility()

const BinUtility * Trk::CompoundLayerMaterial::binUtility ( ) const
inlinefinaloverridevirtual

Return the BinUtility.

Implements Trk::LayerMaterialProperties.

Definition at line 139 of file CompoundLayerMaterial.h.

139 {
140 return m_binUtility;
141}

◆ clone()

Trk::CompoundLayerMaterial * Trk::CompoundLayerMaterial::clone ( ) const
finaloverridevirtual

Pseudo-Constructor clone()

Implements Trk::LayerMaterialProperties.

Definition at line 77 of file CompoundLayerMaterial.cxx.

77 {
78 return new Trk::CompoundLayerMaterial(*this);
79}

◆ dump() [1/2]

MsgStream & Trk::CompoundLayerMaterial::dump ( MsgStream & sl) const
finaloverridevirtual

Output Method for MsgStream, to be overloaded by child classes.

Implements Trk::LayerMaterialProperties.

Definition at line 147 of file CompoundLayerMaterial.cxx.

147 {
148 sl << "Trk::CompoundLayerMaterial : \n";
149 sl << " - Number of Material bins (1/2) : " << m_binUtility->max(0) + 1
150 << " / " << m_binUtility->max(1) + 1 << "\n";
151 return sl;
152}

◆ dump() [2/2]

std::ostream & Trk::CompoundLayerMaterial::dump ( std::ostream & sl) const
finaloverridevirtual

Output Method for std::ostream, to be overloaded by child classes.

Implements Trk::LayerMaterialProperties.

Definition at line 154 of file CompoundLayerMaterial.cxx.

154 {
155 sl << "Trk::CompoundLayerMaterial : " << std::endl;
156 sl << " - Number of Material bins (1/2) : " << m_binUtility->max(0) + 1
157 << " / " << m_binUtility->max(1) + 1 << std::endl;
158 return sl;
159}

◆ elementTable()

const ElementTable * Trk::CompoundLayerMaterial::elementTable ( ) const
inline

Get the ElementTable.

Definition at line 155 of file CompoundLayerMaterial.h.

155 {
156 return m_elementTable.get();
157}

◆ factor()

double Trk::LayerMaterialProperties::factor ( PropDirection pDir,
MaterialUpdateStage mStage ) const
inlineinherited

Update pre factor.

inline return methods for the pre/post factors

Definition at line 130 of file LayerMaterialProperties.h.

131 {
132 if (mStage == Trk::fullUpdate) return 1.;
133 return (static_cast<int>(pDir) * static_cast<int>(mStage) > 0 ?
135}
@ fullUpdate

◆ fullMaterial()

const Trk::MaterialProperties * Trk::CompoundLayerMaterial::fullMaterial ( const Amg::Vector3D & gp) const
finaloverridevirtual

Return method for full material description of the Layer.

Implements Trk::LayerMaterialProperties.

Definition at line 87 of file CompoundLayerMaterial.cxx.

88 {
89 // first bin
90 size_t bin0 = m_binUtility->bin(gp, 0);
91 // second bin
92 size_t bin1 = (m_binUtility->max(1) == 0) ? 0 : m_binUtility->bin(gp, 1);
93 return material(bin0, bin1);
94}
virtual const MaterialProperties * material(size_t bin0, size_t bin1) const override final
Access the single bin.

◆ material()

const Trk::MaterialProperties * Trk::CompoundLayerMaterial::material ( size_t bin0,
size_t bin1 ) const
finaloverridevirtual

Access the single bin.

<

Todo
measure if this is slow

Implements Trk::LayerMaterialProperties.

Definition at line 96 of file CompoundLayerMaterial.cxx.

98{
100 if (!p) {
101 // get the size
102 const double thickness = m_thicknessBins.value(bin0, bin1);
103 // no thickness or no x0 - return a null pointer
104 if (thickness == 0.) return nullptr;
105 double x0 = 0.;
106 double l0 = 0.;
107 double a = 0.;
108 double z = 0.;
109 double rho = 0.;
110 // the full composition calculation
111 if (m_fullComposition && m_elementTable.get()) {
113 for (const auto& eFraction : m_composition[bin1][bin0]) {
114 double fraction = eFraction.fraction();
115 const Trk::Material* material =
116 m_elementTable->element(eFraction.element());
117 if (material) {
118 x0 += material->X0 * fraction;
119 l0 += material->L0 * fraction;
120 a += material->A * fraction;
121 z += material->Z * fraction;
122 rho += material->rho * fraction;
123 }
124 }
125 } else {
126 x0 = m_x0Bins.value(bin0, bin1);
127 l0 = m_l0Bins.value(bin0, bin1);
128 a = m_aBins.value(bin0, bin1);
129 z = m_zBins.value(bin0, bin1);
130 rho = m_rhoBins.value(bin0, bin1);
131 }
132
133 // check for 0 material
134 if (x0 == 0.) {
135 return nullptr;
136 }
137
138 // record the material composition
139 Trk::MaterialComposition* mComposition =
140 new Trk::MaterialComposition(m_composition[bin1][bin0]);
141 p.set (std::make_unique<Trk::MaterialProperties>
142 (Trk::Material(x0, l0, a, z, rho, 0., mComposition), thickness));
143 }
144 return p.get();
145}
static Double_t a
std::vector< std::vector< MaterialPropertiesCUP > > m_materialProperties
the ones you return
CxxUtils::CachedUniquePtr< MaterialProperties > MaterialPropertiesCUP
@ z
global position (cartesian)
Definition ParamDefs.h:57

◆ operator*=()

Trk::CompoundLayerMaterial & Trk::CompoundLayerMaterial::operator*= ( double scale)
finaloverridevirtual

Scale operator.

<

Todo
implement

Implements Trk::LayerMaterialProperties.

Definition at line 81 of file CompoundLayerMaterial.cxx.

81 {
83 // scale the reference material
84 return (*this);
85}

◆ operator=()

Trk::CompoundLayerMaterial & Trk::CompoundLayerMaterial::operator= ( const CompoundLayerMaterial & lmp)

Assignment operator.

Definition at line 51 of file CompoundLayerMaterial.cxx.

52 {
53 if (this != &clm) {
54 delete m_binUtility;
56
57 m_binUtility = clm.m_binUtility->clone();
58 m_thicknessBins = clm.m_thicknessBins;
59 m_x0Bins = clm.m_x0Bins;
60 m_l0Bins = clm.m_l0Bins;
61 m_aBins = clm.m_aBins;
62 m_zBins = clm.m_zBins;
63 m_rhoBins = clm.m_rhoBins;
64 m_composition = clm.m_composition;
65 m_fullComposition = clm.m_fullComposition;
66 m_elementTable = clm.m_elementTable;
67
69 }
70 return (*this);
71}

◆ oppositePostFactor()

double Trk::LayerMaterialProperties::oppositePostFactor ( ) const
inlineinherited

Return method for post update material description of the Layer along normalvector.

Definition at line 150 of file LayerMaterialProperties.h.

150 {
151 return (1. - m_splitFactor);
152}

◆ oppositePreFactor()

double Trk::LayerMaterialProperties::oppositePreFactor ( ) const
inlineinherited

Return method for pre update material description of the Layer along normalvector.

Definition at line 146 of file LayerMaterialProperties.h.

146 {
147 return m_splitFactor;
148}

◆ resizeMaterialProperties()

void Trk::CompoundLayerMaterial::resizeMaterialProperties ( )
private

Definition at line 162 of file CompoundLayerMaterial.cxx.

163{
164 m_materialProperties.clear();
165 m_materialProperties.resize (m_thicknessBins.valueBinMatrix.size());
166 for (size_t i = 0; i < m_materialProperties.size(); i++) {
167 m_materialProperties[i].resize (m_thicknessBins.valueBinMatrix[i].size());
168 }
169}

◆ updateBinning()

void Trk::CompoundLayerMaterial::updateBinning ( BinUtility * bu)
inlinefinaloverridevirtual

Update the BinUtility if necessary - passing ownership of the utility class.

Implements Trk::LayerMaterialProperties.

Definition at line 148 of file CompoundLayerMaterial.h.

148 {
149 if (bu) {
150 delete m_binUtility;
151 m_binUtility = bu;
152 }
153}

◆ updateElementTable() [1/2]

void Trk::CompoundLayerMaterial::updateElementTable ( const std::shared_ptr< const ElementTable > & set)
inline

Update the ElementTable.

Definition at line 143 of file CompoundLayerMaterial.h.

144 {
146}
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition bitmask.h:232

◆ updateElementTable() [2/2]

void Trk::LayerMaterialProperties::updateElementTable ( const std::shared_ptr< const ElementTable > & ) const
inlineinherited

Update the ElementTable.

Definition at line 87 of file LayerMaterialProperties.h.

87{}

◆ ::CompoundLayerMaterialCnv_p1

friend class ::CompoundLayerMaterialCnv_p1
friend

Definition at line 117 of file CompoundLayerMaterial.h.

Member Data Documentation

◆ m_aBins

ValueStore Trk::CompoundLayerMaterial::m_aBins {}
private

A parameters (averaged)

Definition at line 129 of file CompoundLayerMaterial.h.

129{};

◆ m_binUtility

BinUtility* Trk::CompoundLayerMaterial::m_binUtility {nullptr}
private

the helper for the bin finding

Definition at line 125 of file CompoundLayerMaterial.h.

125{nullptr};

◆ m_composition

std::vector<std::vector<MaterialComposition> > Trk::CompoundLayerMaterial::m_composition
private

composition matrix

Definition at line 133 of file CompoundLayerMaterial.h.

◆ m_elementTable

std::shared_ptr<const ElementTable> Trk::CompoundLayerMaterial::m_elementTable
private

Definition at line 136 of file CompoundLayerMaterial.h.

◆ m_fullComposition

bool Trk::CompoundLayerMaterial::m_fullComposition {false}
private

full composition calculation

Definition at line 134 of file CompoundLayerMaterial.h.

134{false};

◆ m_l0Bins

ValueStore Trk::CompoundLayerMaterial::m_l0Bins {}
private

l0 parameter

Definition at line 128 of file CompoundLayerMaterial.h.

128{};

◆ m_materialProperties

std::vector<std::vector<MaterialPropertiesCUP> > Trk::CompoundLayerMaterial::m_materialProperties
private

the ones you return

Definition at line 123 of file CompoundLayerMaterial.h.

◆ m_rhoBins

ValueStore Trk::CompoundLayerMaterial::m_rhoBins {}
private

rho parameter (averaged)

Definition at line 131 of file CompoundLayerMaterial.h.

131{};

◆ m_splitFactor

double Trk::LayerMaterialProperties::m_splitFactor
protectedinherited

the split factor in favour of oppositePre

Definition at line 126 of file LayerMaterialProperties.h.

◆ m_thicknessBins

ValueStore Trk::CompoundLayerMaterial::m_thicknessBins {}
private

thickness parameter

Definition at line 126 of file CompoundLayerMaterial.h.

126{};

◆ m_x0Bins

ValueStore Trk::CompoundLayerMaterial::m_x0Bins {}
private

x0 parameter

Definition at line 127 of file CompoundLayerMaterial.h.

127{};

◆ m_zBins

ValueStore Trk::CompoundLayerMaterial::m_zBins {}
private

Z parameter (averaged)

Definition at line 130 of file CompoundLayerMaterial.h.

130{};

The documentation for this class was generated from the following files: