ATLAS Offline Software
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
13 
14 
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;
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 
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 }
Trk::CompressedLayerMaterial_p1::materialVector
std::vector< TPObjRef > materialVector
Definition: CompressedLayerMaterial_p1.h:27
Trk::CompressedLayerMaterial_p1
Definition: CompressedLayerMaterial_p1.h:21
ITPConverterFor
Definition: TPConverter.h:37
fitman.sz
sz
Definition: fitman.py:527
BinUtilityCnv_p1::persToTrans
virtual void persToTrans(const Trk::BinUtility_p1 *persObj, Trk::BinUtility *transObj, MsgStream &log)
Definition: BinUtilityCnv_p1.cxx:10
MaterialProperties.h
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:53
Trk::CompressedLayerMaterial::fullMaterial
const MaterialPropertiesVector & fullMaterial() const
Return method for full material description of the Layer - for all bins.
Definition: CompressedLayerMaterial.h:120
BinUtility.h
python.atlas_oh.im
im
Definition: atlas_oh.py:167
Trk::CompressedLayerMaterial_p1::materialBins
std::vector< unsigned short int > materialBins
Definition: CompressedLayerMaterial_p1.h:28
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
TPObjRef
Definition: TPObjRef.h:20
Trk::CompressedLayerMaterial_p1::binUtility
BinUtility_p1 binUtility
Definition: CompressedLayerMaterial_p1.h:29
Trk::MaterialPropertiesVector
std::vector< const MaterialProperties * > MaterialPropertiesVector
Useful typedefs.
Definition: MaterialProperties.h:133
CompressedLayerMaterialCnv_p1.h
Trk::CompressedLayerMaterial
Definition: CompressedLayerMaterial.h:31
python.InDetPriVxFinderConfig.mlog
mlog
Definition: InDetPriVxFinderConfig.py:134
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:142
CompressedLayerMaterialCnv_p1::persToTrans
void persToTrans(const Trk::CompressedLayerMaterial_p1 *, Trk::CompressedLayerMaterial *, MsgStream &)
Definition: CompressedLayerMaterialCnv_p1.cxx:15
CompressedLayerMaterialCnv_p1::m_gBinUtilityCnv
BinUtilityCnv_p1 m_gBinUtilityCnv
Definition: CompressedLayerMaterialCnv_p1.h:32
CompressedLayerMaterialCnv_p1::transToPers
void transToPers(const Trk::CompressedLayerMaterial *, Trk::CompressedLayerMaterial_p1 *, MsgStream &)
Definition: CompressedLayerMaterialCnv_p1.cxx:38
ITPConverterFor< TRANS_BASE >::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Persistify an object and store the persistent represenation in the storage vector of the top-level pe...
Definition: TPConverter.h:119
Trk::CompressedLayerMaterial_p1::splitFactor
float splitFactor
Definition: CompressedLayerMaterial_p1.h:30
ref
const boost::regex ref(r_ef)
BinUtility_p1.h
BinUtilityCnv_p1::transToPers
virtual void transToPers(const Trk::BinUtility *transObj, Trk::BinUtility_p1 *persObj, MsgStream &log)
Definition: BinUtilityCnv_p1.cxx:52
ITPConverterFor< TRANS_BASE >::createTransFromPStore
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Create transient representation of a persistent object, stored in the the top-level persistent object...
Definition: TPConverter.h:172
CompressedLayerMaterial.h