ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
12// RecAthenaPool includes
14
15
16
24
27{
28 MsgStream msg( msgSvc(), "MuonCaloEnergyContainerCnv" );
29
31 MuonCaloEnergyContainer_PERS *persObj = cnv.createPersistent( transCont, msg );
32
33 msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg;
34 return persObj;
35}
36
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(tlp1_guid) ) {
46
47 // using unique_ptr ensures deletion of the persistent object
48 std::unique_ptr<MuonCaloEnergyContainer_tlp1> persObj( poolReadObject<MuonCaloEnergyContainer_tlp1>() );
50 transObj = cnv.createTransient( persObj.get(), msg );
51 }
52 else if ( compareClassGuid(p1_guid) ) {
53
54 // using unique_ptr ensures deletion of the persistent object
55 std::unique_ptr<MuonCaloEnergyContainer_p1> persObj( poolReadObject<MuonCaloEnergyContainer_p1>() );
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}
#define endmsg
MuonCaloEnergyContainer_p1 MuonCaloEnergyContainer_PERS
T_AthenaPoolTPCnvVectorConst< MuonCaloEnergyContainer, MuonCaloEnergyContainer_p1, CaloEnergyCnv_p2 > MuonCaloEnergyContainerCnv_p1
static void registerStreamerConverter()
Register a streamer converter for backwards compatibility for the vector<DepositInCalo_p1> -> vector<...
virtual MuonCaloEnergyContainer * createTransient()
virtual MuonCaloEnergyContainer_PERS * createPersistent(MuonCaloEnergyContainer *transCont)
MuonCaloEnergyContainerCnv(ISvcLocator *svcloc)
Data object for a StoreGate container holding a vector of CaloEnergy, the detailed energy loss descri...
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
Compatibility for old converter classes that don't get passed the key.
TRANS * createTransient(MsgStream &log)
Create transient representation of the persistent object known to this converter.