ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSpShowerContainerCnv.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// Framework includes
6#include "GaudiKernel/MsgStream.h"
7
8// RecTPCnv includes
10
11// RecAthenaPool includes
13
16{
17 MsgStream msg( msgSvc(), "MuonSpShowerContainerCnv" );
18 // std::cout<<"Test - MuonSpShowerContainerCnv::createPersistent()"<<std::endl;
19
21 MuonSpShowerContainer_PERS *persObj = cnv.createPersistent( transCont, msg );
22
23 msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg;
24 return persObj;
25}
26
29{
30 MsgStream msg( msgSvc(), "MuonSpShowerContainerConverter" );
31 // std::cout<<"Test - MuonSpShowerContainerCnv::createTransient()"<<std::endl;
32 Rec::MuonSpShowerContainer *transObj = 0;
33
34 static const pool::Guid tr_guid("64AE1E07-67EC-549C-DE00-A953259EBC9E");
35 static const pool::Guid p1_guid("522A7143-856B-41E6-A3FA-AB97693010D8");
36
37 if ( compareClassGuid(tr_guid) ) {
38
39 // regular object from before the T/P separation
41
42 } else if ( compareClassGuid(p1_guid) ) {
43
44 // using unique_ptr ensures deletion of the persistent object
45 std::unique_ptr<MuonSpShowerContainer_p1> persObj( poolReadObject<MuonSpShowerContainer_p1>() );
47 transObj = cnv.createTransient( persObj.get(), msg );
48 } else {
49 throw std::runtime_error("Unsupported persistent version of MuonSpShowerContainer");
50 }
51
52 return transObj;
53}
#define endmsg
MuonSpShowerContainer_p1 MuonSpShowerContainer_PERS
virtual Rec::MuonSpShowerContainer * createTransient()
Build the transient representation from a persistent one.
virtual MuonSpShowerContainer_PERS * createPersistent(Rec::MuonSpShowerContainer *transCont)
Build the persistent representation from the transient one.
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.