ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCnv
LArCondAthenaPool
src
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
11
#include "
LArRawConditions/LArConditionsSubset.h
"
12
#include "
LArPhysWaveContainerCnv.h
"
13
#include "
LArCondTPCnv/LArPhysWaveSubsetCnv_p1.h
"
14
15
static
const
LArPhysWaveSubsetCnv_p1
TPconverter1
;
16
17
LArPhysWavePersType
*
18
LArPhysWaveContainerCnv::createPersistent
(
LArPhysWaveTransType
* transObj)
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
27
LArConditionsSubset<LArPhysWave>
*
28
LArPhysWaveContainerCnv::createTransient
(
const
Token
* token)
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
(token, p1_guid) ) {
35
// using unique_ptr ensures deletion of the persistent object
36
std::unique_ptr< LArPhysWaveSubset_p1 > col_vect(
poolReadObject< LArPhysWaveSubset_p1 >
(token) );
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
(token, 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>
>(token) );
47
48
return
(
createTransient
(subset.get()));
49
}
50
throw
std::runtime_error(
"Unsupported persistent version of LArPhysWaveCnv"
);
51
}
52
53
54
55
56
LArConditionsSubset<LArPhysWave>
*
57
LArPhysWaveContainerCnv::createTransient
(
LArConditionsSubset<LArPhysWave>
* orig)
58
{
59
60
MsgStream log(msgSvc(),
"LArPedestalCompleteCnv"
);
61
log << MSG::DEBUG <<
"LArPhysWaveContainerCnv::createTransient orig "
<<
endmsg
;
62
63
LArConditionsSubset<LArPhysWave>
* result =
new
LArConditionsSubset<LArPhysWave>
();
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
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
TPconverter1
static const LArCaliWaveSubsetCnv_p1 TPconverter1
Definition
LArCaliWaveContainerCnv.cxx:16
LArConditionsSubset.h
This file defines the template class used for I/O of conditions data.
LArPhysWaveContainerCnv.h
AthenaPool converter LArPhysWaveContainer.
LArPhysWavePersType
LArPhysWaveSubset_p1 LArPhysWavePersType
Definition
LArPhysWaveContainerCnv.h:20
LArPhysWaveTransType
LArConditionsSubset< LArPhysWave > LArPhysWaveTransType
Definition
LArPhysWaveContainerCnv.h:19
LArPhysWaveSubsetCnv_p1.h
LArConditionsSubset
template class for use for I/O of conditions data
Definition
LArConditionsSubset.h:122
LArConditionsSubset::m_subset
SubsetVector m_subset
Definition
LArConditionsSubset.h:258
LArConditionsSubset::m_subsetMap
SubsetMap m_subsetMap
Definition
LArConditionsSubset.h:257
LArConditionsSubset::m_channel
unsigned int m_channel
Definition
LArConditionsSubset.h:260
LArConditionsSubset::m_gain
unsigned int m_gain
Definition
LArConditionsSubset.h:259
LArConditionsSubset::m_correctionVec
CorrectionVec m_correctionVec
Definition
LArConditionsSubset.h:262
LArConditionsSubset::m_groupingType
unsigned int m_groupingType
Definition
LArConditionsSubset.h:261
LArPhysWaveContainerCnv::createPersistent
LArPhysWavePersType * createPersistent(LArPhysWaveTransType *transObj)
method to be implemented by the developer.
Definition
LArPhysWaveContainerCnv.cxx:18
LArPhysWaveContainerCnv::createTransient
LArPhysWaveTransType * createTransient(const Token *token)
method to be implemented by the developer.
Definition
LArPhysWaveContainerCnv.cxx:28
LArPhysWaveSubsetCnv_p1
Definition
LArPhysWaveSubsetCnv_p1.h:20
LArPhysWave
Definition
LArPhysWave.h:14
T_AthenaPoolCoolMultChanCnv< LArPhysWaveContainer, LArPhysWaveTransType, LArPhysWavePersType >::poolReadObject
P * poolReadObject(const Token *token)
T_AthenaPoolCoolMultChanCnv< LArPhysWaveContainer, LArPhysWaveTransType, LArPhysWavePersType >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
pool::Guid
::Guid Guid
Definition
T_AthenaPoolCustCnv.h:19
Generated on
for ATLAS Offline Software by
1.17.0