ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkDetDescr
TrkDetDescrTPCnv
src
TrkGeometry
CompressedLayerMaterialCnv_p1.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// CompressedLayerMaterialCnv_p1.cxx, (c) ATLAS Detector software
8
#include "
TrkGeometry/CompressedLayerMaterial.h
"
9
#include "
TrkDetDescrUtils/BinUtility.h
"
10
#include "
TrkGeometry/MaterialProperties.h
"
11
#include "
TrkDetDescrTPCnv/TrkGeometry/CompressedLayerMaterialCnv_p1.h
"
12
#include "
TrkDetDescrTPCnv/TrkDetDescrUtils/BinUtility_p1.h
"
13
14
15
void
CompressedLayerMaterialCnv_p1::persToTrans
(
const
Trk::CompressedLayerMaterial_p1
*persObj,
16
Trk::CompressedLayerMaterial
*transObj,
17
MsgStream &mlog )
18
{
19
// create the transient BinUtility
20
auto
binUtility = std::make_unique<Trk::BinUtility>();
21
m_gBinUtilityCnv
.persToTrans(&persObj->
binUtility
, binUtility.get(), mlog);
22
23
// create the persistent material properties
24
// pointer to converter (will be auto-retrieved)
25
ITPConverterFor<Trk::MaterialProperties>
*materialCnv =
nullptr
;
26
Trk::MaterialPropertiesVector
mvec;
27
mvec.reserve (persObj->
materialVector
.size());
28
for
(
const
TPObjRef
&
ref
: persObj->
materialVector
)
29
mvec.push_back (
createTransFromPStore
( &materialCnv,
ref
, mlog ));
30
31
Trk::CompressedLayerMaterial
mat (std::move(binUtility),
32
std::move(mvec),
33
persObj->
materialBins
,
34
persObj->
splitFactor
);
35
*transObj = mat;
36
}
37
38
void
CompressedLayerMaterialCnv_p1::transToPers
(
const
Trk::CompressedLayerMaterial
*transObj,
39
Trk::CompressedLayerMaterial_p1
*persObj,
40
MsgStream &mlog )
41
{
42
43
// create the persistent BinUtility
44
m_gBinUtilityCnv
.transToPers(transObj->
binUtility
(), &persObj->
binUtility
, mlog);
45
46
// assign the material bins
47
persObj->
materialBins
= transObj->
materialBins
();
48
49
// create the persistent material properties
50
// pointer to converter (will be auto-retrieved)
51
ITPConverterFor<Trk::MaterialProperties>
*materialCnv =
nullptr
;
52
const
Trk::MaterialPropertiesVector
& fullMaterial = transObj->
fullMaterial
();
53
size_t
sz
= fullMaterial.size();
54
persObj->
materialVector
= std::vector< TPObjRef >(
sz
,
TPObjRef
());
55
for
(
size_t
im = 0; im <
sz
; im++) {
56
persObj->
materialVector
[im] =
toPersistent
( &materialCnv, fullMaterial[im], mlog );
57
}
58
persObj->
splitFactor
= transObj->
alongPostFactor
();
59
60
61
}
ref
const std::regex ref(r_ef)
BinUtility.h
BinUtility_p1.h
CompressedLayerMaterialCnv_p1.h
CompressedLayerMaterial.h
sz
static Double_t sz
Definition
LArPhysWaveHECTool.cxx:37
MaterialProperties.h
CompressedLayerMaterialCnv_p1::persToTrans
void persToTrans(const Trk::CompressedLayerMaterial_p1 *, Trk::CompressedLayerMaterial *, MsgStream &)
Definition
CompressedLayerMaterialCnv_p1.cxx:15
CompressedLayerMaterialCnv_p1::transToPers
void transToPers(const Trk::CompressedLayerMaterial *, Trk::CompressedLayerMaterial_p1 *, MsgStream &)
Definition
CompressedLayerMaterialCnv_p1.cxx:38
CompressedLayerMaterialCnv_p1::m_gBinUtilityCnv
BinUtilityCnv_p1 m_gBinUtilityCnv
Definition
CompressedLayerMaterialCnv_p1.h:32
ITPConverterFor< TRANS_BASE >::createTransFromPStore
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Definition
TPConverter.h:172
ITPConverterFor< TRANS_BASE >::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Definition
TPConverter.h:119
ITPConverterFor< TRANS_BASE >::ITPConverterFor
ITPConverterFor()
Definition
TPConverter.h:43
TPObjRef
This class is an object reference used in Athena persistent data model.
Definition
TPObjRef.h:20
Trk::CompressedLayerMaterial_p1
Definition
CompressedLayerMaterial_p1.h:21
Trk::CompressedLayerMaterial_p1::splitFactor
float splitFactor
Definition
CompressedLayerMaterial_p1.h:30
Trk::CompressedLayerMaterial_p1::binUtility
BinUtility_p1 binUtility
Definition
CompressedLayerMaterial_p1.h:29
Trk::CompressedLayerMaterial_p1::materialVector
std::vector< TPObjRef > materialVector
Definition
CompressedLayerMaterial_p1.h:27
Trk::CompressedLayerMaterial_p1::materialBins
std::vector< unsigned short int > materialBins
Definition
CompressedLayerMaterial_p1.h:28
Trk::CompressedLayerMaterial
It extends the LayerMaterialProperties base class.
Definition
CompressedLayerMaterial.h:31
Trk::CompressedLayerMaterial::materialBins
const std::vector< unsigned short int > & materialBins() const
Return method for index vector, needs BinUtility to interpret this.
Definition
CompressedLayerMaterial.h:126
Trk::CompressedLayerMaterial::fullMaterial
const MaterialPropertiesVector & fullMaterial() const
Return method for full material description of the Layer - for all bins.
Definition
CompressedLayerMaterial.h:120
Trk::CompressedLayerMaterial::binUtility
virtual const BinUtility * binUtility() const override final
Return the BinUtility.
Definition
CompressedLayerMaterial.h:116
Trk::LayerMaterialProperties::alongPostFactor
double alongPostFactor() const
Return method for post update material description of the Layer along normalvector.
Definition
LayerMaterialProperties.h:150
Trk::MaterialPropertiesVector
std::vector< const MaterialProperties * > MaterialPropertiesVector
Useful typedefs.
Definition
MaterialProperties.h:133
Generated on
for ATLAS Offline Software by
1.17.0