ATLAS Offline Software
Loading...
Searching...
No Matches
LArPhysWaveContainerCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
10
14
16
19{
20 MsgStream log(msgSvc(), "LArPhysWaveContainerCnv" );
21 log << MSG::DEBUG << "WRITING LArPhysWaveContainer" << endmsg;
22 LArPhysWavePersType* persObj = TPconverter1.createPersistentConst( transObj, log );
23 log << MSG::DEBUG << "WRITING LArPhysWaveContainer Success !" << endmsg;
24 return persObj;
25}
26
29{
30 MsgStream log(msgSvc(), "LArPhysWaveContainerCnv" );
31 log<<MSG::DEBUG<<"READING PHYS WAVE"<<endmsg;
32 static const pool::Guid p1_guid("87E436E2-6FF4-42D3-BC70-6650C076E589");
33 static const pool::Guid p0_guid("C1108D27-6D30-41E8-892D-2AB127B868C9");
34 if( compareClassGuid(p1_guid) ) {
35 // using unique_ptr ensures deletion of the persistent object
36 std::unique_ptr< LArPhysWaveSubset_p1 > col_vect( poolReadObject< LArPhysWaveSubset_p1 >() );
37 log << MSG::DEBUG << "READING LArPhysWaveSubset_p1" << endmsg;
38 LArPhysWaveTransType* transObj = TPconverter1.createTransientConst( col_vect.get(), log );
39 log << MSG::DEBUG << "READING LArPhysWaveSubset_p1 Success !" << endmsg;
40 return transObj;
41 }
42 else if(compareClassGuid(p0_guid)){
43 MsgStream log(msgSvc(), "LArPhysWaveContainerCnv" );
44 log << MSG::DEBUG << " READING LArPhysWaveSubset (before TP split)" << endmsg;
45
46 std::unique_ptr< LArConditionsSubset<LArPhysWave> > subset ( poolReadObject< LArConditionsSubset<LArPhysWave> >() );
47
48 return (createTransient(subset.get()));
49 }
50 throw std::runtime_error("Unsupported persistent version of LArPhysWaveCnv");
51}
52
53
54
55
58{
59
60 MsgStream log(msgSvc(), "LArPedestalCompleteCnv" );
61 log << MSG::DEBUG << "LArPhysWaveContainerCnv::createTransient orig " << endmsg;
62
64
65 // Copy from orig to result
66
67 result->assign (*orig,
68 [] (const LArPhysWave& from,
69 LArPhysWave& to)
70 { to = from; });
71#if 0
72 result->m_gain = orig->m_gain;
73 result->m_channel = orig->m_channel;
74 result->m_groupingType = orig->m_groupingType;
75
76
77 for (unsigned int w=0;w<orig->m_subset.size();++w){ // copy of subset
78 std::vector<LArPhysWave> ochvec;
79 for (unsigned int q=0;q<orig->m_subset[w].second.size();++q){
80 ochvec.push_back(orig->m_subset[w].second[q]);
81 }
82 unsigned int ofebid=orig->m_subset[w].first;
83 std::pair<unsigned int, std::vector<LArPhysWave> > opair(ofebid,ochvec);
84 result->m_subset.push_back(opair);
85 }
86
87
88 for(unsigned int w=0;w<orig->m_correctionVec.size();++w){ // copy of correctionVec
89 LArPhysWave ovec=orig->m_correctionVec[w].second;
90 unsigned int ofebid=orig->m_correctionVec[w].first;
91 std::pair<unsigned int, LArPhysWave> opair(ofebid, ovec);
92 result->m_correctionVec.push_back(opair);
93 }
94
95 result->m_subsetMap.swap(orig->m_subsetMap); // copy of subsetMap (what's this?)
96#endif
97
98 log << MSG::DEBUG <<"No T/P split copy ok."<<endmsg;
99
100 return (result);
101}
#define endmsg
static const LArCaliWaveSubsetCnv_p1 TPconverter1
This file defines the template class used for I/O of conditions data.
AthenaPool converter LArPhysWaveContainer.
LArPhysWaveSubset_p1 LArPhysWavePersType
LArConditionsSubset< LArPhysWave > LArPhysWaveTransType
template class for use for I/O of conditions data
LArPhysWaveTransType * createTransient()
method to be implemented by the developer.
LArPhysWavePersType * createPersistent(LArPhysWaveTransType *transObj)
method to be implemented by the developer.