2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 #include "TrkEventTPCnv/TrkParameters/mungeZeroQOverP.h"
8 //-----------------------------------------------------------------------------
10 // file: NeutralAtaSurfaceCnv_p1.icc
12 //-----------------------------------------------------------------------------
14 template< class SURFACE_CNV, class ATA_SURFACE >
16 NeutralAtaSurfaceCnv_p1< SURFACE_CNV, ATA_SURFACE >::
17 persToTrans( const Trk::AtaSurface_p1 *persObj, ATA_SURFACE *transObj, MsgStream &log )
19 this->fillTransFromPStore( &m_paramCnv, persObj->m_parameters, transObj, log );
21 // Preserve previous behavior of tp converters.
23 auto parms = transObj->parameters();
24 if (parms[Trk::qOverP] == 0) {
25 parms[Trk::qOverP] = 1;
29 ITPConverterFor<Trk::Surface>* surfaceCnv=0;
30 const Trk::Surface* temp = this->createTransFromPStore( &surfaceCnv, persObj->m_assocSurface, log );
31 DetElementSurfaceCnv_p1* detElCnv = dynamic_cast<DetElementSurfaceCnv_p1*>(surfaceCnv);
33 // have a DetElementSurface
34 temp = detElCnv->createSurface(log);
37 Trk::SurfaceUniquePtrT<const typename SURFACE_CNV::Trans_t> surf
38 (static_cast<const typename SURFACE_CNV::Trans_t*>(temp));
40 *transObj = ATA_SURFACE (parms, *surf.get());
42 TrkEventTPCnv::mungeZeroQOverP (*transObj);
45 template< class SURFACE_CNV, class ATA_SURFACE >
47 NeutralAtaSurfaceCnv_p1< SURFACE_CNV, ATA_SURFACE >::
48 transToPers( const ATA_SURFACE * /**transObj*/, Trk::AtaSurface_p1 * /**persObj*/, MsgStream & /**log*/ )
50 throw std::runtime_error("NeutralAtaSurfaceCnv_p1::transToPers is deprecated!");