ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::BinnedLayerMaterial Class Reference

It extends the LayerMaterialProperties base class. More...

#include <BinnedLayerMaterial.h>

Inheritance diagram for Trk::BinnedLayerMaterial:
Collaboration diagram for Trk::BinnedLayerMaterial:

Public Member Functions

 BinnedLayerMaterial ()
 Default Constructor - needed by POOL.
 BinnedLayerMaterial (BinUtility &binutility)
 Default Constructor for emptly material.
 BinnedLayerMaterial (const Trk::BinUtility &binutility, const MaterialPropertiesVector &fullProperties, double splitFactor=0.)
 Explizit constructor with only full MaterialProperties, and split factors:
 BinnedLayerMaterial (const Trk::BinUtility &binutility, const MaterialPropertiesMatrix &fullProperties, double splitFactor=0.)
 Explizit constructor with only full MaterialProperties, and split factors:
 BinnedLayerMaterial (const BinnedLayerMaterial &mprop)
 Copy Constructor.
virtual ~BinnedLayerMaterial () override
 Destructor.
virtual BinnedLayerMaterialclone () const override
 Pseudo-Constructor clone()
BinnedLayerMaterialoperator= (const BinnedLayerMaterial &lmp)
 Assignment operator.
virtual BinnedLayerMaterialoperator*= (double scale) override
 Scale operator.
virtual const BinUtilitybinUtility () const override
 Return the BinUtility.
virtual void updateBinning (BinUtility *bu) override
 Update the BinUtility if necessary - passing ownership of the utility class.
const MaterialPropertiesMatrixfullMaterial () const
 Return method for full material description of the Layer - for all bins.
virtual const MaterialPropertiesfullMaterial (const Amg::Vector3D &gp) const override
 Return method for full material description of the Layer.
virtual const MaterialPropertiesmaterial (size_t bin0, size_t bin1) const override
 Access the single bin.
virtual MsgStream & dump (MsgStream &sl) const override
 Output Method for MsgStream, to be overloaded by child classes.
virtual std::ostream & dump (std::ostream &sl) const override
 Output Method for std::ostream, to be overloaded by child classes.
void updateElementTable (const std::shared_ptr< const ElementTable > &) const
 Update the ElementTable.
const ElementTableelementTable () const
 Get 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 Member Functions

void clearMaterial ()
 helper method - to clear the material
void fillMaterial (const MaterialPropertiesMatrix &matMatrix)
 helper method - to refill the material

Private Attributes

BinUtilitym_binUtility
 the helper for the bin finding
MaterialPropertiesMatrix m_fullMaterial
 The five different MaterialProperties.

Friends

class ::BinnedLayerMaterialCnv_p1

Detailed Description

Constructor & Destructor Documentation

◆ BinnedLayerMaterial() [1/5]

Trk::BinnedLayerMaterial::BinnedLayerMaterial ( )

Default Constructor - needed by POOL.

Definition at line 13 of file BinnedLayerMaterial.cxx.

14 : Trk::LayerMaterialProperties(), m_binUtility(nullptr) {}
BinUtility * m_binUtility
the helper for the bin finding

◆ BinnedLayerMaterial() [2/5]

Trk::BinnedLayerMaterial::BinnedLayerMaterial ( Trk::BinUtility & binutility)

Default Constructor for emptly material.

Definition at line 16 of file BinnedLayerMaterial.cxx.

17 : Trk::LayerMaterialProperties(), m_binUtility(binutility.clone()) {
18 // reserve
19 m_fullMaterial.reserve(binutility.max(1) + 1);
20 for (unsigned int ibin2 = 0; ibin2 < (unsigned int)binutility.max(1) + 1;
21 ++ibin2) {
22 // create the vector for the push_back
24 matVec.reserve(binutility.max(0) + 1);
25 for (unsigned int ibin = 0; ibin < (unsigned int)binutility.max(0) + 1;
26 ++ibin)
27 matVec.push_back(nullptr);
28 m_fullMaterial.push_back(matVec);
29 }
30}
size_t max(size_t ba=0) const
First bin maximal value.
Definition BinUtility.h:212
BinUtility * clone() const
Implizit Constructor.
Definition BinUtility.h:120
MaterialPropertiesMatrix m_fullMaterial
The five different MaterialProperties.
std::vector< const MaterialProperties * > MaterialPropertiesVector
Useful typedefs.

◆ BinnedLayerMaterial() [3/5]

Trk::BinnedLayerMaterial::BinnedLayerMaterial ( const Trk::BinUtility & binutility,
const MaterialPropertiesVector & fullProperties,
double splitFactor = 0. )

Explizit constructor with only full MaterialProperties, and split factors:

  • 1. : oppositePre
  • 0. : alongPre

===> 1 Dimensional array

ATTENTION: Ownership of MaterialProperties objects is given!

Definition at line 32 of file BinnedLayerMaterial.cxx.

