ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
12
13
15 const Trk::MaterialEffectsBase_p1 *persObj,
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
40void MaterialEffectsBaseCnv_p1 :: transToPers(
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}
const Trk::Surface * createSurface(MsgStream &log)
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
virtual void persToTrans(const Trk ::MaterialEffectsBase_p1 *persObj, Trk ::MaterialEffectsBase *transObj, MsgStream &log)
base class to integrate material effects on Trk::Track in a flexible way.
const Surface & associatedSurface() const
returns the surface to which these m.eff. are associated.
double thicknessInX0() const
returns the actually traversed material .
double m_tInX0
- the traversed thickness in RadiationLengths
Abstract Base Class for tracking surfaces.
bool isFree() const
Returns 'true' if this surface is 'free', i.e.