ATLAS Offline Software
LArMphysOverMcalMCCnv.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 "LArMphysOverMcalMCCnv.h"
14 #include "LArSingleFloatUpdater.h"
15 
16 static const LArMphysOverMcalSubsetCnv_p1 TPconverter;
17 
20 {
21  static const pool::Guid p0_guid("9C53AC43-3FD6-470F-A6FF-1DF80E85ACBF");
22  static const pool::Guid p1_guid("60FB956A-0B7F-450E-BF6A-2A0B8ED55204");
23  // first try the single-float converter
25  if (p)
26  return p;
27  else if( compareClassGuid(p1_guid) ) {
28  // using unique_ptr ensures deletion of the persistent object
29  std::unique_ptr< LArMphysOverMcalSubset_p1 > col_vect( poolReadObject< LArMphysOverMcalSubset_p1 >() );
30  MsgStream log(msgSvc(), "LArMphysOverMcalMCCnv" );
31  //log << MSG::INFO << "Reading LArMphysOverMcalSubset_p1" << endmsg;
32  return TPconverter.createTransientConst( col_vect.get(), log );
33  }
34  else if( compareClassGuid(p0_guid) ) {
35  // subset from before TP separation
36  MsgStream log(msgSvc(), "LArMphysOverMcalMCCnv" );
37  log << MSG::DEBUG << "Reading LArMphysOverMcalSubset (original)" << endmsg;
38 
39  std::unique_ptr< LArConditionsSubset<LArMphysOverMcalP> > subset ( poolReadObject< LArConditionsSubset<LArMphysOverMcalP> >() );
40  // Here we must convert from LArMphysOverMcalP to LArMphysOverMcalP1
41  return (createTransient(subset.get()));
42 
43  }
44  throw std::runtime_error("Unsupported persistent version of LArMphysOverMcalMCCnv");
45 }
46 
49  MsgStream log(msgSvc(), "LArMphysOverMcalMCCnv" );
50  log << MSG::DEBUG << "LArMphysOverMcalMCCnv::createTransient orig " << orig << endmsg;
51 
53  LArSingleFloatUpdater copier;
54  copier.update(orig, result);
55 
56  return (result);
57 }
get_generator_info.result
result
Definition: get_generator_info.py:21
LArSingleFloatUpdater::update
void update(const LArConditionsSubset< P > *old, LArConditionsSubset< LArSingleFloatP > *newObj)
Definition: LArSingleFloatUpdater.h:22
LArSingleFloatUpdater
Definition: LArSingleFloatUpdater.h:19
LArMphysOverMcalMCCnv.h
AthenaPool converter LArMphysOverMcalMC.
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
LArMphysOverMcalMCCnv::createTransient
virtual LArConditionsSubset< LArSingleFloatP > * createTransient()
Throws and exception if object is not a LArConditionsSubset<LArSingleFloatP>
Definition: LArMphysOverMcalMCCnv.cxx:19
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LArMphysOverMcalSubsetCnv_p1
Definition: LArMphysOverMcalSubsetCnv_p1.h:22
T_AthenaPoolCoolMultChanCnv< TransientClass, LArConditionsSubset< LArSingleFloatP >, LArSingleFloatSubset_p1 >::poolReadObject
P * poolReadObject()
Read object of type P.
LArConditionsSubset
template class for use for I/O of conditions data
Definition: LArConditionsSubset.h:122
LArSingleFloatUpdater.h
LArMphysOverMcalSubsetCnv_p1.h
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArSingleFloatConverter::createTransientSingleFloat
LArConditionsSubset< LArSingleFloatP > * createTransientSingleFloat()
returns NULL if object is not a LArConditionsSubset<LArSingleFloatP>
Definition: LArSingleFloatConverter.h:52
T_AthenaPoolCustCnv< TransientClass, LArConditionsSubset< LArSingleFloatP > >::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