ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaAthenaPool
src
PhotonContainerCnv.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// PhotonContainerCnv.cxx
8
// Implementation file for class PhotonContainerCnv
9
// Author: K.Cranmer<cranmer@cern.ch>
10
// Author: S.Binet<binet@cern.ch>
12
13
// STL includes
14
15
// Framework includes
16
#include "GaudiKernel/MsgStream.h"
17
18
// egammaEventTPCnv includes
19
#include "
egammaEventTPCnv/PhotonContainerCnv_p1.h
"
20
#include "
egammaEventTPCnv/PhotonContainerCnv_p2.h
"
21
#include "
egammaEventTPCnv/PhotonContainerCnv_p3.h
"
22
#include "
egammaEventTPCnv/PhotonContainerCnv_p4.h
"
23
#include "
egammaEventTPCnv/PhotonContainerCnv_p5.h
"
24
25
// RecAthenaPool includes
26
#include "
PhotonContainerCnv.h
"
27
#include "
egammaMsgUtil.h
"
28
32
36
38
// Protected methods:
40
41
42
PhotonContainer_PERS
*
43
PhotonContainerCnv::createPersistent
(
PhotonContainer
* transCont )
44
{
45
MsgStream
msg
( msgSvc(),
"PhotonContainerCnv"
);
46
47
PhotonContainerCnv_p5
cnv;
48
PhotonContainer_PERS
*persObj = cnv.
createPersistent
( transCont,
msg
);
49
50
MSG_DEBUG
(
msg
,
"::createPersistent [Success]"
);
51
return
persObj;
52
}
53
54
PhotonContainer
*
PhotonContainerCnv::createTransient
(
const
Token
* token)
55
{
56
MsgStream
msg
( msgSvc(),
"PhotonContainerCnv"
);
57
58
PhotonContainer
*transObj =
nullptr
;
59
60
static
const
Guid
tr_guid(
"B0DC1628-F17C-4951-BC85-55BBECF4D4D1"
);
61
static
const
Guid
p1_guid(
"7D40A2D2-C03C-470C-8F0C-937592D34B5B"
);
62
static
const
Guid
p2_guid(
"E807B07C-8B27-4FF1-A638-05FBCA034C0B"
);
63
static
const
Guid
p3_guid(
"BC1DF3E5-98F5-444D-826A-DFBB85E1C870"
);
64
static
const
Guid
p4_guid(
"554B12C0-AB10-451D-963C-F9714FB29695"
);
65
static
const
Guid
p5_guid(
"64942DEF-C0FE-4CA7-A735-70187092DC27"
);
66
67
if
(
compareClassGuid
(token, p5_guid) ) {
68
69
// using unique_ptr ensures deletion of the persistent object
70
std::unique_ptr<PhotonContainer_p5> persObj(
poolReadObject<PhotonContainer_p5>
(token) );
71
PhotonContainerCnv_p5
cnv;
72
transObj = cnv.
createTransient
( persObj.get(),
msg
);
73
74
}
else
if
(
compareClassGuid
(token, p4_guid) ) {
75
76
// using unique_ptr ensures deletion of the persistent object
77
std::unique_ptr<PhotonContainer_p4> persObj(
poolReadObject<PhotonContainer_p4>
(token) );
78
PhotonContainerCnv_p4
cnv;
79
transObj = cnv.
createTransient
( persObj.get(),
msg
);
80
81
}
else
if
(
compareClassGuid
(token, p3_guid) ) {
82
83
// using unique_ptr ensures deletion of the persistent object
84
std::unique_ptr<PhotonContainer_p3> persObj(
poolReadObject<PhotonContainer_p3>
(token) );
85
PhotonContainerCnv_p3
cnv;
86
transObj = cnv.
createTransient
( persObj.get(),
msg
);
87
88
}
else
if
(
compareClassGuid
(token, p2_guid) ) {
89
90
// using unique_ptr ensures deletion of the persistent object
91
std::unique_ptr<PhotonContainer_p2> persObj(
poolReadObject<PhotonContainer_p2>
(token) );
92
PhotonContainerCnv_p2
cnv;
93
transObj = cnv.
createTransient
( persObj.get(),
msg
);
94
95
}
else
if
(
compareClassGuid
(token, p1_guid) ) {
96
97
// using unique_ptr ensures deletion of the persistent object
98
std::unique_ptr<PhotonContainer_p1> persObj(
poolReadObject<PhotonContainer_p1>
(token) );
99
PhotonContainerCnv_p1
cnv;
100
transObj = cnv.
createTransient
( persObj.get(),
msg
);
101
102
}
else
if
(
compareClassGuid
(token, tr_guid) ) {
103
104
// regular object from before the T/P separation
105
return
poolReadObject<PhotonContainer>
(token);
106
107
}
else
{
108
throw
std::runtime_error(
"Unsupported persistent version of PhotonContainer"
);
109
}
110
111
return
transObj;
112
}
MSG_DEBUG
#define MSG_DEBUG(log, x)
Definition
MsgUtil.h:16
PhotonContainerCnv.h
PhotonContainer_PERS
PhotonContainer_p5 PhotonContainer_PERS
Definition
PhotonContainerCnv.h:34
PhotonContainerCnv_p1.h
PhotonContainerCnv_p1
T_AthenaPoolTPCnvVector< PhotonContainer, PhotonContainer_p1, PhotonCnv_p1 > PhotonContainerCnv_p1
Definition
PhotonContainerCnv_p1.h:33
PhotonContainerCnv_p2.h
PhotonContainerCnv_p2
T_AthenaPoolTPCnvVector< PhotonContainer, PhotonContainer_p2, PhotonCnv_p2 > PhotonContainerCnv_p2
Definition
PhotonContainerCnv_p2.h:31
PhotonContainerCnv_p3.h
PhotonContainerCnv_p3
T_AthenaPoolTPCnvVector< PhotonContainer, PhotonContainer_p3, PhotonCnv_p3 > PhotonContainerCnv_p3
Definition
PhotonContainerCnv_p3.h:31
PhotonContainerCnv_p4.h
PhotonContainerCnv_p4
T_AthenaPoolTPCnvVector< PhotonContainer, PhotonContainer_p4, PhotonCnv_p4 > PhotonContainerCnv_p4
Definition
PhotonContainerCnv_p4.h:31
PhotonContainerCnv_p5.h
PhotonContainerCnv_p5
T_AthenaPoolTPCnvVector< PhotonContainer, PhotonContainer_p5, PhotonCnv_p5 > PhotonContainerCnv_p5
Definition
PhotonContainerCnv_p5.h:31
T_AthenaPoolCustomCnv< PhotonContainer, PhotonContainer_PERS >::msg
MsgStream & msg() const
Definition
AthMessaging.h:167
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition
Guid.h:25
PhotonContainerCnv::createTransient
virtual PhotonContainer * createTransient(const Token *token)
Build the transient representation from a persistent one.
Definition
PhotonContainerCnv.cxx:54
PhotonContainerCnv::createPersistent
virtual PhotonContainer_PERS * createPersistent(PhotonContainer *transCont)
Build the persistent representation from the transient one.
Definition
PhotonContainerCnv.cxx:43
PhotonContainer
Class to define the PhotonContainer.
Definition
Reconstruction/egamma/egammaEvent/egammaEvent/PhotonContainer.h:30
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
T_AthenaPoolCustomCnv< PhotonContainer, PhotonContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< PhotonContainer, PhotonContainer_PERS >::poolReadObject
P * poolReadObject(const Token *token)
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
egammaMsgUtil.h
Generated on
for ATLAS Offline Software by
1.17.0