ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecAthenaPool
src
MuonCaloEnergyContainerCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "GaudiKernel/MsgStream.h"
6
7
// RecTPCnv includes
8
#include "
RecTPCnv/MuonCaloEnergyContainerCnv_p1.h
"
9
#include "
RecTPCnv/MuonCaloEnergyContainerCnv_tlp1.h
"
10
#include "
RecTPCnv/CaloEnergyCnv_p2.h
"
11
12
// RecAthenaPool includes
13
#include "
MuonCaloEnergyContainerCnv.h
"
14
15
16
17
MuonCaloEnergyContainerCnv::MuonCaloEnergyContainerCnv
( ISvcLocator* svcLocator ) :
18
T_AthenaPoolCustomCnv
<
MuonCaloEnergyContainer
,
19
MuonCaloEnergyContainer_PERS
20
>(svcLocator)
21
{
22
CaloEnergyCnv_p2::registerStreamerConverter
();
23
}
24
25
MuonCaloEnergyContainer_PERS
*
26
MuonCaloEnergyContainerCnv::createPersistent
(
MuonCaloEnergyContainer
* transCont )
27
{
28
MsgStream
msg
( msgSvc(),
"MuonCaloEnergyContainerCnv"
);
29
30
MuonCaloEnergyContainerCnv_p1
cnv;
31
MuonCaloEnergyContainer_PERS
*persObj = cnv.
createPersistent
( transCont,
msg
);
32
33
msg
<< MSG::DEBUG <<
"::createPersistent [Success]"
<<
endmsg
;
34
return
persObj;
35
}
36
37
MuonCaloEnergyContainer
*
MuonCaloEnergyContainerCnv::createTransient
(
const
Token
* token)
38
{
39
MsgStream
msg
( msgSvc(),
"MuonCaloEnergyContainerConverter"
);
40
MuonCaloEnergyContainer
*transObj = 0;
41
42
static
const
pool::Guid
p1_guid(
"DB3DC5CD-FF0F-01FE-4550-7BCE8DBB9968"
);
43
static
const
pool::Guid
tlp1_guid(
"E60630E0-FAA1-4658-9BDD-8BB977C4200B"
);
44
45
if
(
compareClassGuid
(token, tlp1_guid) ) {
46
47
// using unique_ptr ensures deletion of the persistent object
48
std::unique_ptr<MuonCaloEnergyContainer_tlp1> persObj(
poolReadObject<MuonCaloEnergyContainer_tlp1>
(token) );
49
MuonCaloEnergyContainerCnv_tlp1
cnv;
50
transObj = cnv.
createTransient
( persObj.get(),
msg
);
51
}
52
else
if
(
compareClassGuid
(token, p1_guid) ) {
53
54
// using unique_ptr ensures deletion of the persistent object
55
std::unique_ptr<MuonCaloEnergyContainer_p1> persObj(
poolReadObject<MuonCaloEnergyContainer_p1>
(token) );
56
MuonCaloEnergyContainerCnv_p1
cnv;
57
transObj = cnv.
createTransient
( persObj.get(),
msg
);
58
59
}
else
{
60
throw
std::runtime_error(
"Unsupported persistent version of MuonCaloEnergyContainer"
);
61
}
62
63
return
transObj;
64
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
CaloEnergyCnv_p2.h
MuonCaloEnergyContainerCnv.h
MuonCaloEnergyContainer_PERS
MuonCaloEnergyContainer_p1 MuonCaloEnergyContainer_PERS
Definition
MuonCaloEnergyContainerCnv.h:18
MuonCaloEnergyContainerCnv_p1.h
MuonCaloEnergyContainerCnv_p1
T_AthenaPoolTPCnvVectorConst< MuonCaloEnergyContainer, MuonCaloEnergyContainer_p1, CaloEnergyCnv_p2 > MuonCaloEnergyContainerCnv_p1
Definition
MuonCaloEnergyContainerCnv_p1.h:32
MuonCaloEnergyContainerCnv_tlp1.h
T_AthenaPoolCustomCnv< MuonCaloEnergyContainer, MuonCaloEnergyContainer_PERS >::msg
MsgStream & msg() const
Definition
AthMessaging.h:167
CaloEnergyCnv_p2::registerStreamerConverter
static void registerStreamerConverter()
Register a streamer converter for backwards compatibility for the vector<DepositInCalo_p1> -> vector<...
Definition
CaloEnergyCnv_p2.cxx:110
MuonCaloEnergyContainerCnv_tlp1
Definition
MuonCaloEnergyContainerCnv_tlp1.h:23
MuonCaloEnergyContainerCnv::createPersistent
virtual MuonCaloEnergyContainer_PERS * createPersistent(MuonCaloEnergyContainer *transCont)
Definition
MuonCaloEnergyContainerCnv.cxx:26
MuonCaloEnergyContainerCnv::MuonCaloEnergyContainerCnv
MuonCaloEnergyContainerCnv(ISvcLocator *svcloc)
Definition
MuonCaloEnergyContainerCnv.cxx:17
MuonCaloEnergyContainerCnv::createTransient
virtual MuonCaloEnergyContainer * createTransient(const Token *token)
Definition
MuonCaloEnergyContainerCnv.cxx:37
MuonCaloEnergyContainer
Data object for a StoreGate container holding a vector of CaloEnergy, the detailed energy loss descri...
Definition
MuonCaloEnergyContainer.h:19
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< MuonCaloEnergyContainer, MuonCaloEnergyContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< MuonCaloEnergyContainer, MuonCaloEnergyContainer_PERS >::poolReadObject
P * poolReadObject(const Token *token)
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition
T_AthenaPoolCustomCnv.h:129
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
TopLevelTPConverter::createTransient
TRANS * createTransient(MsgStream &log)
Create transient representation of the persistent object known to this converter.
Definition
TopLevelTPConverter.h:62
pool::Guid
::Guid Guid
Definition
T_AthenaPoolCustCnv.h:19
Generated on
for ATLAS Offline Software by
1.17.0