ATLAS Offline Software
LArPedestalMCCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #include "LArPedestalMCCnv.h"
14 
15 static const LArPedestalMCCnv_p1 TPconverter;
16 
19 {
20  MsgStream log(msgSvc(), "LArPedestalMCCnv" );
21  //log << MSG::DEBUG << "LArPedestalMC write" << endmsg;
22  LArPedestalMCPersType* persObj = TPconverter.createPersistentConst( transObj, log );
23  //log << MSG::DEBUG << "Success" << endmsg;
24  return persObj;
25 }
26 
29 {
30  static const pool::Guid p1_guid("3891D5E0-82D1-45AB-97B1-CE4CF25D6E16");
31  static const pool::Guid p0_guid("C147EFC8-5283-4DAE-AD20-0E2CB79E54B6");
32  if( compareClassGuid(p1_guid) ) {
33  // using unique_ptr ensures deletion of the persistent object
34  std::unique_ptr< LArPedestalMC_p1 > col_vect( poolReadObject< LArPedestalMC_p1 >() );
35  MsgStream log(msgSvc(), "LArPedestalMCCnv" );
36  //log << MSG::INFO << "Reading LArPedestalMC_p1" << endmsg;
37  return TPconverter.createTransientConst( col_vect.get(), log );
38  }
39  else if( compareClassGuid(p0_guid) ) {
40  // subset from before TP separation
41 
42  MsgStream log(msgSvc(), "LArPedestalMCCnv" );
43  log << MSG::INFO << "Reading LArPedestalMC (original)" << endmsg;
44 
45  LArPedestalMC* peds = poolReadObject< LArPedestalMC >();
46 
47  return (peds);
48 
49  }
50  throw std::runtime_error("Unsupported persistent version of LArPedestalMCCnv");
51 }
52 
53 
54 
LArPedestalMCCnv_p1
Definition: LArPedestalMCCnv_p1.h:19
LArPedestalMC_p1
persistent class container of LArConditionsMC for LArPedestal data.
Definition: LArPedestalMC_p1.h:30
LArPedestalMC
Implementation of the interface ILArfSampl for MC: only one constant is needed for MC.
Definition: LArPedestalMC.h:21
LArPedestalMCCnv_p1.h
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
LArPedestalMC.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TPConverterConstBase::createPersistentConst
virtual PERS * createPersistentConst(const TRANS *transObj, MsgStream &log) const
LArPedestalMCCnv::createPersistent
virtual LArPedestalMCPersType * createPersistent(LArPedestalMCTransType *transObj)
Definition: LArPedestalMCCnv.cxx:18
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
LArPedestalMCCnv::createTransient
virtual LArPedestalMCTransType * createTransient()
Definition: LArPedestalMCCnv.cxx:28
TPConverterConstBase::createTransientConst
virtual TRANS * createTransientConst(const PERS *persObj, MsgStream &log) const
LArPedestalMCCnv.h
AthenaPool converter LArPedestalMC.