ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
12void 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
30void 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
37 persObj->m_associatedSurface = toPersistent((ITPConverterFor<Trk::Surface>**)nullptr, &surf, log );
38 }
39}
const Trk::Surface * createSurface(MsgStream &log)
TPObjRef baseToPersistent(CNV **cnv, const typename CNV::Trans_t *transObj, MsgStream &log) const
Definition TPConverter.h:97
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
void persToTrans(const Trk::TrackSegment_p1 *persObj, Trk::TrackSegment *transObj, MsgStream &log)
SegmentCnv_p1 * m_segmentCnv
void transToPers(const Trk::TrackSegment *transObj, Trk::TrackSegment_p1 *persObj, MsgStream &log)
Abstract Base Class for tracking surfaces.
bool isFree() const
Returns 'true' if this surface is 'free', i.e.
Class for a generic track segment that holdes polymorphic Trk::MeasurementBase objects,...