ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
Trk::CompoundLayerMaterial Class Referencefinal

#include <CompoundLayerMaterial.h>

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

Public Member Functions

 CompoundLayerMaterial ()=default
 Default Constructor - needed by POOL. More...
 
 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. More...
 
 CompoundLayerMaterial (const CompoundLayerMaterial &mprop)
 Copy Constructor. More...
 
virtual ~CompoundLayerMaterial () override
 Destructor. More...
 
virtual CompoundLayerMaterialclone () const override final
 Pseudo-Constructor clone() More...
 
CompoundLayerMaterialoperator= (const CompoundLayerMaterial &lmp)
 Assignment operator. More...
 
virtual CompoundLayerMaterialoperator*= (double scale) override final
 Scale operator. More...
 
virtual const BinUtilitybinUtility () const override final
 Return the BinUtility. More...
 
virtual void updateBinning (BinUtility *bu) override final
 Update the BinUtility if necessary - passing ownership of the utility class. More...
 
virtual const MaterialPropertiesfullMaterial (const Amg::Vector3D &gp) const override final
 Return method for full material description of the Layer. More...
 
virtual const MaterialPropertiesmaterial (size_t bin0, size_t bin1) const override final
 Access the single bin. More...
 
void updateElementTable (const SharedObject< const ElementTable > &set)
 Update the ElementTable. More...
 
const ElementTableelementTable () const
 Get the ElementTable. More...
 
virtual MsgStream & dump (MsgStream &sl) const override final
 Output Method for MsgStream, to be overloaded by child classes. More...
 
virtual std::ostream & dump (std::ostream &sl) const override final
 Output Method for std::ostream, to be overloaded by child classes. More...
 
void updateElementTable (const SharedObject< const ElementTable > &) const
 Update 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 Types

using MaterialPropertiesCUP = CxxUtils::CachedUniquePtr< MaterialProperties >
 

Private Member Functions

void resizeMaterialProperties ()
 

Private Attributes

std::vector< std::vector< MaterialPropertiesCUP > > m_materialProperties
 the ones you return More...
 
BinUtilitym_binUtility {nullptr}
 the helper for the bin finding More...
 
ValueStore m_thicknessBins {}
 thickness parameter More...
 
ValueStore m_x0Bins {}
 x0 parameter More...
 
ValueStore m_l0Bins {}
 l0 parameter More...
 
ValueStore m_aBins {}
 A parameters (averaged) More...
 
ValueStore m_zBins {}
 Z parameter (averaged) More...
 
ValueStore m_rhoBins {}
 rho parameter (averaged) More...
 
std::vector< std::vector< MaterialComposition > > m_composition
 composition matrix More...
 
bool m_fullComposition {false}
 full composition calculation More...
 
SharedObject< 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

Definition at line 121 of file CompoundLayerMaterial.h.

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),
30 {
32 }

◆ CompoundLayerMaterial() [3/3]

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

Copy Constructor.

Definition at line 34 of file CompoundLayerMaterial.cxx.

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 }

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

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

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

