ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCnv
LArCondAthenaPool
src
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
10
11
#include "
LArRawConditions/LArConditionsSubset.h
"
12
#include "
LArCaliWaveContainerCnv.h
"
13
#include "
LArCondTPCnv/LArCaliWaveSubsetCnv_p1.h
"
14
#include "
LArCondTPCnv/LArCaliWaveSubsetCnv_p2.h
"
15
16
static
const
LArCaliWaveSubsetCnv_p1
TPconverter1
;
17
static
const
LArCaliWaveSubsetCnv_p2
TPconverter2
;
18
19
LArCaliWavePersType
*
20
LArCaliWaveContainerCnv::createPersistent
(
LArCaliWaveTransType
* transObj)
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
29
LArConditionsSubset<LArCaliWaveVec>
*
30
LArCaliWaveContainerCnv::createTransient
(
const
Token
* token)
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
(token, p2_guid) ) {
39
// using unique_ptr ensures deletion of the persistent object
40
std::unique_ptr< LArCaliWaveSubset_p2 > col_vect(
poolReadObject< LArCaliWaveSubset_p2 >
(token) );
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
(token, p1_guid) ) {
47
// using unique_ptr ensures deletion of the persistent object
48
std::unique_ptr< LArCaliWaveSubset_p1 > col_vect(
poolReadObject< LArCaliWaveSubset_p1 >
(token) );
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
(token, 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>
>(token) );
59
60
return
(
createTransient
(subset.get()));
61
}
62
throw
std::runtime_error(
"Unsupported persistent version of LArCaliWaveCnv"
);
63
}
64
65
66
67
68
LArConditionsSubset<LArCaliWaveVec>
*
69
LArCaliWaveContainerCnv::createTransient
(
LArConditionsSubset<LArCaliWaveVec>
* orig)
70
{
71
72
MsgStream log(msgSvc(),
"LArPedestalCompleteCnv"
);
73
log << MSG::DEBUG <<
"LArCaliWaveContainerCnv::createTransient orig "
<< orig <<
endmsg
;
74
75
LArConditionsSubset<LArCaliWaveVec>
* result =
new
LArConditionsSubset<LArCaliWaveVec>
();
76
result->assign (*orig,
77
[] (
const
LArCaliWaveVec
& from,
78
LArCaliWaveVec
& to)
79
{ to = from; });
80
81
return
(result);
82
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
TPconverter2
static const LArCaliWaveSubsetCnv_p2 TPconverter2
Definition
LArCaliWaveContainerCnv.cxx:17
TPconverter1
static const LArCaliWaveSubsetCnv_p1 TPconverter1
Definition
LArCaliWaveContainerCnv.cxx:16
LArCaliWaveContainerCnv.h
AthenaPool converter LArCaliWaveContainer.
LArCaliWavePersType
LArCaliWaveSubset_p2 LArCaliWavePersType
Definition
LArCaliWaveContainerCnv.h:21
LArCaliWaveTransType
LArConditionsSubset< LArCaliWaveVec > LArCaliWaveTransType
Definition
LArCaliWaveContainerCnv.h:20
LArCaliWaveSubsetCnv_p1.h
LArCaliWaveSubsetCnv_p2.h
LArConditionsSubset< LArCaliWaveVec >
LArConditionsSubset< LArCaliWaveVec >
Definition
LArCondTPCnv.cxx:45
LArConditionsSubset.h
This file defines the template class used for I/O of conditions data.
LArCaliWaveContainerCnv::createTransient
LArCaliWaveTransType * createTransient(const Token *token)
method to be implemented by the developer.
Definition
LArCaliWaveContainerCnv.cxx:30
LArCaliWaveContainerCnv::createPersistent
LArCaliWavePersType * createPersistent(LArCaliWaveTransType *transObj)
method to be implemented by the developer.
Definition
LArCaliWaveContainerCnv.cxx:20
LArCaliWaveSubsetCnv_p1
Definition
LArCaliWaveSubsetCnv_p1.h:20
LArCaliWaveSubsetCnv_p2
Definition
LArCaliWaveSubsetCnv_p2.h:19
LArCaliWaveVec
Definition
LArCaliWave.h:91
LArConditionsSubset
template class for use for I/O of conditions data
Definition
LArConditionsSubset.h:122
T_AthenaPoolCoolMultChanCnv< LArCaliWaveContainer, LArCaliWaveTransType, LArCaliWavePersType >::poolReadObject
P * poolReadObject(const Token *token)
T_AthenaPoolCoolMultChanCnv< LArCaliWaveContainer, LArCaliWaveTransType, LArCaliWavePersType >::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