ATLAS Offline Software
Loading...
Searching...
No Matches
BoundSurfaceCnv_p1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5//-----------------------------------------------------------------------------
6//
7// file: BoundSurfaceCnv_p1.cxx
8//
9// ----------------------------------------------------------------------------
10
17#include <typeinfo>
18#include <memory>
19
20template< class SURFACE, class BOUNDS_CNV >
21void
23persToTrans( 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 = std::shared_ptr<Trk::SurfaceBounds>(bounds);
28}
29
30// Specialization for CylinderSurface (most surfaces have m_bound == SurfaceBounds*, but Cyl Surf is limited to having Cylinder Bounds.)
31template< >
32void
34persToTrans( const Trk::BoundSurface_p1 *persObj, Trk::CylinderSurface *transObj, MsgStream &log )
35{
36 m_surfaceCnv.persToTrans( persObj, transObj, log );
38 transObj->m_bounds = std::shared_ptr<Trk::CylinderBounds>(bounds);
39}
40
41// Specialization for StraightLineSurface (most surfaces have m_bound == SurfaceBounds*, but StraightLineSurface is limited to having Cylinder Bounds.)
42template< >
43void
45persToTrans( 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 );
49 transObj->m_bounds = std::shared_ptr<Trk::CylinderBounds>(bounds);
50}
51
52
53
54template< class SURFACE, class BOUNDS_CNV >
55void
57transToPers( 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
69template< class SURFACE >
70void
72persToTrans( 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 = std::shared_ptr<Trk::SurfaceBounds>(bounds);
77}
78
79
80template< class SURFACE >
81void
83transToPers( 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
#define endmsg
ITPConverterFor< Trk::SurfaceBounds > TPCnvForSurfBnds
void persToTrans(const Trk::BoundSurface_p1 *, SURFACE *, MsgStream &)
SurfaceCnv_p1 m_surfaceCnv
void transToPers(const SURFACE *, Trk::BoundSurface_p1 *, MsgStream &)
Common base class for all TP converters, specialized for a given transient type.
Definition TPConverter.h:37
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Bounds for a cylindrical Surface.
Class for a CylinderSurface in the ATLAS detector.
std::shared_ptr< const CylinderBounds > m_bounds
The global reference point (== a point on the surface)
Bounds object for a boundless surface (...)
Definition NoBounds.h:30
Class for a StraightLineSurface in the ATLAS detector to describe dirft tube and straw like detectors...
std::shared_ptr< const CylinderBounds > m_bounds
NoBounds as return object when no bounds are declared.
Abstract base class for surface bounds to be specified.