ATLAS Offline Software
LArAutoCorrCompleteCnv.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 "LArAutoCorrCompleteCnv.h"
13 
14 static const LArAutoCorrSubsetCnv_p1 TPconverter;
15 
18 {
19  MsgStream log(msgSvc(), "LArAutoCorrCompleteCnv" );
20  //log << MSG::DEBUG << "LArAutoCorrComplete write" << endmsg;
21  LArAutoCorrPersType* persObj = TPconverter.createPersistentConst( transObj, log );
22  //log << MSG::DEBUG << "Success" << endmsg;
23  return persObj;
24 }
25 
28 {
29  static const pool::Guid p1_guid("FA16A69D-241E-40F3-B710-77A95937E394");
30  static const pool::Guid p0_guid("4E7E36E9-2121-4327-88C5-8A516D6D6D2A");
31  if( compareClassGuid(p1_guid) ) {
32  // using unique_ptr ensures deletion of the persistent object
33  std::unique_ptr< LArAutoCorrSubset_p1 > col_vect( poolReadObject< LArAutoCorrSubset_p1 >() );
34  MsgStream log(msgSvc(), "LArAutoCorrCompleteCnv" );
35  //log << MSG::INFO << "Reading LArAutoCorrSubset_p1" << endmsg;
36  return TPconverter.createTransientConst( col_vect.get(), log );
37  }
38  else if( compareClassGuid(p0_guid) ) {
39  // subset from before TP separation
40 
41  MsgStream log(msgSvc(), "LArAutoCorrCompleteCnv" );
42  log << MSG::DEBUG << "Reading LArAutoCorrSubset (original)" << endmsg;
43 
44  std::unique_ptr< LArConditionsSubset<LArAutoCorrP> > subset ( poolReadObject< LArConditionsSubset<LArAutoCorrP> >() );
45  // Here we must convert from LArAutoCorrP to LArAutoCorrP1
46 
47  log << MSG::DEBUG << "subset ptr " << subset.get() << endmsg;
48 
49  return (createTransient(subset.get()));
50 
51  }
52  throw std::runtime_error("Unsupported persistent version of LArAutoCorrCompleteCnv");
53 }
54 
57 {
58 
59  MsgStream log(msgSvc(), "LArAutoCorrCompleteCnv" );
60  log << MSG::DEBUG << "LArAutoCorrCompleteCnv::createTransient orig " << orig << endmsg;
61 
63 
64  // Copy LArAutoCorrP subset to LArAutoCorrP1
65  LArAutoCorrCopy copier;
66  copier.copyOldtoNew(orig, result);
67 
68  return (result);
69 }
70 
71 
72 // Copy LArAutoCorrP subset to LArAutoCorrP1
73 void
76 {
77  newAutoCorr->assign (*oldAutoCorr,
78  [] (const LArAutoCorrP& from,
80  {
81  to.m_vAutoCorr.assign (from.m_vAutoCorr.begin(),
82  from.m_vAutoCorr.end());
83  });
84 }
LArAutoCorrCompleteCnv.h
AthenaPool converter LArAutoCorrComplete.
get_generator_info.result
result
Definition: get_generator_info.py:21
LArAutoCorrP::m_vAutoCorr
std::vector< double > m_vAutoCorr
Definition: LArAutoCorrP.h:30
LArAutoCorrCompleteCnv::createTransient
virtual LArAutoCorrTransType * createTransient()
method to be implemented by the developer.
Definition: LArAutoCorrCompleteCnv.cxx:27
LArAutoCorrP1
c-struct reproducing the structure of the persistent data
Definition: LArAutoCorrP1.h:25
LArAutoCorrCopy
Definition: LArAutoCorrCompleteCnv.h:37
LArAutoCorrCompleteCnv::createPersistent
virtual LArAutoCorrPersType * createPersistent(LArAutoCorrTransType *transObj)
Definition: LArAutoCorrCompleteCnv.cxx:17
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.
LArConditionsSubset
template class for use for I/O of conditions data
Definition: LArConditionsSubset.h:122
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:32
LArAutoCorrP
c-struct reproducing the structure of the persistent data
Definition: LArAutoCorrP.h:25
LArAutoCorrSubsetCnv_p1.h
DEBUG
#define DEBUG
Definition: page_access.h:11
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.
LArConditionsSubset::assign
void assign(const LArConditionsSubset< U > &other, COPIER copier)
Copy from another subset object.
Definition: LArConditionsSubset.h:339
TPConverterConstBase::createTransientConst
virtual TRANS * createTransientConst(const PERS *persObj, MsgStream &log) const