ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaAthenaPool
src
egDetailContainerCnv.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// egDetailContainerCnv.cxx
8
// Implementation file for class egDetailContainerCnv
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/egDetailContainerCnv_p1.h
"
20
#include "
egammaEventTPCnv/egDetailContainerCnv_p2.h
"
21
22
// RecAthenaPool includes
23
#include "
egDetailContainerCnv.h
"
24
#include "
egammaMsgUtil.h
"
25
29
33
35
// Protected methods:
37
38
39
egDetailContainer_PERS
*
40
egDetailContainerCnv::createPersistent
(
egDetailContainer
* transCont )
41
{
42
MsgStream
msg
( msgSvc(),
"egDetailContainerCnv"
);
43
44
egDetailContainerCnv_p2
cnv;
45
egDetailContainer_PERS
*persObj = cnv.
createPersistent
( transCont,
msg
);
46
47
MSG_DEBUG
(
msg
,
"::createPersistent [Success]"
);
48
return
persObj;
49
}
50
51
egDetailContainer
*
egDetailContainerCnv::createTransient
(
const
Token
* token)
52
{
53
MsgStream
msg
( msgSvc(),
"egDetailContainerCnv"
);
54
55
egDetailContainer
*transObj =
nullptr
;
56
57
static
const
pool::Guid
tr_guid(
"F8C02E11-E6C5-4843-A57D-3DB2EFACCC5B"
);
58
static
const
pool::Guid
p1_guid(
"C3E26ADE-A984-41AC-83DF-F430F6DF1F1F"
);
59
static
const
pool::Guid
p2_guid(
"6AB9ADFD-836F-416D-B343-3DDF7D4F6E18"
);
60
61
if
(
compareClassGuid
(token, tr_guid) ) {
62
63
// regular object from before the T/P separation
64
return
poolReadObject<egDetailContainer>
(token);
65
66
}
if
(
compareClassGuid
(token, p1_guid) ) {
67
68
// using unique_ptr ensures deletion of the persistent object
69
std::unique_ptr<egDetailContainer_p1> persObj(
poolReadObject<egDetailContainer_p1>
(token) );
70
egDetailContainerCnv_p1
cnv;
71
transObj = cnv.
createTransient
( persObj.get(),
msg
);
72
}
else
if
(
compareClassGuid
(token, p2_guid) ) {
73
74
// using unique_ptr ensures deletion of the persistent object
75
std::unique_ptr<egDetailContainer_p2> persObj(
poolReadObject<egDetailContainer_p2>
(token) );
76
egDetailContainerCnv_p2
cnv;
77
transObj = cnv.
createTransient
( persObj.get(),
msg
);
78
}
else
{
79
throw
std::runtime_error(
"Unsupported persistent version of egDetailContainer"
);
80
}
81
82
return
transObj;
83
}
84
MSG_DEBUG
#define MSG_DEBUG(log, x)
Definition
MsgUtil.h:16
T_AthenaPoolCustomCnv< egDetailContainer, egDetailContainer_PERS >::msg
MsgStream & msg() const
Definition
AthMessaging.h:167
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< egDetailContainer, egDetailContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< egDetailContainer, egDetailContainer_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
egDetailContainerCnv_p1
Definition
egDetailContainerCnv_p1.h:31
egDetailContainerCnv_p2
Definition
egDetailContainerCnv_p2.h:29
egDetailContainerCnv::createTransient
virtual egDetailContainer * createTransient(const Token *token)
Build the transient representation from a persistent one.
Definition
egDetailContainerCnv.cxx:51
egDetailContainerCnv::createPersistent
virtual egDetailContainer_PERS * createPersistent(egDetailContainer *transCont)
Build the persistent representation from the transient one.
Definition
egDetailContainerCnv.cxx:40
egDetailContainer
Container for detailed egamma information.
Definition
egDetailContainer.h:18
egDetailContainerCnv.h
egDetailContainer_PERS
egDetailContainer_p2 egDetailContainer_PERS
Definition
egDetailContainerCnv.h:31
egDetailContainerCnv_p1.h
egDetailContainerCnv_p2.h
egammaMsgUtil.h
pool::Guid
::Guid Guid
Definition
T_AthenaPoolCustCnv.h:19
Generated on
for ATLAS Offline Software by
1.17.0