ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkEventCnv
TrkEventTPCnv
src
TrkSurfaces
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
11
#include "
TrkSurfaces/StraightLineSurface.h
"
12
#include "
TrkSurfaces/DiscSurface.h
"
13
#include "
TrkSurfaces/PlaneSurface.h
"
14
#include "
TrkSurfaces/CylinderSurface.h
"
15
#include "
TrkSurfaces/NoBounds.h
"
16
#include "
TrkEventTPCnv/TrkSurfaces/BoundSurfaceCnv_p1.h
"
17
#include <typeinfo>
18
#include <memory>
19
20
template
<
class
SURFACE,
class
BOUNDS_CNV >
21
void
22
BoundSurfaceCnv_p1< SURFACE, BOUNDS_CNV >::
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 = 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.)
31
template
< >
32
void
33
BoundSurfaceCnv_p1< Trk::CylinderSurface, CylinderBoundsCnv_p1 >::
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 );
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.)
42
template
< >
43
void
44
BoundSurfaceCnv_p1< Trk::StraightLineSurface, CylinderBoundsCnv_p1 >::
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 );
49
transObj->
m_bounds
= std::shared_ptr<Trk::CylinderBounds>(bounds);
50
}
51
52
53
54
template
<
class
SURFACE,
class
BOUNDS_CNV >
55
void
56
BoundSurfaceCnv_p1< SURFACE, BOUNDS_CNV >::
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
67
using
TPCnvForSurfBnds
=
ITPConverterFor<Trk::SurfaceBounds>
;
68
69
template
<
class
SURFACE >
70
void
71
BoundSurfaceCnv_p1< SURFACE, TPCnvForSurfBnds >::
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 = std::shared_ptr<Trk::SurfaceBounds>(bounds);
77
}
78
79
80
template
<
class
SURFACE >
81
void
82
BoundSurfaceCnv_p1< SURFACE, TPCnvForSurfBnds >::
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
92
template
class
BoundSurfaceCnv_p1< Trk::DiscSurface, DiscBoundsCnv_p1 >
;
93
template
class
BoundSurfaceCnv_p1< Trk::CylinderSurface, CylinderBoundsCnv_p1 >
;
94
template
class
BoundSurfaceCnv_p1< Trk::StraightLineSurface, CylinderBoundsCnv_p1 >
;
95
template
class
BoundSurfaceCnv_p1< Trk::PlaneSurface >
;
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
TPCnvForSurfBnds
ITPConverterFor< Trk::SurfaceBounds > TPCnvForSurfBnds
Definition
BoundSurfaceCnv_p1.cxx:67
BoundSurfaceCnv_p1.h
CylinderSurface.h
DiscSurface.h
NoBounds.h
PlaneSurface.h
StraightLineSurface.h
BoundSurfaceCnv_p1< Trk::DiscSurface, DiscBoundsCnv_p1 >
BoundSurfaceCnv_p1::persToTrans
void persToTrans(const Trk::BoundSurface_p1 *, SURFACE *, MsgStream &)
Definition
BoundSurfaceCnv_p1.cxx:23
BoundSurfaceCnv_p1::m_surfaceCnv
SurfaceCnv_p1 m_surfaceCnv
Definition
BoundSurfaceCnv_p1.h:40
BoundSurfaceCnv_p1::m_boundsCnv
BOUNDS_CNV * m_boundsCnv
Definition
BoundSurfaceCnv_p1.h:41
BoundSurfaceCnv_p1::transToPers
void transToPers(const SURFACE *, Trk::BoundSurface_p1 *, MsgStream &)
Definition
BoundSurfaceCnv_p1.cxx:57
ITPConverterFor
Common base class for all TP converters, specialized for a given transient type.
Definition
TPConverter.h:37
ITPConverterFor< TRANS_BASE >::createTransFromPStore
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Definition
TPConverter.h:172
Trk::BoundSurface_p1
Definition
BoundSurface_p1.h:19
Trk::BoundSurface_p1::m_bounds
TPObjRef m_bounds
Definition
BoundSurface_p1.h:23
Trk::CylinderBounds
Bounds for a cylindrical Surface.
Definition
CylinderBounds.h:46
Trk::CylinderSurface
Class for a CylinderSurface in the ATLAS detector.
Definition
CylinderSurface.h:55
Trk::CylinderSurface::m_bounds
std::shared_ptr< const CylinderBounds > m_bounds
The global reference point (== a point on the surface).
Definition
CylinderSurface.h:289
Trk::NoBounds
Bounds object for a boundless surface (...).
Definition
NoBounds.h:30
Trk::StraightLineSurface
Class for a StraightLineSurface in the ATLAS detector to describe dirft tube and straw like detectors...
Definition
StraightLineSurface.h:51
Trk::StraightLineSurface::m_bounds
std::shared_ptr< const CylinderBounds > m_bounds
NoBounds as return object when no bounds are declared.
Definition
StraightLineSurface.h:289
Trk::SurfaceBounds
Abstract base class for surface bounds to be specified.
Definition
SurfaceBounds.h:47
python.CaloCondTools.log
log
Definition
CaloCondTools.py:20
Generated on
for ATLAS Offline Software by
1.17.0