◆ 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;
55  m_materialProperties.clear();
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();
166  for (size_t i = 0; i < m_materialProperties.size(); i++) {
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::LayerMaterialProperties::updateElementTable ( const SharedObject< const ElementTable > &  ) const
inlineinherited

Update the ElementTable.

Definition at line 87 of file LayerMaterialProperties.h.

87 {}

◆ updateElementTable() [2/2]

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

Update the ElementTable.

Definition at line 143 of file CompoundLayerMaterial.h.

144  {
146 }

Friends And Related Function Documentation

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

◆ m_binUtility

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

the helper for the bin finding

Definition at line 125 of file CompoundLayerMaterial.h.

◆ m_composition

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

composition matrix

Definition at line 133 of file CompoundLayerMaterial.h.

◆ m_elementTable

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

◆ m_l0Bins

ValueStore Trk::CompoundLayerMaterial::m_l0Bins {}
private

l0 parameter

Definition at line 128 of file CompoundLayerMaterial.h.

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

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

◆ m_x0Bins

ValueStore Trk::CompoundLayerMaterial::m_x0Bins {}
private

x0 parameter

Definition at line 127 of file CompoundLayerMaterial.h.

◆ m_zBins

ValueStore Trk::CompoundLayerMaterial::m_zBins {}
private

Z parameter (averaged)

Definition at line 130 of file CompoundLayerMaterial.h.


The documentation for this class was generated from the following files:
Trk::CompoundLayerMaterial::m_aBins
ValueStore m_aBins
A parameters (averaged)
Definition: CompoundLayerMaterial.h:129
Trk::CompoundLayerMaterial::m_x0Bins
ValueStore m_x0Bins
x0 parameter
Definition: CompoundLayerMaterial.h:127
Trk::CompoundLayerMaterial::resizeMaterialProperties
void resizeMaterialProperties()
Definition: CompoundLayerMaterial.cxx:162
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:57
Trk::BinUtility::max
size_t max(size_t ba=0) const
First bin maximal value.
Definition: BinUtility.h:215
Trk::CompoundLayerMaterial
Definition: CompoundLayerMaterial.h:60
Trk::CompoundLayerMaterial::m_l0Bins
ValueStore m_l0Bins
l0 parameter
Definition: CompoundLayerMaterial.h:128
Trk::ValueStore::value
double value(unsigned char ibin0, unsigned char ibin1) const
Definition: CompoundLayerMaterial.h:37
Trk::CompoundLayerMaterial::m_materialProperties
std::vector< std::vector< MaterialPropertiesCUP > > m_materialProperties
the ones you return
Definition: CompoundLayerMaterial.h:123
Trk::MaterialComposition
Definition: Material.h:60
Trk::fullUpdate
@ fullUpdate
Definition: PropDirection.h:43
Trk::ValueStore::valueBinMatrix
ValueMatrix valueBinMatrix
Definition: CompoundLayerMaterial.h:35
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Trk::LayerMaterialProperties::m_splitFactor
double m_splitFactor
the split factor in favour of oppositePre
Definition: LayerMaterialProperties.h:126
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::CompoundLayerMaterial::m_fullComposition
bool m_fullComposition
full composition calculation
Definition: CompoundLayerMaterial.h:134
Trk::LayerMaterialProperties
Definition: LayerMaterialProperties.h:62
MuonR4::SegmentFit::ParamDefs::x0
@ x0
Trk::CompoundLayerMaterial::m_elementTable
SharedObject< const ElementTable > m_elementTable
Definition: CompoundLayerMaterial.h:136
MakeTH3DFromTH2Ds.zBins
list zBins
Definition: MakeTH3DFromTH2Ds.py:86
Trk::CompoundLayerMaterial::MaterialPropertiesCUP
CxxUtils::CachedUniquePtr< MaterialProperties > MaterialPropertiesCUP
Definition: CompoundLayerMaterial.h:121
CxxUtils::set
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
Trk::CompoundLayerMaterial::m_binUtility
BinUtility * m_binUtility
the helper for the bin finding
Definition: CompoundLayerMaterial.h:125
Trk::CompoundLayerMaterial::m_composition
std::vector< std::vector< MaterialComposition > > m_composition
composition matrix
Definition: CompoundLayerMaterial.h:133
Trk::CompoundLayerMaterial::m_thicknessBins
ValueStore m_thicknessBins
thickness parameter
Definition: CompoundLayerMaterial.h:126
Trk::CompoundLayerMaterial::m_rhoBins
ValueStore m_rhoBins
rho parameter (averaged)
Definition: CompoundLayerMaterial.h:131
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
dqt_zlumi_pandas.bin1
bin1
Definition: dqt_zlumi_pandas.py:336
Trk::BinUtility::clone
BinUtility * clone() const
Implizit Constructor.
Definition: BinUtility.h:130
Trk::CompoundLayerMaterial::m_zBins
ValueStore m_zBins
Z parameter (averaged)
Definition: CompoundLayerMaterial.h:130
ReadCellNoiseFromCoolCompare.l0
l0
Definition: ReadCellNoiseFromCoolCompare.py:359
Trk::Material
Definition: Material.h:116
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
Trk::CompoundLayerMaterial::material
virtual const MaterialProperties * material(size_t bin0, size_t bin1) const override final
Access the single bin.
Definition: CompoundLayerMaterial.cxx:96
fitman.rho
rho
Definition: fitman.py:532