ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCnv
LArCondAthenaPool
src
LArAutoCorrCompleteCnv.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 "
LArAutoCorrCompleteCnv.h
"
12
#include "
LArCondTPCnv/LArAutoCorrSubsetCnv_p1.h
"
13
14
static
const
LArAutoCorrSubsetCnv_p1
TPconverter
;
15
16
LArAutoCorrSubset_p1
*
17
LArAutoCorrCompleteCnv::createPersistent
(
LArAutoCorrTransType
* transObj)
18
{
19
MsgStream log(msgSvc(),
"LArAutoCorrCompleteCnv"
);
20
//log << MSG::DEBUG << "LArAutoCorrComplete write" << endmsg;
21
LArAutoCorrPersType
* persObj =
TPconverter
.createPersistentConst( transObj, log );
22
//log << MSG::DEBUG << "Success" << endmsg;
23
return
persObj;
24
}
25
26
LArConditionsSubset<LArAutoCorrP1>
*
27
LArAutoCorrCompleteCnv::createTransient
(
const
Token
* token)
28
{
29
static
const
pool::Guid
p1_guid(
"FA16A69D-241E-40F3-B710-77A95937E394"
);
30
static
const
pool::Guid
p0_guid(
"4E7E36E9-2121-4327-88C5-8A516D6D6D2A"
);
31
if
(
compareClassGuid
(token, p1_guid) ) {
32
// using unique_ptr ensures deletion of the persistent object
33
std::unique_ptr< LArAutoCorrSubset_p1 > col_vect(
poolReadObject< LArAutoCorrSubset_p1 >
(token) );
34
MsgStream log(msgSvc(),
"LArAutoCorrCompleteCnv"
);
35
//log << MSG::INFO << "Reading LArAutoCorrSubset_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(),
"LArAutoCorrCompleteCnv"
);
42
log << MSG::DEBUG <<
"Reading LArAutoCorrSubset (original)"
<<
endmsg
;
43
44
std::unique_ptr< LArConditionsSubset<LArAutoCorrP> > subset (
poolReadObject
<
LArConditionsSubset<LArAutoCorrP>
>(token) );
45
// Here we must convert from LArAutoCorrP to LArAutoCorrP1
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 LArAutoCorrCompleteCnv"
);
53
}
54
55
LArConditionsSubset<LArAutoCorrP1>
*
56
LArAutoCorrCompleteCnv::createTransient
(
LArConditionsSubset<LArAutoCorrP>
* orig)
57
{
58
59
MsgStream log(msgSvc(),
"LArAutoCorrCompleteCnv"
);
60
log << MSG::DEBUG <<
"LArAutoCorrCompleteCnv::createTransient orig "
<< orig <<
endmsg
;
61
62
LArConditionsSubset<LArAutoCorrP1>
* result =
new
LArConditionsSubset<LArAutoCorrP1>
();
63
64
// Copy LArAutoCorrP subset to LArAutoCorrP1
65
LArAutoCorrCopy
copier;
66
copier.
copyOldtoNew
(orig, result);
67
68
return
(result);
69
}
70
71
72
// Copy LArAutoCorrP subset to LArAutoCorrP1
73
void
74
LArAutoCorrCopy::copyOldtoNew
(
const
LArConditionsSubset<LArAutoCorrP>
* oldAutoCorr,
75
LArConditionsSubset<LArAutoCorrP1>
* newAutoCorr)
76
{
77
newAutoCorr->
assign
(*oldAutoCorr,
78
[] (
const
LArAutoCorrP
& from,
79
LArAutoCorrP1
& to)
80
{
81
to.m_vAutoCorr.assign (from.
m_vAutoCorr
.begin(),
82
from.
m_vAutoCorr
.end());
83
});
84
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
TPconverter
static const LArAutoCorrSubsetCnv_p1 TPconverter
Definition
LArAutoCorrCompleteCnv.cxx:14
LArAutoCorrCompleteCnv.h
AthenaPool converter LArAutoCorrComplete.
LArAutoCorrTransType
LArConditionsSubset< LArAutoCorrP1 > LArAutoCorrTransType
Definition
LArAutoCorrCompleteCnv.h:20
LArAutoCorrPersType
LArAutoCorrSubset_p1 LArAutoCorrPersType
Definition
LArAutoCorrCompleteCnv.h:21
LArAutoCorrSubsetCnv_p1.h
LArAutoCorrCompleteCnv::createTransient
virtual LArAutoCorrTransType * createTransient(const Token *token)
method to be implemented by the developer.
Definition
LArAutoCorrCompleteCnv.cxx:27
LArAutoCorrCompleteCnv::createPersistent
virtual LArAutoCorrPersType * createPersistent(LArAutoCorrTransType *transObj)
method to be implemented by the developer.
Definition
LArAutoCorrCompleteCnv.cxx:17
LArAutoCorrCopy
Definition
LArAutoCorrCompleteCnv.h:37
LArAutoCorrCopy::copyOldtoNew
void copyOldtoNew(const LArConditionsSubset< LArAutoCorrP > *oldAutoCorr, LArConditionsSubset< LArAutoCorrP1 > *newAutoCorr)
Definition
LArAutoCorrCompleteCnv.cxx:74
LArAutoCorrP1
c-struct reproducing the structure of the persistent data
Definition
LArAutoCorrP1.h:25
LArAutoCorrP
c-struct reproducing the structure of the persistent data
Definition
LArAutoCorrP.h:25
LArAutoCorrP::m_vAutoCorr
std::vector< double > m_vAutoCorr
Definition
LArAutoCorrP.h:30
LArAutoCorrSubsetCnv_p1
Definition
LArAutoCorrSubsetCnv_p1.h:20
LArAutoCorrSubset_p1
persistent class container of LArConditionsSubset for LArAutoCorr data.
Definition
LArAutoCorrSubset_p1.h:30
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
T_AthenaPoolCoolMultChanCnv< LArAutoCorrComplete, LArAutoCorrTransType, LArAutoCorrPersType >::poolReadObject
P * poolReadObject(const Token *token)
T_AthenaPoolCoolMultChanCnv< LArAutoCorrComplete, LArAutoCorrTransType, LArAutoCorrPersType >::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