ATLAS Offline Software
MaterialEffectsBaseCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include "TrkSurfaces/Surface.h"
11 
12 
13 
15  const Trk::MaterialEffectsBase_p1 *persObj,
16  Trk::MaterialEffectsBase *transObj,
17  MsgStream& log)
18 {
19  transObj->m_tInX0 = persObj->m_tInX0;
20 
21  ITPConverterFor<Trk::Surface>* surfaceCnv=nullptr;
22  const Trk::Surface* temp = this->createTransFromPStore( &surfaceCnv, persObj->m_associatedSurface, log );
23 
24  DetElementSurfaceCnv_p1* detElCnv = dynamic_cast<DetElementSurfaceCnv_p1*>(surfaceCnv);
25  if (detElCnv) {
26  // have a DetElementSurface
27  temp = detElCnv->createSurface(log);
28  }
29  transObj->m_associatedSurface = temp;
30 
31  //
32  // ITPConverterFor<Trk::Surface> *associatedSurfaceCnv(0);
33  // transObj->m_associatedSurface =
34  // createTransFromPStore( &associatedSurfaceCnv, persObj->m_associatedSurface, log);
35  // FIXME check that TrackCollectionCnv can make diff between
36  // private and detStore surfaces
37  transObj->m_typeFlags = persObj->m_typeFlags;
38 }
39 
41  const Trk::MaterialEffectsBase *transObj,
42  Trk :: MaterialEffectsBase_p1 *persObj,
43  MsgStream& log)
44 {
45  persObj->m_tInX0 = (float)transObj->thicknessInX0();
46  // persObj->m_associatedSurface = toPersistent( (ITPConverterFor<Trk::Surface>**)0, transObj->m_associatedSurface, log );
47  persObj->m_typeFlags = (short)transObj->m_typeFlags;
48 
49  if (transObj->associatedSurface().isFree() ) // if this is a free surface, write it out 'as is'
50  persObj->m_associatedSurface = toPersistent((ITPConverterFor<Trk::Surface>**)nullptr, &transObj->associatedSurface(), log);
51  else { // else, make it into a DetElementSurface, to allow the correct convertor to be called
52  Trk::DetElementSurface surf( transObj->associatedSurface() );
53  persObj->m_associatedSurface = toPersistent((ITPConverterFor<Trk::Surface>**)nullptr, &surf, log );
54  }
55 }
MaterialEffectsBaseCnv_p1::persToTrans
virtual void persToTrans(const Trk ::MaterialEffectsBase_p1 *persObj, Trk ::MaterialEffectsBase *transObj, MsgStream &log)
Definition: MaterialEffectsBaseCnv_p1.cxx:14
ITPConverterFor< Trk::Surface >
DetElementSurfaceCnv_p1::createSurface
const Trk::Surface * createSurface(MsgStream &log)
Definition: DetElementSurfaceCnv_p1.cxx:19
xAOD::short
short
Definition: Vertex_v1.cxx:165
Surface.h
Trk::MaterialEffectsBase::thicknessInX0
double thicknessInX0() const
returns the actually traversed material .
Trk::MaterialEffectsBase
base class to integrate material effects on Trk::Track in a flexible way.
Definition: MaterialEffectsBase.h:35
MaterialEffectsBase.h
Trk::SurfacePtrHolderImplDetEl::m_associatedSurface
const S * m_associatedSurface
Definition: SurfaceHolderImpl.h:244
Trk::MaterialEffectsBase::m_tInX0
double m_tInX0
- the traversed thickness in RadiationLengths
Definition: MaterialEffectsBase.h:139
MaterialEffectsBaseCnv_p1.h
Trk::DetElementSurface
Definition: DetElementSurface.h:32
MaterialEffectsBaseCnv_p1::transToPers
virtual void transToPers(const Trk ::MaterialEffectsBase *transObj, Trk ::MaterialEffectsBase_p1 *persObj, MsgStream &log)
Definition: MaterialEffectsBaseCnv_p1.cxx:40
Trk::MaterialEffectsBase_p1::m_associatedSurface
TPObjRef m_associatedSurface
Definition: MaterialEffectsBase_p1.h:26
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::MaterialEffectsBase_p1::m_tInX0
float m_tInX0
Definition: MaterialEffectsBase_p1.h:24
Trk::MaterialEffectsBase_p1::m_typeFlags
short m_typeFlags
Definition: MaterialEffectsBase_p1.h:25
Trk::Surface::isFree
bool isFree() const
Returns 'true' if this surface is 'free', i.e.
SurfaceCnv_p1.h
Trk::MaterialEffectsBase_p1
Definition: MaterialEffectsBase_p1.h:20
DetElementSurfaceCnv_p1
Definition: DetElementSurfaceCnv_p1.h:46
Trk::MaterialEffectsBase::m_typeFlags
long m_typeFlags
Definition: MaterialEffectsBase.h:140
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
DetElementSurfaceCnv_p1.h
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
DetElementSurface.h
Trk::MaterialEffectsBase::associatedSurface
const Surface & associatedSurface() const
returns the surface to which these m.eff. are associated.
readCCLHist.float
float
Definition: readCCLHist.py:83
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