ATLAS Offline Software
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 
20  >(svcLocator)
21 {
23 }
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 }
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::MuonCaloEnergyContainerCnv
MuonCaloEnergyContainerCnv(ISvcLocator *svcloc)
Definition: MuonCaloEnergyContainerCnv.cxx:17
TPCnvVectorConst
Definition: TPConverter.h:1271
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
MuonCaloEnergyContainerCnv::createTransient
virtual MuonCaloEnergyContainer * createTransient()
Definition: MuonCaloEnergyContainerCnv.cxx:37
MuonCaloEnergyContainerCnv_tlp1.h
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
TopLevelTPConverter::createTransient
TRANS * createTransient(MsgStream &log)
Create transient representation of the persistent object known to this converter.
Definition: TopLevelTPConverter.h:62
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
MuonCaloEnergyContainerCnv_p1.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonCaloEnergyContainerCnv.h
MuonCaloEnergyContainer_p1
Definition: MuonCaloEnergyContainer_p1.h:22
MuonCaloEnergyContainer
Data object for a StoreGate container holding a vector of CaloEnergy, the detailed energy loss descri...
Definition: MuonCaloEnergyContainer.h:19
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
MuonCaloEnergyContainerCnv_tlp1
Definition: MuonCaloEnergyContainerCnv_tlp1.h:23
DEBUG
#define DEBUG
Definition: page_access.h:11
MuonCaloEnergyContainerCnv::createPersistent
virtual MuonCaloEnergyContainer_PERS * createPersistent(MuonCaloEnergyContainer *transCont)
Definition: MuonCaloEnergyContainerCnv.cxx:26
T_AthenaPoolCustCnv< MuonCaloEnergyContainer, MuonCaloEnergyContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
CaloEnergyCnv_p2.h