ATLAS Offline Software
TrackSegmentCnv_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 
5 
8 #include "TrkSurfaces/Surface.h"
11 
12 void TrackSegmentCnv_p1::persToTrans( const Trk::TrackSegment_p1 *persObj, Trk::TrackSegment *transObj, MsgStream &log )
13 {
14 // std::cout << "TrackSegmentCnv_p1::persToTrans(...) start" << std::endl;
15  fillTransFromPStore( &m_segmentCnv, persObj->m_segment, transObj, log );
16  // transObj->m_associatedSurface = createTransFromPStore( (ITPConverterFor<Trk::Surface>**)0, persObj->m_associatedSurface, log );
17  ITPConverterFor<Trk::Surface>* surfaceCnv=nullptr;
18  const Trk::Surface* temp = this->createTransFromPStore( &surfaceCnv, persObj->m_associatedSurface, log );
19 
20  DetElementSurfaceCnv_p1* detElCnv = dynamic_cast<DetElementSurfaceCnv_p1*>(surfaceCnv);
21  if (detElCnv) {
22  // have a DetElementSurface
23  temp = detElCnv->createSurface(log);
24  }
25  transObj->m_associatedSurface = temp;
26 // std::cout << "TrackSegmentCnv_p1::persToTrans(...) end" << std::endl;
27 }
28 
29 
30 void TrackSegmentCnv_p1::transToPers( const Trk::TrackSegment *transObj, Trk::TrackSegment_p1 *persObj, MsgStream &log )
31 {
32  persObj->m_segment = baseToPersistent( &m_segmentCnv, transObj, log );
33  if (transObj->m_associatedSurface->isFree() ) // if this is a free surface, write it out 'as is'
35  else { // else, make it into a DetElementSurface, to allow the correct convertor to be called
36  Trk::DetElementSurface surf( *(transObj->m_associatedSurface) );
37  persObj->m_associatedSurface = toPersistent((ITPConverterFor<Trk::Surface>**)nullptr, &surf, log );
38  }
39 }
TrackSegmentCnv_p1.h
ITPConverterFor< Trk::Surface >
DetElementSurfaceCnv_p1::createSurface
const Trk::Surface * createSurface(MsgStream &log)
Definition: DetElementSurfaceCnv_p1.cxx:19
Surface.h
Trk::TrackSegment_p1
Definition: TrackSegment_p1.h:22
Trk::TrackSegment
Definition: TrackSegment.h:56
Trk::SurfacePtrHolderImplDetEl::m_associatedSurface
const S * m_associatedSurface
Definition: SurfaceHolderImpl.h:244
Trk::TrackSegment_p1::m_segment
TPObjRef m_segment
Definition: TrackSegment_p1.h:25
ITPConverterFor< TRANS_BASE >::fillTransFromPStore
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
Convert persistent object, stored in the the top-level persistent object and referenced by the TP Ref...
Definition: TPConverter.h:145
TrackSegment.h
Trk::DetElementSurface
Definition: DetElementSurface.h:32
TrackSegmentCnv_p1::persToTrans
void persToTrans(const Trk::TrackSegment_p1 *persObj, Trk::TrackSegment *transObj, MsgStream &log)
Definition: TrackSegmentCnv_p1.cxx:12
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
ITPConverterFor< TRANS_BASE >::baseToPersistent
TPObjRef baseToPersistent(CNV **cnv, const typename CNV::Trans_t *transObj, MsgStream &log) const
Persistify bass class of a given object and store the persistent represenation in the storage vector ...
Definition: TPConverter.h:97
TrackSegmentCnv_p1::transToPers
void transToPers(const Trk::TrackSegment *transObj, Trk::TrackSegment_p1 *persObj, MsgStream &log)
Definition: TrackSegmentCnv_p1.cxx:30
Trk::TrackSegment_p1::m_associatedSurface
TPObjRef m_associatedSurface
Definition: TrackSegment_p1.h:29
TrackSegmentCnv_p1::m_segmentCnv
SegmentCnv_p1 * m_segmentCnv
Definition: TrackSegmentCnv_p1.h:38
DetElementSurfaceCnv_p1
Definition: DetElementSurfaceCnv_p1.h:46
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
DetElementSurfaceCnv_p1.h
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
DetElementSurface.h
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