35 : Trk::LayerMaterialProperties(splitFactor),
36 m_binUtility(binutility.clone()) {
37 // constructor from a single vector
39 // fill the material with deep copy
40 m_fullMaterial.push_back(fullProperties);
41}
void clearMaterial()
helper method - to clear the material

◆ BinnedLayerMaterial() [4/5]

Trk::BinnedLayerMaterial::BinnedLayerMaterial ( const Trk::BinUtility & binutility,
const MaterialPropertiesMatrix & fullProperties,
double splitFactor = 0. )

Explizit constructor with only full MaterialProperties, and split factors:

  • 1. : oppositePre
  • 0. : alongPre

===> 2 Dimensional array

ATTENTION: Ownership of MaterialProperties objects is given!

Definition at line 43 of file BinnedLayerMaterial.cxx.

46 : Trk::LayerMaterialProperties(splitFactor),
47 m_binUtility(binutility.clone()),
48 m_fullMaterial(fullProperties) {}

◆ BinnedLayerMaterial() [5/5]

Trk::BinnedLayerMaterial::BinnedLayerMaterial ( const BinnedLayerMaterial & mprop)

Copy Constructor.

Definition at line 55 of file BinnedLayerMaterial.cxx.

57 : Trk::LayerMaterialProperties(lmp),
58 m_binUtility(lmp.m_binUtility->clone()) {
59 // clear the material
61 // and fill the material
62 fillMaterial(lmp.m_fullMaterial);
63}
void fillMaterial(const MaterialPropertiesMatrix &matMatrix)
helper method - to refill the material

◆ ~BinnedLayerMaterial()

Trk::BinnedLayerMaterial::~BinnedLayerMaterial ( )
overridevirtual

Destructor.

Definition at line 50 of file BinnedLayerMaterial.cxx.

50 {
51 delete m_binUtility;
53}

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::BinnedLayerMaterial::binUtility ( ) const
inlineoverridevirtual

Return the BinUtility.

Implements Trk::LayerMaterialProperties.

Definition at line 121 of file BinnedLayerMaterial.h.

122 { return m_binUtility; }

◆ clearMaterial()

void Trk::BinnedLayerMaterial::clearMaterial ( )
private

helper method - to clear the material

Definition at line 84 of file BinnedLayerMaterial.cxx.

84 {
85 // clear the full material
86 for (auto& matMatrixIter : m_fullMaterial) {
87 for (auto& matIter : matMatrixIter) delete matIter;
88 }
89
90 m_fullMaterial.clear();
91}

◆ clone()

Trk::BinnedLayerMaterial * Trk::BinnedLayerMaterial::clone ( ) const
overridevirtual

Pseudo-Constructor clone()

Implements Trk::LayerMaterialProperties.

Definition at line 80 of file BinnedLayerMaterial.cxx.

80 {
81 return new Trk::BinnedLayerMaterial(*this);
82}

◆ dump() [1/2]

MsgStream & Trk::BinnedLayerMaterial::dump ( MsgStream & sl) const
overridevirtual

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

Implements Trk::LayerMaterialProperties.

Definition at line 136 of file BinnedLayerMaterial.cxx.

136 {
137 sl << "Trk::BinnedLayerMaterial : " << std::endl;
138 sl << " - Number of Material bins (1/2) : " << m_binUtility->max(0) + 1
139 << " / " << m_binUtility->max(1) + 1 << std::endl;
140 sl << " - Parse full update material : " << std::endl;
141 // output the full material
142 unsigned int imat2 = 0;
143 for (const auto& matMatrixIter : m_fullMaterial) {
144 unsigned int imat1 = 0;
145 // the vector iterator
146 for (const auto& matIter : matMatrixIter) {
147 if (matIter)
148 sl << " Bin [" << imat2 << "][" << imat1 << "] - " << (*matIter)
149 << std::endl;
150 else
151 sl << " Bin [" << imat2 << "][" << imat1 << "] - empty " << std::endl;
152 ++imat1;
153 }
154 ++imat2;
155 }
156 return sl;
157}

◆ dump() [2/2]

std::ostream & Trk::BinnedLayerMaterial::dump ( std::ostream & sl) const
overridevirtual

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

Implements Trk::LayerMaterialProperties.

Definition at line 159 of file BinnedLayerMaterial.cxx.

159 {
160 sl << "Trk::BinnedLayerMaterial : " << std::endl;
161 sl << " - Number of Material bins (1/2) : " << m_binUtility->max(0) + 1
162 << " / " << m_binUtility->max(1) + 1 << std::endl;
163 sl << " - Parse full update material : " << std::endl; //
164 // output the full material
165 unsigned int imat2 = 0;
166 for (const auto& matMatrixIter : m_fullMaterial) {
167 unsigned int imat1 = 0;
168 // the vector iterator
169 for (const auto& matIter : matMatrixIter) {
170 if (matIter)
171 sl << " Bin [" << imat2 << "][" << imat1 << "] - " << (*matIter)
172 << std::endl;
173 else
174 sl << " Bin [" << imat2 << "][" << imat1 << "] - empty " << std::endl;
175 ++imat1;
176 }
177 ++imat2;
178 }
179 return sl;
180}

