ATLAS Offline Software
BinnedMaterial.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 // Material.h, (c) ATLAS Detector software
8 
9 #ifndef TRKGEOMETRY_BINNEDMATERIAL_H
10 #define TRKGEOMETRY_BINNEDMATERIAL_H
11 
12 #include <climits>
13 #include <iomanip>
14 #include <iostream>
15 #include <memory>
16 #include <sstream>
17 #include <string>
18 #include <utility>
19 #include <vector>
20 
24 #include "TrkGeometry/Material.h"
25 
26 namespace Trk {
27 
28 typedef std::pair<const Material*, int> IdentifiedMaterial;
29 
30 class BinUtility;
31 
38 class BinnedMaterial final: public Material {
39  public:
41  BinnedMaterial() = default;
42 
45  float iX0, float iL0, float iA, float iZ, float iRho,
46  const CompactBinnedArray<const IdentifiedMaterial>* binMat = nullptr)
47  : Material(iX0, iL0, iA, iZ, iRho), m_matBins(binMat) {}
48 
51  const std::vector<size_t>& index,
52  const std::vector<IdentifiedMaterial>& detailedMat);
53 
56  std::vector<Trk::BinUtility*>& bVec,
57  const std::vector<std::vector<size_t> >& index,
58  const std::vector<IdentifiedMaterial>& detailedMat);
59 
61  BinnedMaterial(const BinnedMaterial& amc);
62 
64  virtual ~BinnedMaterial() = default;
65 
68 
70  const Trk::BinUtility* layerBinUtility(const Amg::Vector3D& position) const;
71 
73  size_t layerBin(const Amg::Vector3D& position) const;
74 
76  const IdentifiedMaterial* material(const Amg::Vector3D& position) const;
78  const Amg::Vector3D& dir,
79  bool layOnly) const;
80 
81  private:
82  std::vector<const Trk::IdentifiedMaterial*> ptrs() const;
83  std::vector<IdentifiedMaterial> m_matVec;
84  using binsPtr_t =
85  std::unique_ptr<const CompactBinnedArray<const IdentifiedMaterial> >;
87 };
88 
89 } // namespace Trk
90 
92  const Amg::Vector3D& position) const {
93  return m_matBins ? m_matBins->layerBinUtility(position) : nullptr;
94 }
95 
97  const Amg::Vector3D& position) const {
98  return m_matBins ? m_matBins->layerBin(position) : 0;
99 }
100 
101 #endif
CompactBinnedArray.h
index
Definition: index.py:1
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
Trk::BinnedMaterial
Definition: BinnedMaterial.h:38
Trk::BinnedMaterial::BinnedMaterial
BinnedMaterial(float iX0, float iL0, float iA, float iZ, float iRho, const CompactBinnedArray< const IdentifiedMaterial > *binMat=nullptr)
Constructor with arguments.
Definition: BinnedMaterial.h:44
Trk::BinnedMaterial::~BinnedMaterial
virtual ~BinnedMaterial()=default
Destructor - delete the composition if there.
Trk::BinnedMaterial::m_matVec
std::vector< IdentifiedMaterial > m_matVec
Definition: BinnedMaterial.h:83
Trk::BinnedMaterial::BinnedMaterial
BinnedMaterial()=default
Default Constructor needed for POOL.
Trk::CompactBinnedArray< const IdentifiedMaterial >
Trk::BinnedMaterial::materialNext
const IdentifiedMaterial * materialNext(const Amg::Vector3D &pos, const Amg::Vector3D &dir, bool layOnly) const
access to binned material
Definition: BinnedMaterial.cxx:73
CompactBinnedArray1D.h
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::BinUtility
Definition: BinUtility.h:39
Trk::BinnedMaterial::binsPtr_t
std::unique_ptr< const CompactBinnedArray< const IdentifiedMaterial > > binsPtr_t
Definition: BinnedMaterial.h:85
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::BinnedMaterial::operator=
BinnedMaterial & operator=(const BinnedMaterial &amc)
Assignment operator.
Definition: BinnedMaterial.cxx:42
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::BinnedMaterial::m_matBins
binsPtr_t m_matBins
Definition: BinnedMaterial.h:86
Trk::BinnedMaterial::layerBinUtility
const Trk::BinUtility * layerBinUtility(const Amg::Vector3D &position) const
access to layer bin utility
Definition: BinnedMaterial.h:91
Trk::BinnedMaterial::ptrs
std::vector< const Trk::IdentifiedMaterial * > ptrs() const
Definition: BinnedMaterial.cxx:81
CompactBinnedArray2D.h
Trk::BinnedMaterial::material
const IdentifiedMaterial * material(const Amg::Vector3D &position) const
access to material/id per bin
Definition: BinnedMaterial.cxx:65
Trk::Material
Definition: Material.h:116
Trk::BinnedMaterial::layerBin
size_t layerBin(const Amg::Vector3D &position) const
layer bin
Definition: BinnedMaterial.h:96
Trk::IdentifiedMaterial
std::pair< const Material *, int > IdentifiedMaterial
Definition: BinnedMaterial.h:28
Material.h