ATLAS Offline Software
Loading...
Searching...
No Matches
CompoundLayerMaterial.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// CompoundLayerMaterial.h, (c) ATLAS Detector software
8
9#ifndef TRKGEOMETRY_COMPOUNDLAYERMATERIAL_H
10#define TRKGEOMETRY_COMPOUNDLAYERMATERIAL_H
11
12// Trk
14#include <memory>
20// Amg
22// Gaudi
23#include "GaudiKernel/MsgStream.h"
24
26
27namespace Trk {
28
29typedef std::vector<unsigned char> ValueVector;
30typedef std::vector<ValueVector> ValueMatrix;
31
32struct ValueStore {
33 float valueMin;
34 float valueStep;
36
37 double value(unsigned char ibin0, unsigned char ibin1) const {
38 // allows for single entry
39 if (valueBinMatrix.empty()) return valueMin;
40 // get the entry from the matrix
41 unsigned int ibin = static_cast<unsigned int>(
42 valueBinMatrix[static_cast<unsigned int>(ibin1)]
43 [static_cast<unsigned int>(ibin0)]);
44 if (!ibin) return 0.;
45 double value = valueMin + (double(ibin) - 0.5) * valueStep;
46 return value;
47 }
48};
49
59
61 public:
64
67 const Trk::BinUtility& binutility, const ValueStore& thicknessBins,
68 const ValueStore& x0Bins, const ValueStore& l0Bins,
69 const ValueStore& aBins, const ValueStore& zBins,
70 const ValueStore& rhoBins,
71 const std::vector<std::vector<MaterialComposition> >& composition,
72 bool fComposition = false);
73
76
78 virtual ~CompoundLayerMaterial() override;
79
81 virtual CompoundLayerMaterial* clone() const override final;
82
85
87 virtual CompoundLayerMaterial& operator*=(double scale) override final;
88
90 virtual const BinUtility* binUtility() const override final;
91
94 virtual void updateBinning(BinUtility* bu) override final;
95
98 const Amg::Vector3D& gp) const override final;
99
101 virtual const MaterialProperties* material(size_t bin0,
102 size_t bin1) const override final;
103
105 void updateElementTable(const std::shared_ptr<const ElementTable>& set);
106
109
111 virtual MsgStream& dump(MsgStream& sl) const override final;
112
114 virtual std::ostream& dump(std::ostream& sl) const override final;
115
116 private:
118
120
124
132 std::vector<std::vector<MaterialComposition> >
134 bool m_fullComposition{false};
135 std::shared_ptr<const ElementTable>
136 m_elementTable; // the ElementTable (filled/synchronised)
137};
138
140 return m_binUtility;
141}
142
144 const std::shared_ptr<const ElementTable>& set) {
146}
147
149 if (bu) {
150 delete m_binUtility;
151 m_binUtility = bu;
152 }
153}
154
156 return m_elementTable.get();
157}
158
159} // namespace Trk
160
161#endif
Cached unique_ptr with atomic update.
Eigen::Matrix< double, 3, 1 > Vector3D
A generic symmetric BinUtility, for fully symmetric binning in terms of binning grid and binning type...
Definition BinUtility.h:39
CompoundLayerMaterial()=default
Default Constructor - needed by POOL.
ValueStore m_rhoBins
rho parameter (averaged)
std::vector< std::vector< MaterialPropertiesCUP > > m_materialProperties
the ones you return
virtual ~CompoundLayerMaterial() override
Destructor.
bool m_fullComposition
full composition calculation
virtual const MaterialProperties * fullMaterial(const Amg::Vector3D &gp) const override final
Return method for full material description of the Layer.
const ElementTable * elementTable() const
Get the ElementTable.
std::shared_ptr< const ElementTable > m_elementTable
ValueStore m_thicknessBins
thickness parameter
virtual const BinUtility * binUtility() const override final
Return the BinUtility.
ValueStore m_x0Bins
x0 parameter
CxxUtils::CachedUniquePtr< MaterialProperties > MaterialPropertiesCUP
ValueStore m_aBins
A parameters (averaged)
virtual void updateBinning(BinUtility *bu) override final
Update the BinUtility if necessary - passing ownership of the utility class.
ValueStore m_zBins
Z parameter (averaged)
virtual const MaterialProperties * material(size_t bin0, size_t bin1) const override final
Access the single bin.
std::vector< std::vector< MaterialComposition > > m_composition
composition matrix
virtual CompoundLayerMaterial * clone() const override final
Pseudo-Constructor clone()
BinUtility * m_binUtility
the helper for the bin finding
void updateElementTable(const std::shared_ptr< const ElementTable > &set)
Update the ElementTable.
ValueStore m_l0Bins
l0 parameter
Material with information about thickness of material.
STL class.
STL class.
Definition of ATLAS Math & Geometry primitives (Amg)
Ensure that the ATLAS eigen extensions are properly loaded.
std::vector< ValueVector > ValueMatrix
std::vector< unsigned char > ValueVector
-event-from-file
STL namespace.
double value(unsigned char ibin0, unsigned char ibin1) const
#define private