ATLAS Offline Software
MissingEtCaloCnv.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 /********************************************************************
6 NAME: MissingEtCaloCnv.h
7 PURPOSE: Implementation file for class MissingEtCaloCnv
8 ********************************************************************/
9 
10 // Framework includes
11 #include "GaudiKernel/MsgStream.h"
12 
13 // RecTPCnv includes
17 
18 // RecAthenaPool includes
19 #include "MissingEtCaloCnv.h"
20 
23 {
24  MsgStream msg( msgSvc(), "MissingEtCaloCnv" );
25 
27  MissingEtCalo_PERS *persObj = cnv.createPersistent( transCont, msg );
28 
29  msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg;
30  return persObj;
31 }
32 
34 {
35  MsgStream msg( msgSvc(), "MissingEtCaloCnv" );
36 
37  MissingEtCalo *transObj = 0;
38 
39  static const pool::Guid tr_guid("BD14D6E7-C771-4079-BF31-F43FE1068C95");
40  static const pool::Guid p1_guid("877E907D-D7E1-49DE-B01F-9CDA344E6004");
41  static const pool::Guid p2_guid("F16ECA98-8809-436C-A00A-06DBBF9C3087");
42  static const pool::Guid p3_guid("0B9C9E87-92C8-49D3-8DF1-45ACDDD3336F");
43 
44  if ( compareClassGuid(tr_guid) ) { // regular object from before the T/P separation
45  return poolReadObject<MissingEtCalo>();
46  }else if ( compareClassGuid(p1_guid) ) {
47  // using unique_ptr ensures deletion of the persistent object
48  std::unique_ptr<MissingEtCalo_p1> persObj( poolReadObject<MissingEtCalo_p1>() );
50  transObj = cnv.createTransient( persObj.get(), msg );
51  }else if ( compareClassGuid(p2_guid) ) {
52  std::unique_ptr<MissingEtCalo_p2> persObj( poolReadObject<MissingEtCalo_p2>() );
54  transObj = cnv.createTransient( persObj.get(), msg );
55  }else if ( compareClassGuid(p3_guid) ) {
56  std::unique_ptr<MissingEtCalo_p3> persObj( poolReadObject<MissingEtCalo_p3>() );
58  transObj = cnv.createTransient( persObj.get(), msg );
59  } else {
60  throw std::runtime_error("Unsupported persistent version of MissingEtCalo");
61  }
62 
63  return transObj;
64 }
MissingEtCaloCnv_p1.h
MissingEtCaloCnv_p3
Definition: MissingEtCaloCnv_p3.h:20
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
MissingEtCalo
Definition: MissingEtCalo.h:27
MissingEtCaloCnv_p2
Definition: MissingEtCaloCnv_p2.h:20
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
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
MissingEtCaloCnv_p1
Definition: MissingEtCaloCnv_p1.h:27
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MissingEtCalo_p3
Definition: MissingEtCalo_p3.h:19
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
MissingEtCaloCnv::createPersistent
virtual MissingEtCalo_PERS * createPersistent(MissingEtCalo *transCont)
Build the persistent representation from the transient one.
Definition: MissingEtCaloCnv.cxx:22
MissingEtCaloCnv::createTransient
virtual MissingEtCalo * createTransient()
Build the transient representation from a persistent one.
Definition: MissingEtCaloCnv.cxx:33
DEBUG
#define DEBUG
Definition: page_access.h:11
MissingEtCaloCnv_p3.h
T_AthenaPoolCustCnv< MissingEtCalo, MissingEtCalo_PERS >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
MissingEtCaloCnv.h
MissingEtCaloCnv_p2.h