ATLAS Offline Software
LArCaliWaveContainerCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
15 
16 static const LArCaliWaveSubsetCnv_p1 TPconverter1;
17 static const LArCaliWaveSubsetCnv_p2 TPconverter2;
18 
21 {
22  MsgStream log(msgSvc(), "LArCaliWaveContainerCnv" );
23  log << MSG::DEBUG << "WRITING LArCaliWaveContainer" << endmsg;
24  LArCaliWavePersType* persObj = TPconverter2.createPersistentConst( transObj, log );
25  log << MSG::DEBUG << "WRITING LArCaliWaveContainer Success !" << endmsg;
26  return persObj;
27 }
28 
31 {
32  MsgStream log(msgSvc(), "LArCaliWaveContainerCnv" );
33 
34  static const pool::Guid p2_guid("6CF01BBF-85A9-45FA-B321-6A98B0D719FB");
35  static const pool::Guid p1_guid("9E61BE2D-3274-4459-A5C2-3BBFB7056EBA");
36  static const pool::Guid p0_guid("ECB4AD6C-FF3A-4255-A0E3-7BD566B96A77");
37 
38  if( compareClassGuid(p2_guid) ) {
39  // using unique_ptr ensures deletion of the persistent object
40  std::unique_ptr< LArCaliWaveSubset_p2 > col_vect( poolReadObject< LArCaliWaveSubset_p2 >() );
41  log << MSG::DEBUG << "READING LArCaliWaveSubset_p2" << endmsg;
42  LArCaliWaveTransType* transObj = TPconverter2.createTransientConst( col_vect.get(), log );
43  log << MSG::DEBUG << "READING LArCaliWaveSubset_p2 Success !" << endmsg;
44  return transObj;
45  }
46  else if( compareClassGuid(p1_guid) ) {
47  // using unique_ptr ensures deletion of the persistent object
48  std::unique_ptr< LArCaliWaveSubset_p1 > col_vect( poolReadObject< LArCaliWaveSubset_p1 >() );
49  log << MSG::DEBUG << "READING LArCaliWaveSubset_p1" << endmsg;
50  LArCaliWaveTransType* transObj = TPconverter1.createTransientConst( col_vect.get(), log );
51  log << MSG::DEBUG << "READING LArCaliWaveSubset_p1 Success !" << endmsg;
52  return transObj;
53  }
54  else if(compareClassGuid(p0_guid)){
55  MsgStream log(msgSvc(), "LArCaliWaveContainerCnv" );
56  log << MSG::DEBUG << " READING LArCaliWaveSubset (before TP split)" << endmsg;
57 
58  std::unique_ptr< LArConditionsSubset<LArCaliWaveVec> > subset ( poolReadObject< LArConditionsSubset<LArCaliWaveVec> >() );
59 
60  return (createTransient(subset.get()));
61  }
62  throw std::runtime_error("Unsupported persistent version of LArCaliWaveCnv");
63 }
64 
65 
66 
67 
70 {
71 
72  MsgStream log(msgSvc(), "LArPedestalCompleteCnv" );
73  log << MSG::DEBUG << "LArCaliWaveContainerCnv::createTransient orig " << orig << endmsg;
74 
76  result->assign (*orig,
77  [] (const LArCaliWaveVec& from,
79  { to = from; });
80 
81  return (result);
82 }
get_generator_info.result
result
Definition: get_generator_info.py:21
LArCaliWaveSubsetCnv_p2
Definition: LArCaliWaveSubsetCnv_p2.h:19
LArCaliWaveContainerCnv::createPersistent
LArCaliWavePersType * createPersistent(LArCaliWaveTransType *transObj)
Definition: LArCaliWaveContainerCnv.cxx:20
LArCaliWaveSubsetCnv_p1
Definition: LArCaliWaveSubsetCnv_p1.h:20
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
LArCaliWaveSubsetCnv_p2.h
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LArCaliWaveVec
Definition: LArCaliWave.h:91
TPConverterConstBase::createPersistentConst
virtual PERS * createPersistentConst(const TRANS *transObj, MsgStream &log) const
LArCaliWaveContainerCnv.h
AthenaPool converter LArCaliWaveContainer.
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
LArConditionsSubset.h
This file defines the template class used for I/O of conditions data.
LArCaliWaveSubsetCnv_p1.h
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:39
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArConditionsSubset< LArCaliWaveVec >
LArConditionsSubset< LArCaliWaveVec >
Definition: LArCondTPCnv.cxx:45
LArCaliWaveSubset_p2
persistent class container of LArCaliWave data.
Definition: LArCaliWaveSubset_p2.h:28
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.
LArCaliWaveContainerCnv::createTransient
LArCaliWaveTransType * createTransient()
method to be implemented by the developer.
Definition: LArCaliWaveContainerCnv.cxx:30
TPConverterConstBase::createTransientConst
virtual TRANS * createTransientConst(const PERS *persObj, MsgStream &log) const