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 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
 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
 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 Constructor - needed by POOL.

Definition at line 13 of file CompoundLayerMaterial.cxx.

◆ 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 20 of file CompoundLayerMaterial.cxx.

26  : m_binUtility(binutility.clone()),
27  m_thicknessBins(thicknessBins),
28  m_x0Bins(x0Bins),
29  m_l0Bins(l0Bins),
30  m_aBins(aBins),
31  m_zBins(zBins),
32  m_rhoBins(rhoBins),
33  m_composition(composition),
34  m_fullComposition(fComposition),
36 {
38 }

◆ CompoundLayerMaterial() [3/3]

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

Copy Constructor.

Definition at line 40 of file CompoundLayerMaterial.cxx.

43  m_binUtility(clm.m_binUtility->clone()),
44  m_thicknessBins(clm.m_thicknessBins),
45  m_x0Bins(clm.m_x0Bins),
46  m_l0Bins(clm.m_l0Bins),
47  m_aBins(clm.m_aBins),
48  m_zBins(clm.m_zBins),
49  m_rhoBins(clm.m_rhoBins),
50  m_composition(clm.m_composition),
51  m_fullComposition(clm.m_fullComposition),
52  m_elementTable(clm.m_elementTable)
53 {
55 }

◆ ~CompoundLayerMaterial()

Trk::CompoundLayerMaterial::~CompoundLayerMaterial ( )
overridevirtual

Destructor.

Definition at line 79 of file CompoundLayerMaterial.cxx.

79  {
80  delete m_binUtility;
81 }

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 83 of file CompoundLayerMaterial.cxx.

83  {
84  return new Trk::CompoundLayerMaterial(*this);
85 }

◆ 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 153 of file CompoundLayerMaterial.cxx.

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

◆ 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 160 of file CompoundLayerMaterial.cxx.

160  {
161  sl << "Trk::CompoundLayerMaterial : " << std::endl;
162  sl << " - Number of Material bins (1/2) : " << m_binUtility->max(0) + 1
163  << " / " << m_binUtility->max(1) + 1 << std::endl;
164  return sl;
165 }

◆ 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 93 of file CompoundLayerMaterial.cxx.

94  {
95  // first bin
96  size_t bin0 = m_binUtility->bin(gp, 0);
97  // second bin
98  size_t bin1 = (m_binUtility->max(1) == 0) ? 0 : m_binUtility->bin(gp, 1);
99  return material(bin0, bin1);
100 }

◆ 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 102 of file CompoundLayerMaterial.cxx.

104 {
106  if (!p) {
107  // get the size
108  const double thickness = m_thicknessBins.value(bin0, bin1);
109  // no thickness or no x0 - return a null pointer
110  if (thickness == 0.) return nullptr;
111  double x0 = 0.;
112  double l0 = 0.;
113  double a = 0.;
114  double z = 0.;
115  double rho = 0.;
116  // the full composition calculation
117  if (m_fullComposition && m_elementTable.get()) {
119  for (const auto& eFraction : m_composition[bin1][bin0]) {
120  double fraction = eFraction.fraction();
121  const Trk::Material* material =
122  m_elementTable->element(eFraction.element());
123  if (material) {
124  x0 += material->X0 * fraction;
125  l0 += material->L0 * fraction;
126  a += material->A * fraction;
127  z += material->Z * fraction;
128  rho += material->rho * fraction;
129  }
130  }
131  } else {
132  x0 = m_x0Bins.value(bin0, bin1);
133  l0 = m_l0Bins.value(bin0, bin1);
134  a = m_aBins.value(bin0, bin1);
135  z = m_zBins.value(bin0, bin1);
136  rho = m_rhoBins.value(bin0, bin1);
137  }
138 
139  // check for 0 material
140  if (x0 == 0.) {
141  return nullptr;
142  }
143 
144  // record the material composition
145  Trk::MaterialComposition* mComposition =
147  p.set (std::make_unique<Trk::MaterialProperties>
148  (Trk::Material(x0, l0, a, z, rho, 0., mComposition), thickness));
149  }
150  return p.get();
151 }

◆ operator*=()

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

Scale operator.

<

Todo:
implement

Implements Trk::LayerMaterialProperties.

Definition at line 87 of file CompoundLayerMaterial.cxx.

87  {
89  // scale the reference material
90  return (*this);
91 }

◆ operator=()

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

Assignment operator.

Definition at line 57 of file CompoundLayerMaterial.cxx.

58  {
59  if (this != &clm) {
60  delete m_binUtility;
61  m_materialProperties.clear();
62 
63  m_binUtility = clm.m_binUtility->clone();
64  m_thicknessBins = clm.m_thicknessBins;
65  m_x0Bins = clm.m_x0Bins;
66  m_l0Bins = clm.m_l0Bins;
67  m_aBins = clm.m_aBins;
68  m_zBins = clm.m_zBins;
69  m_rhoBins = clm.m_rhoBins;
70  m_composition = clm.m_composition;
71  m_fullComposition = clm.m_fullComposition;
72  m_elementTable = clm.m_elementTable;
73 
75  }
76  return (*this);
77 }

◆ 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 168 of file CompoundLayerMaterial.cxx.

169 {
170  m_materialProperties.clear();
172  for (size_t i = 0; i < m_materialProperties.size(); i++) {
174  }
175 }

◆ 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
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
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:168
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:63
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
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:92
Trk::CompoundLayerMaterial::m_fullComposition
bool m_fullComposition
full composition calculation
Definition: CompoundLayerMaterial.h:134
Trk::LayerMaterialProperties
Definition: LayerMaterialProperties.h:62
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:224
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:329
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:102
fitman.rho
rho
Definition: fitman.py:532