ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Trk::BinnedLayerMaterial Class Reference

#include <BinnedLayerMaterial.h>

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

Public Member Functions

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

Protected Attributes

double m_splitFactor
 the split factor in favour of oppositePre More...
 

Private Member Functions

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

Private Attributes

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

Friends

class ::BinnedLayerMaterialCnv_p1
 

Detailed Description

It extends the LayerMaterialProperties base class

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

Definition at line 33 of file BinnedLayerMaterial.h.

Constructor & Destructor Documentation

◆ BinnedLayerMaterial() [1/5]

Trk::BinnedLayerMaterial::BinnedLayerMaterial ( )

Default Constructor - needed by POOL.

Definition at line 13 of file BinnedLayerMaterial.cxx.

◆ BinnedLayerMaterial() [2/5]

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

Default Constructor for emptly material.

Definition at line 16 of file BinnedLayerMaterial.cxx.

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 }

◆ 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
38  clearMaterial();
39  // fill the material with deep copy
40  m_fullMaterial.push_back(fullProperties);
41 }

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

58  m_binUtility(lmp.m_binUtility->clone()) {
59  // clear the material
60  clearMaterial();
61  // and fill the material
62  fillMaterial(lmp.m_fullMaterial);
63 }

◆ ~BinnedLayerMaterial()

Trk::BinnedLayerMaterial::~BinnedLayerMaterial ( )
overridevirtual

Destructor.

Definition at line 50 of file BinnedLayerMaterial.cxx.

50  {
51  delete m_binUtility;
52  clearMaterial();
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 }

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

◆ 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();
73  clearMaterial();
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 SharedObject< const ElementTable > &  ) const
inlineinherited

Update the ElementTable.

Definition at line 87 of file LayerMaterialProperties.h.

87 {}

Friends And Related Function Documentation

◆ ::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:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Trk::BinUtility::max
size_t max(size_t ba=0) const
First bin maximal value.
Definition: BinUtility.h:215
Trk::BinnedLayerMaterial::fillMaterial
void fillMaterial(const MaterialPropertiesMatrix &matMatrix)
helper method - to refill the material
Definition: BinnedLayerMaterial.cxx:93
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
Trk::MaterialPropertiesVector
std::vector< const MaterialProperties * > MaterialPropertiesVector
Useful typedefs.
Definition: MaterialProperties.h:133
Trk::fullUpdate
@ fullUpdate
Definition: PropDirection.h:43
Trk::LayerMaterialProperties::m_splitFactor
double m_splitFactor
the split factor in favour of oppositePre
Definition: LayerMaterialProperties.h:126
Trk::BinnedLayerMaterial::m_binUtility
BinUtility * m_binUtility
the helper for the bin finding
Definition: BinnedLayerMaterial.h:107
Trk::LayerMaterialProperties
Definition: LayerMaterialProperties.h:62
Trk::MaterialProperties::clone
MaterialProperties * clone() const
Pseudo-Constructor clone()
Definition: MaterialProperties.cxx:33
Trk::BinnedLayerMaterial
Definition: BinnedLayerMaterial.h:33
Trk::BinnedLayerMaterial::m_fullMaterial
MaterialPropertiesMatrix m_fullMaterial
The five different MaterialProperties.
Definition: BinnedLayerMaterial.h:110
Trk::BinnedLayerMaterial::clearMaterial
void clearMaterial()
helper method - to clear the material
Definition: BinnedLayerMaterial.cxx:84
Trk::MaterialProperties
Definition: MaterialProperties.h:40
dqt_zlumi_pandas.bin1
bin1
Definition: dqt_zlumi_pandas.py:336
Trk::BinUtility::clone
BinUtility * clone() const
Implizit Constructor.
Definition: BinUtility.h:130
Trk::BinUtility::bin
size_t bin(const Amg::Vector3D &position, size_t ba=0) const
Bin from a 3D vector (already in binning frame)
Definition: BinUtility.h:136