ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkEventCnv
TrkEventTPCnv
src
TrkSurfaces
BoundSurfaceCnv_p2.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_p2.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_p2.h
"
17
#include <typeinfo>
18
#include <memory>
19
20
template
<
class
SURFACE,
class
BOUNDS_CNV >
21
void
22
BoundSurfaceCnv_p2< SURFACE, BOUNDS_CNV >::
23
persToTrans
(
const
Trk::BoundSurface_p2
* , SURFACE* , MsgStream & )
24
{
25
throw
std::runtime_error(
"BoundSurfaceCnv_p2::persToTrans shouldn't be called any more!"
);
26
}
27
28
template
<
class
SURFACE,
class
BOUNDS_CNV >
29
SURFACE*
30
BoundSurfaceCnv_p2< SURFACE, BOUNDS_CNV >::createTransient
(
const
Trk::BoundSurface_p2
* persObj, MsgStream& log)
31
{
32
SURFACE* transObj =
m_surfaceCnv
.createTransient( persObj, log );
33
typename
BOUNDS_CNV::Trans_t* bounds = this->
createTransFromPStore
( &
m_boundsCnv
, persObj->
m_bounds
, log );
34
transObj->m_bounds = std::shared_ptr<typename BOUNDS_CNV::Trans_t>(bounds);
35
return
transObj;
36
}
37
38
39
template
<
class
SURFACE,
class
BOUNDS_CNV >
40
void
41
BoundSurfaceCnv_p2< SURFACE, BOUNDS_CNV >::
42
transToPers
(
const
SURFACE *transObj,
Trk::BoundSurface_p2
*persObj, MsgStream &log )
43
{
44
m_surfaceCnv
.transToPers( transObj, persObj, log );
45
if
((transObj->m_bounds).get() && !
dynamic_cast<
const
Trk::NoBounds
*
>
((transObj->m_bounds).get()))
46
persObj->
m_bounds
= this->
toPersistent
( &
m_boundsCnv
, (transObj->m_bounds).get(), log );
47
}
48
49
// specialized for polymorphic surfaces
50
using
TPCnvForSurfBnds
=
ITPConverterFor<Trk::SurfaceBounds>
;
51
52
template
<
class
SURFACE >
53
void
54
BoundSurfaceCnv_p2< SURFACE, TPCnvForSurfBnds >::
55
persToTrans
(
const
Trk::BoundSurface_p2
* , SURFACE * , MsgStream & )
56
{
57
throw
std::runtime_error(
"BoundSurfaceCnv_p2::persToTrans shouldn't be called any more!"
);
58
// This is because in the SurfaceCnv we might need to return an already existing surface (belong to a DetElement)
59
}
60
61
template
<
class
SURFACE >
62
SURFACE*
63
BoundSurfaceCnv_p2< SURFACE >::createTransient
(
const
Trk::BoundSurface_p2
* persObj, MsgStream& log)
64
{
65
SURFACE* transObj = m_surfaceCnv.createTransient( persObj, log );
66
67
Trk::SurfaceBounds
* bounds = this->createTransFromPStore( (
TPCnvForSurfBnds
**)
nullptr
, persObj->
m_bounds
, log );
68
transObj->m_bounds = std::shared_ptr<Trk::SurfaceBounds>(bounds);
69
return
transObj;
70
}
71
72
73
template
<
class
SURFACE >
74
void
75
BoundSurfaceCnv_p2< SURFACE, TPCnvForSurfBnds >::
76
transToPers
(
const
SURFACE *transObj,
Trk::BoundSurface_p2
*persObj, MsgStream &log )
77
{
78
m_surfaceCnv.transToPers( transObj, persObj, log );
79
if
((transObj->m_bounds).get() && !
dynamic_cast<
const
Trk::NoBounds
*
>
((transObj->m_bounds).get()))
80
persObj->
m_bounds
= this->toPersistent( (
TPCnvForSurfBnds
**)
nullptr
, (transObj->m_bounds).get(), log );
81
}
82
83
84
template
class
BoundSurfaceCnv_p2< Trk::DiscSurface, DiscBoundsCnv_p1 >
;
85
template
class
BoundSurfaceCnv_p2< Trk::CylinderSurface, CylinderBoundsCnv_p1 >
;
86
template
class
BoundSurfaceCnv_p2< Trk::StraightLineSurface, CylinderBoundsCnv_p1 >
;
87
template
class
BoundSurfaceCnv_p2< Trk::PlaneSurface >
;
88
template
class
BoundSurfaceCnv_p2< Trk::ConeSurface, ConeBoundsCnv_p1>
;
TPCnvForSurfBnds
ITPConverterFor< Trk::SurfaceBounds > TPCnvForSurfBnds
Definition
BoundSurfaceCnv_p1.cxx:67
BoundSurfaceCnv_p2.h
CylinderSurface.h
DiscSurface.h
NoBounds.h
PlaneSurface.h
StraightLineSurface.h
BoundSurfaceCnv_p2< Trk::DiscSurface, DiscBoundsCnv_p1 >
BoundSurfaceCnv_p2::transToPers
void transToPers(const SURFACE *, Trk::BoundSurface_p2 *, MsgStream &)
Definition
BoundSurfaceCnv_p2.cxx:42
BoundSurfaceCnv_p2::persToTrans
void persToTrans(const Trk::BoundSurface_p2 *, SURFACE *, MsgStream &)
Definition
BoundSurfaceCnv_p2.cxx:23
BoundSurfaceCnv_p2::m_boundsCnv
BOUNDS_CNV * m_boundsCnv
Definition
BoundSurfaceCnv_p2.h:46
BoundSurfaceCnv_p2::m_surfaceCnv
SurfaceCnv_p2< SURFACE > m_surfaceCnv
Definition
BoundSurfaceCnv_p2.h:45
BoundSurfaceCnv_p2::createTransient
SURFACE * createTransient(const Trk::BoundSurface_p2 *persObj, MsgStream &log)
Definition
BoundSurfaceCnv_p2.cxx:30
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
BoundSurfaceCnv_p2< Trk::ConeSurface, ConeBoundsCnv_p1 >::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Definition
TPConverter.h:119
Trk::BoundSurface_p2
Definition
BoundSurface_p2.h:19
Trk::BoundSurface_p2::m_bounds
TPObjRef m_bounds
Definition
BoundSurface_p2.h:23
Trk::NoBounds
Bounds object for a boundless surface (...).
Definition
NoBounds.h:30
Trk::SurfaceBounds
Abstract base class for surface bounds to be specified.
Definition
SurfaceBounds.h:47
Generated on
for ATLAS Offline Software by
1.17.0