ATLAS Offline Software
BoundSurfaceCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //-----------------------------------------------------------------------------
6 //
7 // file: BoundSurfaceCnv_p1.cxx
8 //
9 // ----------------------------------------------------------------------------
10 
16 #include "TrkSurfaces/NoBounds.h"
18 #include <typeinfo>
19 
20 template< class SURFACE, class BOUNDS_CNV >
21 void
23 persToTrans( const Trk::BoundSurface_p1 *persObj, SURFACE *transObj, MsgStream &log )
24 {
25  m_surfaceCnv.persToTrans( persObj, transObj, log );
26  Trk::SurfaceBounds* bounds = this->createTransFromPStore( &m_boundsCnv, persObj->m_bounds, log );
27  transObj->m_bounds = Trk::SharedObject<const Trk::SurfaceBounds>(bounds);
28 }
29 
30 // Specialization for CylinderSurface (most surfaces have m_bound == SurfaceBounds*, but Cyl Surf is limited to having Cylinder Bounds.)
31 template< >
32 void
34 persToTrans( const Trk::BoundSurface_p1 *persObj, Trk::CylinderSurface *transObj, MsgStream &log )
35 {
36  m_surfaceCnv.persToTrans( persObj, transObj, log );
37  Trk::CylinderBounds* bounds = this->createTransFromPStore( &m_boundsCnv, persObj->m_bounds, log );
39 }
40 
41 // Specialization for StraightLineSurface (most surfaces have m_bound == SurfaceBounds*, but StraightLineSurface is limited to having Cylinder Bounds.)
42 template< >
43 void
45 persToTrans( const Trk::BoundSurface_p1 *persObj, Trk::StraightLineSurface *transObj, MsgStream &log )
46 {
47  m_surfaceCnv.persToTrans( persObj, transObj, log );
48  Trk::CylinderBounds* bounds = this->createTransFromPStore( &m_boundsCnv, persObj->m_bounds, log );
50 }
51 
52 
53 
54 template< class SURFACE, class BOUNDS_CNV >
55 void
57 transToPers( const SURFACE *transObj, Trk::BoundSurface_p1 *persObj, MsgStream &log )
58 {
59  m_surfaceCnv.transToPers( transObj, persObj, log );
60  if ((transObj->m_bounds).get() && !dynamic_cast<const Trk::NoBounds*>((transObj->m_bounds).get()))
61  log<<MSG::WARNING<<" No longer writing out bounds... "<<endmsg;
62 }
63 
64 
65 
66 // specialized for polymorphic surfaces
68 
69 template< class SURFACE >
70 void
72 persToTrans( const Trk::BoundSurface_p1 *persObj, SURFACE *transObj, MsgStream &log )
73 {
74  m_surfaceCnv.persToTrans( persObj, transObj, log );
75  Trk::SurfaceBounds* bounds = this->createTransFromPStore( (TPCnvForSurfBnds**)nullptr, persObj->m_bounds, log );
76  transObj->m_bounds = Trk::SharedObject<const Trk::SurfaceBounds>(bounds);
77 }
78 
79 
80 template< class SURFACE >
81 void
83 transToPers( const SURFACE *transObj, Trk::BoundSurface_p1 *persObj, MsgStream &log )
84 {
85  m_surfaceCnv.transToPers( transObj, persObj, log );
86  if ((transObj->m_bounds).get() && !dynamic_cast<const Trk::NoBounds*>((transObj->m_bounds).get()))
87  log<<MSG::WARNING<<" No longer writing out bounds... "<<endmsg;
88 
89 }
90 
91 
Trk::BoundSurface_p1::m_bounds
TPObjRef m_bounds
Definition: BoundSurface_p1.h:23
ITPConverterFor< Trk::SurfaceBounds >
StraightLineSurface.h
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
BoundSurfaceCnv_p1::m_surfaceCnv
SurfaceCnv_p1 m_surfaceCnv
Definition: BoundSurfaceCnv_p1.h:40
SurfaceCnv_p1::persToTrans
void persToTrans(const Trk::Surface_p1 *, Trk::Surface *, MsgStream &)
Definition: SurfaceCnv_p1.cxx:18
BoundSurfaceCnv_p1< Trk::DiscSurface, DiscBoundsCnv_p1 >
BoundSurfaceCnv_p1::transToPers
void transToPers(const SURFACE *, Trk::BoundSurface_p1 *, MsgStream &)
Definition: BoundSurfaceCnv_p1.cxx:57
Trk::CylinderSurface::m_bounds
SharedObject< const CylinderBounds > m_bounds
The global reference point (== a point on the surface)
Definition: CylinderSurface.h:290
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Trk::CylinderSurface
Definition: CylinderSurface.h:55
Trk::CylinderBounds
Definition: CylinderBounds.h:46
CylinderSurface.h
BoundSurfaceCnv_p1::m_boundsCnv
BOUNDS_CNV * m_boundsCnv
Definition: BoundSurfaceCnv_p1.h:41
Trk::StraightLineSurface::m_bounds
SharedObject< const CylinderBounds > m_bounds
NoBounds as return object when no bounds are declared.
Definition: StraightLineSurface.h:289
SharedObject.h
Trk::BoundSurface_p1
Definition: BoundSurface_p1.h:19
Trk::NoBounds
Definition: NoBounds.h:30
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
PlaneSurface.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
DiscSurface.h
BoundSurfaceCnv_p1.h
BoundSurfaceCnv_p1::persToTrans
void persToTrans(const Trk::BoundSurface_p1 *, SURFACE *, MsgStream &)
Definition: BoundSurfaceCnv_p1.cxx:23
NoBounds.h
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51