2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 //-----------------------------------------------------------------------------
7 // file: AtaSurfaceCnv_p1.icc
9 //-----------------------------------------------------------------------------
11 #include "TrkEventCnvTools/DetElementSurface.h"
12 #include "TrkEventTPCnv/TrkDetElementSurface/DetElementSurfaceCnv_p1.h"
13 #include "TrkSurfaces/StraightLineSurface.h"
14 #include "TrkSurfaces/Surface.h"
17 #include "TrkEventTPCnv/TrkParameters/mungeZeroQOverP.h"
19 template< class SURFACE_CNV, class ATA_SURFACE >
21 AtaSurfaceCnv_p1< SURFACE_CNV, ATA_SURFACE >::
22 persToTrans( const Trk::AtaSurface_p1 *persObj, ATA_SURFACE *transObj, MsgStream &log )
24 this->fillTransFromPStore( &m_paramCnv, persObj->m_parameters, transObj, log );
26 // Preserve previous behavior of tp converters.
28 auto parms = transObj->parameters();
29 if (parms[Trk::qOverP] == 0) {
30 parms[Trk::qOverP] = 1;
34 ITPConverterFor<Trk::Surface>* surfaceCnv=0;
35 const Trk::Surface* temp = this->createTransFromPStore( &surfaceCnv, persObj->m_assocSurface, log );
36 DetElementSurfaceCnv_p1* detElCnv = dynamic_cast<DetElementSurfaceCnv_p1*>(surfaceCnv);
38 // have a DetElementSurface
39 temp = detElCnv->createSurface(log);
42 Trk::SurfaceUniquePtrT<const typename SURFACE_CNV::Trans_t> surf
43 (static_cast<const typename SURFACE_CNV::Trans_t*>(temp));
45 *transObj = ATA_SURFACE (parms, *surf.get());
47 *transObj = ATA_SURFACE (parms, nullptr);
49 TrkEventTPCnv::mungeZeroQOverP (*transObj);
54 AtaSurfaceCnv_p1< PlaneSurfaceCnv_p1, Trk::CurvilinearParameters >::
55 persToTrans( const Trk::AtaSurface_p1 * /**persObj*/, Trk::CurvilinearParameters * /**transObj*/, MsgStream & /**log*/ )
57 throw std::runtime_error("CurvilinearParametersCnv_p1::transToPers is deprecated!");
60 template< class SURFACE_CNV, class ATA_SURFACE >
62 AtaSurfaceCnv_p1< SURFACE_CNV, ATA_SURFACE >::
63 transToPers( const ATA_SURFACE * /**transObj*/, Trk::AtaSurface_p1 * /**persObj*/, MsgStream & /**log*/ )
65 throw std::runtime_error("AtaSurfaceCnv_p1::transToPers is deprecated!");