ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkDetDescr
TrkDetDescrTools
src
BinnedLayerMaterialCreator.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// BinnedLayerMaterialCreator.cxx, (c) ATLAS Detector software
8
9
// STL
10
#include <sstream>
11
// Trk include
12
#include "
TrkDetDescrTools/BinnedLayerMaterialCreator.h
"
13
#include "
TrkDetDescrUtils/BinUtility.h
"
14
#include "
TrkGeometry/MaterialProperties.h
"
15
#include "
TrkGeometry/LayerMaterialRecord.h
"
16
#include "
TrkGeometry/LayerMaterialProperties.h
"
17
#include "
TrkGeometry/BinnedLayerMaterial.h
"
18
19
20
21
// constructor
22
Trk::BinnedLayerMaterialCreator::BinnedLayerMaterialCreator
(
const
std::string& t,
const
std::string& n,
const
IInterface* p)
23
:
AthAlgTool
(t,n,p)
24
{
25
declareInterface<Trk::ILayerMaterialCreator>(
this
);
26
27
// give the map a name
28
declareProperty
(
"LayerMaterialName"
,
m_layerMaterialName
);
29
declareProperty
(
"LayerMaterialDirectory"
,
m_layerMaterialDirectory
);
30
}
31
32
33
Trk::LayerMaterialProperties
*
Trk::BinnedLayerMaterialCreator::createLayerMaterial
(
const
Trk::LayerMaterialRecord
& lmr)
const
34
{
35
// get the material matrix and copy
36
const
Trk::MaterialPropertiesMatrix
& mpm = lmr.
associatedLayerMaterial
();
37
// this method creates a compressed representation of the BinnedLayerMaterial
38
const
Trk::BinUtility
* cbinutil = lmr.
binUtility
();
39
// create the compressed material
40
return
new
Trk::BinnedLayerMaterial
(*cbinutil,mpm);
41
}
42
43
Trk::LayerMaterialProperties
*
Trk::BinnedLayerMaterialCreator::convertLayerMaterial
(
const
Trk::LayerMaterialProperties
& lmProperties)
const
44
{
45
// the return object
46
Trk::LayerMaterialProperties
* bLayerMaterial =
nullptr
;
47
// get the binUtility of the LayerMaterialProperties
48
const
Trk::BinUtility
* bUtility = lmProperties.
binUtility
();
49
// we have a bin utility, get the matrix and fill it
50
if
(bUtility){
51
// prepare the matrix
52
// nF x nS
53
size_t
nBins0 = bUtility->
max
(0)+1;
54
size_t
nBins1 = bUtility->
max
(1)+1;
55
// create the MaterialMatrix
56
Trk::MaterialPropertiesMatrix
materialMatrix;
57
materialMatrix.reserve(nBins1);
58
// fill the matrix
59
for
(
size_t
ibin1 = 0; ibin1 < nBins1; ++ibin1) {
60
// create the vector first
61
Trk::MaterialPropertiesVector
materialVector;
62
materialVector.reserve(nBins0);
63
// loop over local 1 bins
64
for
(
size_t
ibin0 = 0; ibin0 < nBins0; ++ibin0) {
65
// get the material from the properties and push them as clones for the BinnedLayerMaterial
66
const
Trk::MaterialProperties
* mProperties = lmProperties.
material
(ibin0,ibin1) ? lmProperties.
material
(ibin0,ibin1)->
clone
() :
nullptr
;
67
materialVector.push_back(mProperties);
68
}
69
// now pus the vector into the matrix
70
materialMatrix.push_back(std::move(materialVector));
71
}
72
73
74
}
else
{
75
// must be homogenous material, can be transformed into a 0-bin material, would be silly though
76
bLayerMaterial = lmProperties.
clone
();
77
}
78
//
79
return
bLayerMaterial;
80
}
81
82
BinUtility.h
BinnedLayerMaterialCreator.h
BinnedLayerMaterial.h
LayerMaterialProperties.h
LayerMaterialRecord.h
MaterialProperties.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
Trk::BinUtility
A generic symmetric BinUtility, for fully symmetric binning in terms of binning grid and binning type...
Definition
BinUtility.h:39
Trk::BinUtility::max
size_t max(size_t ba=0) const
First bin maximal value.
Definition
BinUtility.h:210
Trk::BinnedLayerMaterialCreator::BinnedLayerMaterialCreator
BinnedLayerMaterialCreator(const std::string &, const std::string &, const IInterface *)
Constructor.
Definition
BinnedLayerMaterialCreator.cxx:22
Trk::BinnedLayerMaterialCreator::convertLayerMaterial
LayerMaterialProperties * convertLayerMaterial(const LayerMaterialProperties &lmr) const
create layer material properties from layer material properties - simply clones
Definition
BinnedLayerMaterialCreator.cxx:43
Trk::BinnedLayerMaterialCreator::createLayerMaterial
LayerMaterialProperties * createLayerMaterial(const LayerMaterialRecord &lmr) const
process the material properties
Definition
BinnedLayerMaterialCreator.cxx:33
Trk::BinnedLayerMaterial
It extends the LayerMaterialProperties base class.
Definition
BinnedLayerMaterial.h:34
Trk::ILayerMaterialCreator::m_layerMaterialName
std::string m_layerMaterialName
Definition
ILayerMaterialCreator.h:55
Trk::ILayerMaterialCreator::m_layerMaterialDirectory
std::string m_layerMaterialDirectory
Definition
ILayerMaterialCreator.h:56
Trk::LayerMaterialProperties
This virtual base class encapsulates the logics to build pre/post/full update material for Layer stru...
Definition
LayerMaterialProperties.h:64
Trk::LayerMaterialProperties::clone
virtual LayerMaterialProperties * clone() const =0
Pseudo-Constructor clone().
Trk::LayerMaterialProperties::binUtility
virtual const BinUtility * binUtility() const =0
Return the BinUtility.
Trk::LayerMaterialProperties::material
virtual const MaterialProperties * material(size_t ib0, size_t ib1) const =0
Direct access via bins to the MaterialProperties.
Trk::LayerMaterialRecord
Helper Class to record the material during the GeantinoNtupleMappingProcess.
Definition
LayerMaterialRecord.h:45
Trk::LayerMaterialRecord::associatedLayerMaterial
const MaterialPropertiesMatrix & associatedLayerMaterial() const
return method for the LayerMaterial
Definition
LayerMaterialRecord.h:132
Trk::LayerMaterialRecord::binUtility
const Trk::BinUtility * binUtility() const
return the BinUtility
Definition
LayerMaterialRecord.h:141
Trk::MaterialProperties
Material with information about thickness of material.
Definition
MaterialProperties.h:40
Trk::MaterialProperties::clone
MaterialProperties * clone() const
Pseudo-Constructor clone().
Definition
MaterialProperties.cxx:33
Trk::MaterialPropertiesVector
std::vector< const MaterialProperties * > MaterialPropertiesVector
Useful typedefs.
Definition
MaterialProperties.h:133
Trk::MaterialPropertiesMatrix
std::vector< std::vector< const MaterialProperties * > > MaterialPropertiesMatrix
Definition
ILayerMaterialAnalyser.h:25
Generated on
for ATLAS Offline Software by
1.17.0