ATLAS Offline Software
LArMphysOverMcalCompleteCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
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(), "LArMphysOverMcalCompleteCnv" );
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 
37  MsgStream log(msgSvc(), "LArMphysOverMcalCompleteCnv" );
38  log << MSG::DEBUG << "Reading LArMphysOverMcalSubset (original)" << endmsg;
39 
40  std::unique_ptr< LArConditionsSubset<LArMphysOverMcalP> > subset ( poolReadObject< LArConditionsSubset<LArMphysOverMcalP> >() );
41  // Here we must convert from LArMphysOverMcalP to LArMphysOverMcalP1
42 
43  log << MSG::DEBUG << "subset ptr " << subset.get() << endmsg;
44 
45  return (createTransient(subset.get()));
46 
47  }
48  throw std::runtime_error("Unsupported persistent version of LArMphysOverMcalCompleteCnv");
49 }
50 
53 {
54  MsgStream log(msgSvc(), "LArMphysOverMcalCompleteCnv" );
55  log << MSG::DEBUG << "LArMphysOverMcalCompleteCnv::createTransient orig " << orig << endmsg;
56 
58 
59  // Copy LArMphysOverMcalP subset to LArMphysOverMcalP1
60  LArSingleFloatUpdater copier;
61  copier.update(orig, result);
62 
63  return (result);
64 }
LArMphysOverMcalCompleteCnv::createTransient
virtual LArConditionsSubset< LArSingleFloatP > * createTransient()
Throws and exception if object is not a LArConditionsSubset<LArSingleFloatP>
Definition: LArMphysOverMcalCompleteCnv.cxx:19
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
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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
LArMphysOverMcalCompleteCnv.h
AthenaPool converter LArMphysOverMcalComplete.
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