ATLAS Offline Software
LArAutoCorrMCCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 #include "LArAutoCorrMCCnv.h"
13 #include "LArAutoCorrCompleteCnv.h"
14 
15 static const LArAutoCorrSubsetCnv_p1 TPconverter;
16 
19 {
20  MsgStream log(msgSvc(), "LArAutoCorrMCCnv" );
21  //log << MSG::DEBUG << "LArAutoCorrMC write" << endmsg;
22  LArAutoCorrPersType* persObj = TPconverter.createPersistentConst( transObj, log );
23  //log << MSG::DEBUG << "Success" << endmsg;
24  return persObj;
25 }
26 
29 {
30  static const pool::Guid p1_guid("FA16A69D-241E-40F3-B710-77A95937E394");
31  static const pool::Guid p0_guid("4E7E36E9-2121-4327-88C5-8A516D6D6D2A");
32  if( compareClassGuid(p1_guid) ) {
33  // using unique_ptr ensures deletion of the persistent object
34  std::unique_ptr< LArAutoCorrSubset_p1 > col_vect( poolReadObject< LArAutoCorrSubset_p1 >() );
35  MsgStream log(msgSvc(), "LArAutoCorrMCCnv" );
36  //log << MSG::INFO << "Reading LArAutoCorrSubset_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(), "LArAutoCorrMCCnv" );
43  log << MSG::INFO << "Reading LArAutoCorrSubset (original)" << endmsg;
44 
45  std::unique_ptr< LArConditionsSubset<LArAutoCorrP> > subset ( poolReadObject< LArConditionsSubset<LArAutoCorrP> >() );
46  // Here we must convert from LArAutoCorrP to LArAutoCorrP1
47 
48  log << MSG::INFO << "subset ptr " << subset.get() << endmsg;
49 
50  return (createTransient(subset.get()));
51 
52  }
53  throw std::runtime_error("Unsupported persistent version of LArAutoCorrMCCnv");
54 }
55 
58 {
59 
60  MsgStream log(msgSvc(), "LArAutoCorrMCCnv" );
61  log << MSG::INFO << "LArAutoCorrMCCnv::createTransient orig " << orig << endmsg;
62 
64 
65  // Copy LArAutoCorrP subset to LArAutoCorrP1
66  LArAutoCorrCopy copier;
67  copier.copyOldtoNew(orig, result);
68 
69  return (result);
70 }
71 
72 
LArAutoCorrMCCnv.h
AthenaPool converter LArAutoCorrMC.
LArAutoCorrCompleteCnv.h
AthenaPool converter LArAutoCorrComplete.
get_generator_info.result
result
Definition: get_generator_info.py:21
LArAutoCorrCopy
Definition: LArAutoCorrCompleteCnv.h:37
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TPConverterConstBase::createPersistentConst
virtual PERS * createPersistentConst(const TRANS *transObj, MsgStream &log) const
LArAutoCorrSubsetCnv_p1
Definition: LArAutoCorrSubsetCnv_p1.h:20
T_AthenaPoolCoolMultChanCnv::poolReadObject
P * poolReadObject()
Read object of type P.
LArAutoCorrMCCnv::createTransient
virtual LArAutoCorrTransType * createTransient()
method to be implemented by the developer.
Definition: LArAutoCorrMCCnv.cxx:28
LArConditionsSubset
template class for use for I/O of conditions data
Definition: LArConditionsSubset.h:122
LArAutoCorrMCCnv::createPersistent
virtual LArAutoCorrPersType * createPersistent(LArAutoCorrTransType *transObj)
Definition: LArAutoCorrMCCnv.cxx:18
LArAutoCorrSubsetCnv_p1.h
LArAutoCorrSubset_p1
persistent class container of LArConditionsSubset for LArAutoCorr data.
Definition: LArAutoCorrSubset_p1.h:30
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArAutoCorrCopy::copyOldtoNew
void copyOldtoNew(const LArConditionsSubset< LArAutoCorrP > *oldAutoCorr, LArConditionsSubset< LArAutoCorrP1 > *newAutoCorr)
Definition: LArAutoCorrCompleteCnv.cxx:74
T_AthenaPoolCustCnv< COLL_T, ELEM_T >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
TPConverterConstBase::createTransientConst
virtual TRANS * createTransientConst(const PERS *persObj, MsgStream &log) const