ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaAthenaPool
src
ElectronContainerCnv.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
// ElectronContainerCnv.cxx
8
// Implementation file for class ElectronContainerCnv
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/ElectronContainerCnv_p1.h
"
20
#include "
egammaEventTPCnv/ElectronContainerCnv_p2.h
"
21
#include "
egammaEventTPCnv/ElectronContainerCnv_p3.h
"
22
#include "
egammaEventTPCnv/ElectronContainerCnv_p4.h
"
23
#include "
egammaEventTPCnv/ElectronContainerCnv_p5.h
"
24
25
// RecAthenaPool includes
26
#include "
ElectronContainerCnv.h
"
27
#include "
egammaMsgUtil.h
"
28
32
36
38
// Protected methods:
40
41
42
ElectronContainer_PERS
*
43
ElectronContainerCnv::createPersistent
(
ElectronContainer
* transCont )
44
{
45
MsgStream
msg
( msgSvc(),
"ElectronContainerCnv"
);
46
47
ElectronContainerCnv_p5
cnv;
48
ElectronContainer_PERS
*persObj = cnv.
createPersistent
( transCont,
msg
);
49
50
MSG_DEBUG
(
msg
,
"::createPersistent [Success]"
);
51
return
persObj;
52
}
53
54
ElectronContainer
*
ElectronContainerCnv::createTransient
(
const
Token
* token)
55
{
56
MsgStream
msg
( msgSvc(),
"ElectronContainerCnv"
);
57
58
ElectronContainer
*transObj =
nullptr
;
59
60
static
const
pool::Guid
tr_guid(
"417E86E5-CA20-4F50-A7A2-C91BF44C9125"
);
61
static
const
pool::Guid
p1_guid(
"48355DA8-3BCE-43E0-B29B-51525BCEEDDD"
);
62
static
const
pool::Guid
p2_guid(
"A4377CE2-C0DC-4F80-8CFD-3BBE9A8EFD52"
);
63
static
const
pool::Guid
p3_guid(
"51C149D6-2FBA-4ADD-B6AA-8AE39E07D202"
);
64
static
const
pool::Guid
p4_guid(
"1A7C1F66-D9D2-49E9-80A8-592A0CEE3FDF"
);
65
static
const
pool::Guid
p5_guid(
"A7C69641-E985-4D31-92D4-D33206C197F1"
);
66
67
if
(
compareClassGuid
(token, p5_guid) ) {
68
69
// using unique_ptr ensures deletion of the persistent object
70
std::unique_ptr<ElectronContainer_p5> persObj(
poolReadObject<ElectronContainer_p5>
(token) );
71
ElectronContainerCnv_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<ElectronContainer_p4> persObj(
poolReadObject<ElectronContainer_p4>
(token) );
78
ElectronContainerCnv_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<ElectronContainer_p3> persObj(
poolReadObject<ElectronContainer_p3>
(token) );
85
ElectronContainerCnv_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<ElectronContainer_p2> persObj(
poolReadObject<ElectronContainer_p2>
(token) );
92
ElectronContainerCnv_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<ElectronContainer_p1> persObj(
poolReadObject<ElectronContainer_p1>
(token) );
99
ElectronContainerCnv_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<ElectronContainer>
(token);
106
107
}
else
{
108
throw
std::runtime_error(
"Unsupported persistent version of ElectronContainer"
);
109
}
110
111
return
transObj;
112
}
ElectronContainerCnv.h
ElectronContainer_PERS
ElectronContainer_p5 ElectronContainer_PERS
Definition
ElectronContainerCnv.h:34
ElectronContainerCnv_p1.h
ElectronContainerCnv_p1
T_AthenaPoolTPCnvVector< ElectronContainer, ElectronContainer_p1, ElectronCnv_p1 > ElectronContainerCnv_p1
Definition
ElectronContainerCnv_p1.h:33
ElectronContainerCnv_p2.h
ElectronContainerCnv_p2
T_AthenaPoolTPCnvVector< ElectronContainer, ElectronContainer_p2, ElectronCnv_p2 > ElectronContainerCnv_p2
Definition
ElectronContainerCnv_p2.h:31
ElectronContainerCnv_p3.h
ElectronContainerCnv_p3
T_AthenaPoolTPCnvVector< ElectronContainer, ElectronContainer_p3, ElectronCnv_p3 > ElectronContainerCnv_p3
Definition
ElectronContainerCnv_p3.h:31
ElectronContainerCnv_p4.h
ElectronContainerCnv_p4
T_AthenaPoolTPCnvVector< ElectronContainer, ElectronContainer_p4, ElectronCnv_p4 > ElectronContainerCnv_p4
Definition
ElectronContainerCnv_p4.h:31
ElectronContainerCnv_p5.h
ElectronContainerCnv_p5
T_AthenaPoolTPCnvVector< ElectronContainer, ElectronContainer_p5, ElectronCnv_p5 > ElectronContainerCnv_p5
Definition
ElectronContainerCnv_p5.h:31
MSG_DEBUG
#define MSG_DEBUG(log, x)
Definition
MsgUtil.h:16
T_AthenaPoolCustomCnv< ElectronContainer, ElectronContainer_PERS >::msg
MsgStream & msg() const
Definition
AthMessaging.h:167
ElectronContainerCnv::createPersistent
virtual ElectronContainer_PERS * createPersistent(ElectronContainer *transCont)
Build the persistent representation from the transient one.
Definition
ElectronContainerCnv.cxx:43
ElectronContainerCnv::createTransient
virtual ElectronContainer * createTransient(const Token *token)
Build the transient representation from a persistent one.
Definition
ElectronContainerCnv.cxx:54
ElectronContainer
Class to define the ElectronContainer.
Definition
Reconstruction/egamma/egammaEvent/egammaEvent/ElectronContainer.h:32
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< ElectronContainer, ElectronContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< ElectronContainer, ElectronContainer_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
pool::Guid
::Guid Guid
Definition
T_AthenaPoolCustCnv.h:19
Generated on
for ATLAS Offline Software by
1.17.0