ATLAS Offline Software
Loading...
Searching...
No Matches
CompressedLayerMaterial.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6// CompressedLayerMaterial.h, (c) ATLAS Detector software
8
9#ifndef TRKGEOMETRY_COMPRESSEDLAYERMATERIAL_H
10#define TRKGEOMETRY_COMPRESSEDLAYERMATERIAL_H
11
12// Trk
16// Amg
18// Gaudi
19#include "GaudiKernel/MsgStream.h"
20
21namespace Trk {
22
30
32 public:
35
38
50 const Trk::BinUtility& binutility,
51 const MaterialPropertiesVector& fullProperties,
52 const std::vector<unsigned short int>& materialIndices,
53 double splitFactor = 0.);
54
56 std::unique_ptr<Trk::BinUtility> binutility,
57 const MaterialPropertiesVector&& fullProperties,
58 const std::vector<unsigned short int>& materialIndices,
59 double splitFactor = 0.);
60
63
65 virtual ~CompressedLayerMaterial() override;
66
68 virtual CompressedLayerMaterial* clone() const override final;
69
72
74 virtual CompressedLayerMaterial& operator*=(double scale) override final;
75
77 virtual const BinUtility* binUtility() const override final;
78
81 virtual void updateBinning(BinUtility* bu) override final;
82
85
87 const std::vector<unsigned short int>& materialBins() const;
88
90 virtual const MaterialProperties* fullMaterial(
91 const Amg::Vector3D& gp) const override;
92
94 virtual const MaterialProperties* material(size_t bin0,
95 size_t bin1) const override final;
96
98 virtual MsgStream& dump(MsgStream& sl) const override final;
100 virtual std::ostream& dump(std::ostream& sl) const override final;
101
102 private:
104
107 std::vector<unsigned short int> m_materialBins;
108
110 void clearMaterial();
111
113 void fillMaterial(const MaterialPropertiesVector& matVector);
114};
115
117 return m_binUtility;
118}
119
124
125inline const std::vector<unsigned short int>&
129
131 size_t bin0, size_t bin1) const {
132 int accessBin = bin1 * (m_binUtility->max(0) + 1) + bin0;
133 // safety check
134 if (bin0 <= (unsigned int)m_binUtility->max(0) &&
135 bin1 <= (unsigned int)m_binUtility->max(1) && !m_fullMaterial.empty() &&
136 accessBin < int(m_materialBins.size()))
137 return m_fullMaterial[m_materialBins[accessBin]];
138 return nullptr;
139}
140
142 if (bu) {
143 delete m_binUtility;
144 m_binUtility = bu;
145 }
146}
147
148} // namespace Trk
149
150#endif
A generic symmetric BinUtility, for fully symmetric binning in terms of binning grid and binning type...
Definition BinUtility.h:39
const std::vector< unsigned short int > & materialBins() const
Return method for index vector, needs BinUtility to interpret this.
const MaterialPropertiesVector & fullMaterial() const
Return method for full material description of the Layer - for all bins.
virtual const MaterialProperties * material(size_t bin0, size_t bin1) const override final
Access the single bin.
virtual void updateBinning(BinUtility *bu) override final
Update the BinUtility if necessary - passing ownership of the utility class.
virtual ~CompressedLayerMaterial() override
Destructor.
CompressedLayerMaterial & operator=(const CompressedLayerMaterial &lmp)
Assignment operator.
BinUtility * m_binUtility
the helper for the bin finding
void fillMaterial(const MaterialPropertiesVector &matVector)
helper method - to refill the material
std::vector< unsigned short int > m_materialBins
virtual const BinUtility * binUtility() const override final
Return the BinUtility.
MaterialPropertiesVector m_fullMaterial
The five different MaterialProperties.
virtual CompressedLayerMaterial & operator*=(double scale) override final
Scale operator.
CompressedLayerMaterial()
Default Constructor - needed by POOL.
void clearMaterial()
helper method - to clear the material
virtual CompressedLayerMaterial * clone() const override final
Pseudo-Constructor clone()
Material with information about thickness of material.
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
std::vector< const MaterialProperties * > MaterialPropertiesVector
Useful typedefs.
-event-from-file