◆ elementTable()

const ElementTable * Trk::LayerMaterialProperties::elementTable ( ) const
inlineinherited

Get the ElementTable.

Definition at line 90 of file LayerMaterialProperties.h.

90{ return nullptr; }

◆ 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

◆ fillMaterial()

void Trk::BinnedLayerMaterial::fillMaterial ( const MaterialPropertiesMatrix & matMatrix)
private

helper method - to refill the material

Definition at line 93 of file BinnedLayerMaterial.cxx.

94 {
95 m_fullMaterial.reserve(m_binUtility->max(1) + 1);
96 for (const auto& matMatrixIter : matMatrix) {
97 // the vector to be copied
99 matVector.reserve(m_binUtility->max(0) + 1);
100 // reassign
101 for (const auto& matIter : matMatrixIter)
102 matVector.push_back(matIter ? matIter->clone() : nullptr);
103 m_fullMaterial.push_back(matVector);
104 }
105}

◆ fullMaterial() [1/2]

const MaterialPropertiesMatrix & Trk::BinnedLayerMaterial::fullMaterial ( ) const
inline

Return method for full material description of the Layer - for all bins.

Definition at line 124 of file BinnedLayerMaterial.h.

125 { return m_fullMaterial; }

◆ fullMaterial() [2/2]

const Trk::MaterialProperties * Trk::BinnedLayerMaterial::fullMaterial ( const Amg::Vector3D & gp) const
overridevirtual

Return method for full material description of the Layer.

Implements Trk::LayerMaterialProperties.

Definition at line 127 of file BinnedLayerMaterial.cxx.

128 {
129 if (m_fullMaterial.empty() || !m_binUtility) return nullptr;
130 // the first bin
131 size_t ibin1 = m_binUtility->bin(gp, 0);
132 size_t ibin2 = m_binUtility->max(1) ? m_binUtility->bin(gp, 1) : 0;
133 return m_fullMaterial[ibin2][ibin1];
134}

◆ material()

const MaterialProperties * Trk::BinnedLayerMaterial::material ( size_t bin0,
size_t bin1 ) const
inlineoverridevirtual

Access the single bin.

Implements Trk::LayerMaterialProperties.

Definition at line 127 of file BinnedLayerMaterial.h.

128 {
129 return m_fullMaterial[bin1][bin0];
130 }

◆ operator*=()

Trk::BinnedLayerMaterial & Trk::BinnedLayerMaterial::operator*= ( double scale)
overridevirtual

Scale operator.

Implements Trk::LayerMaterialProperties.

Definition at line 107 of file BinnedLayerMaterial.cxx.

107 {
108 // scale the full material
109 unsigned int imat2 = 0;
110 for (auto& matMatrixIter : m_fullMaterial) {
111 unsigned int imat1 = 0;
112 // the vector iterator
113 for (auto& matIter : matMatrixIter) {
114 if (matIter) {
115 Trk::MaterialProperties* mprop = matIter->clone();
116 (*mprop) *= scale;
117 delete matIter;
118 m_fullMaterial[imat2][imat1] = mprop;
119 }
120 ++imat1;
121 }
122 ++imat2;
123 }
124 return (*this);
125}

◆ operator=()

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

Assignment operator.

Definition at line 65 of file BinnedLayerMaterial.cxx.

66 {
67 if (this != &lmp) {
68 Trk::LayerMaterialProperties::operator=(lmp);
69 // first delete everything
70 delete m_binUtility;
71 // reassign
72 m_binUtility = lmp.binUtility()->clone();
74 // reassign teh material
75 fillMaterial(lmp.m_fullMaterial);
76 }
77 return (*this);
78}

◆ 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}

◆ updateBinning()

void Trk::BinnedLayerMaterial::updateBinning ( BinUtility * bu)
inlineoverridevirtual

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

Implements Trk::LayerMaterialProperties.

Definition at line 132 of file BinnedLayerMaterial.h.

132 {
133 if (bu){
134 delete m_binUtility;
135 m_binUtility = bu;
136 }
137 }

◆ updateElementTable()

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

Update the ElementTable.

Definition at line 87 of file LayerMaterialProperties.h.

87{}

◆ ::BinnedLayerMaterialCnv_p1

friend class ::BinnedLayerMaterialCnv_p1
friend

Definition at line 105 of file BinnedLayerMaterial.h.

Member Data Documentation

◆ m_binUtility

BinUtility* Trk::BinnedLayerMaterial::m_binUtility
private

the helper for the bin finding

Definition at line 107 of file BinnedLayerMaterial.h.

◆ m_fullMaterial

MaterialPropertiesMatrix Trk::BinnedLayerMaterial::m_fullMaterial
private

The five different MaterialProperties.

Definition at line 110 of file BinnedLayerMaterial.h.

◆ m_splitFactor

double Trk::LayerMaterialProperties::m_splitFactor
protectedinherited

the split factor in favour of oppositePre

Definition at line 126 of file LayerMaterialProperties.h.


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