ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCnv
LArCondAthenaPool
src
LArRampCompleteCnv.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 "
LArRampCompleteCnv.h
"
12
#include "
LArCondTPCnv/LArRampSubsetCnv_p1.h
"
13
14
static
const
LArRampSubsetCnv_p1
TPconverter
;
15
16
LArRampSubset_p1
*
17
LArRampCompleteCnv::createPersistent
(
LArRampTransType
* transObj)
18
{
19
MsgStream log(msgSvc(),
"LArRampCompleteCnv"
);
20
//log << MSG::DEBUG << "LArRampComplete write" << endmsg;
21
LArRampPersType
* persObj =
TPconverter
.createPersistentConst( transObj, log );
22
//log << MSG::DEBUG << "Success" << endmsg;
23
return
persObj;
24
}
25
26
LArConditionsSubset<LArRampP1>
*
27
LArRampCompleteCnv::createTransient
(
const
Token
* token)
28
{
29
static
const
pool::Guid
p1_guid(
"BB629283-BDF5-4FA8-93F4-5D8C2F201364"
);
30
static
const
pool::Guid
p0_guid(
"4019776D-D528-4401-9CBD-7956C4B00607"
);
31
if
(
compareClassGuid
(token, p1_guid) ) {
32
// using unique_ptr ensures deletion of the persistent object
33
std::unique_ptr< LArRampSubset_p1 > col_vect(
poolReadObject< LArRampSubset_p1 >
(token) );
34
MsgStream log(msgSvc(),
"LArRampCompleteCnv"
);
35
//log << MSG::INFO << "Reading LArRampSubset_p1" << endmsg;
36
return
TPconverter
.createTransientConst( col_vect.get(), log );
37
}
38
else
if
(
compareClassGuid
(token, p0_guid) ) {
39
// subset from before TP separation
40
41
MsgStream log(msgSvc(),
"LArRampCompleteCnv"
);
42
log << MSG::DEBUG <<
"Reading LArRampSubset (original)"
<<
endmsg
;
43
44
std::unique_ptr< LArConditionsSubset<LArRampP> > subset (
poolReadObject
<
LArConditionsSubset<LArRampP>
>(token) );
45
// Here we must convert from LArRampP to LArRampP1
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 LArRampCompleteCnv"
);
53
}
54
55
LArConditionsSubset<LArRampP1>
*
56
LArRampCompleteCnv::createTransient
(
LArConditionsSubset<LArRampP>
* orig)
57
{
58
59
MsgStream log(msgSvc(),
"LArRampCompleteCnv"
);
60
log << MSG::DEBUG <<
"LArRampCompleteCnv::createTransient orig "
<< orig <<
endmsg
;
61
62
LArConditionsSubset<LArRampP1>
* result =
new
LArConditionsSubset<LArRampP1>
();
63
64
// Copy LArRampP subset to LArRampP1
65
LArRampCopy
copier;
66
copier.
copyOldtoNew
(orig, result);
67
68
return
(result);
69
}
70
71
// Copy LArRampP subset to LArRampP1
72
void
73
LArRampCopy::copyOldtoNew
(
const
LArConditionsSubset<LArRampP>
* oldRamp,
74
LArConditionsSubset<LArRampP1>
* newRamp)
75
{
76
newRamp->
assign
(*oldRamp,
77
[] (
const
LArRampP
& from,
78
LArRampP1
& to)
79
{
80
to.m_vRamp = from.
m_vRamp
;
81
});
82
}
83
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
TPconverter
static const LArAutoCorrSubsetCnv_p1 TPconverter
Definition
LArAutoCorrCompleteCnv.cxx:14
LArConditionsSubset< LArRampP1 >
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current LArConditionsSubset< LArRampP1 >
Definition
LArCondTPCnv.cxx:95
LArRampCompleteCnv.h
AthenaPool converter LArRampComplete.
LArRampPersType
LArRampSubset_p1 LArRampPersType
Definition
LArRampCompleteCnv.h:21
LArRampTransType
LArConditionsSubset< LArRampP1 > LArRampTransType
Definition
LArRampCompleteCnv.h:20
LArRampSubsetCnv_p1.h
LArConditionsSubset
template class for use for I/O of conditions data
Definition
LArConditionsSubset.h:122
LArConditionsSubset::assign
void assign(const LArConditionsSubset< U > &other, COPIER copier)
Copy from another subset object.
Definition
LArConditionsSubset.h:339
LArRampCompleteCnv::createTransient
virtual LArRampTransType * createTransient(const Token *token)
method to be implemented by the developer.
Definition
LArRampCompleteCnv.cxx:27
LArRampCompleteCnv::createPersistent
virtual LArRampPersType * createPersistent(LArRampTransType *transObj)
method to be implemented by the developer.
Definition
LArRampCompleteCnv.cxx:17
LArRampCopy
Definition
LArRampCompleteCnv.h:37
LArRampCopy::copyOldtoNew
void copyOldtoNew(const LArConditionsSubset< LArRampP > *oldRamp, LArConditionsSubset< LArRampP1 > *newRamp)
Definition
LArRampCompleteCnv.cxx:73
LArRampP1
Persistent data for LArRamp Copied from LAr.
Definition
LArRampP1.h:24
LArRampP
Persistent data for LArRamp Copied from LAr.
Definition
LArRampP.h:24
LArRampP::m_vRamp
std::vector< float > m_vRamp
Definition
LArRampP.h:29
LArRampSubsetCnv_p1
Definition
LArRampSubsetCnv_p1.h:20
LArRampSubset_p1
persistent class container of LArConditionsSubset for LArRamp data.
Definition
LArRampSubset_p1.h:30
T_AthenaPoolCoolMultChanCnv< LArRampComplete, LArRampTransType, LArRampPersType >::poolReadObject
P * poolReadObject(const Token *token)
T_AthenaPoolCoolMultChanCnv< LArRampComplete, LArRampTransType, LArRampPersType >::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