ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCnv
LArCondAthenaPool
src
LArOFCCompleteCnv.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 "
LArOFCCompleteCnv.h
"
12
#include "
LArCondTPCnv/LArOFCSubsetCnv_p1.h
"
13
14
static
const
LArOFCSubsetCnv_p1
TPconverter
;
15
16
LArOFCSubset_p1
*
17
LArOFCCompleteCnv::createPersistent
(
LArOFCTransType
* transObj)
18
{
19
MsgStream log(msgSvc(),
"LArOFCCompleteCnv"
);
20
//log << MSG::DEBUG << "LArOFCComplete write" << endmsg;
21
LArOFCPersType
* persObj =
TPconverter
.createPersistentConst( transObj, log );
22
//log << MSG::DEBUG << "Success" << endmsg;
23
return
persObj;
24
}
25
26
LArConditionsSubset<LArOFCP1>
*
27
LArOFCCompleteCnv::createTransient
(
const
Token
* token) {
28
static
const
pool::Guid
p1_guid(
"0A1DE2E2-90E4-4A24-BC6E-2092EDC9FDF6"
);
29
static
const
pool::Guid
p0_guid(
"3E5389EF-D163-4099-91D9-D3F0EE06C1CD"
);
30
31
if
(
compareClassGuid
(token, p1_guid) ) {
32
// using unique_ptr ensures deletion of the persistent object
33
std::unique_ptr< LArOFCSubset_p1 > col_vect(
poolReadObject< LArOFCSubset_p1 >
(token) );
34
MsgStream log(msgSvc(),
"LArOFCCompleteCnv"
);
35
//log << MSG::INFO << "Reading LArOFCSubset_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(),
"LArOFCCompleteCnv"
);
42
log << MSG::DEBUG <<
"Reading LArOFCSubset (original)"
<<
endmsg
;
43
44
std::unique_ptr< LArConditionsSubset<LArOFCP> > subset (
poolReadObject
<
LArConditionsSubset<LArOFCP>
>(token) );
45
// Here we must convert from LArOFCP to LArOFCP1
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 LArOFCCompleteCnv"
);
53
}
54
55
LArConditionsSubset<LArOFCP1>
*
56
LArOFCCompleteCnv::createTransient
(
LArConditionsSubset<LArOFCP>
* orig)
57
{
58
59
MsgStream log(msgSvc(),
"LArOFCCompleteCnv"
);
60
log << MSG::DEBUG <<
"LArOFCCompleteCnv::createTransient orig "
<< orig <<
endmsg
;
61
62
LArConditionsSubset<LArOFCP1>
* result =
new
LArConditionsSubset<LArOFCP1>
();
63
64
// Copy LArOFCP subset to LArOFCP1
65
LArOFCCopy
copier;
66
copier.
copyOldtoNew
(orig, result);
67
68
return
(result);
69
}
70
71
// Copy LArOFCP subset to LArOFCP1
72
void
73
LArOFCCopy::copyOldtoNew
(
const
LArConditionsSubset<LArOFCP>
* oldOFC,
74
LArConditionsSubset<LArOFCP1>
* newOFC)
75
{
76
newOFC->
assign
(*oldOFC,
77
[] (
const
LArOFCP
& from,
78
LArOFCP1
& to)
79
{
80
to =
LArOFCP1
(from.
m_timeOffset
,
81
25./24,
82
from.
m_vOFC_a
,
83
from.
m_vOFC_b
);
84
});
85
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
TPconverter
static const LArAutoCorrSubsetCnv_p1 TPconverter
Definition
LArAutoCorrCompleteCnv.cxx:14
LArConditionsSubset< LArOFCP1 >
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current LArConditionsSubset< LArOFCP1 >
Definition
LArCondTPCnv.cxx:75
LArOFCCompleteCnv.h
AthenaPool converter LArOfcComplete.
LArOFCPersType
LArOFCSubset_p1 LArOFCPersType
Definition
LArOFCCompleteCnv.h:21
LArOFCTransType
LArConditionsSubset< LArOFCP1 > LArOFCTransType
Definition
LArOFCCompleteCnv.h:20
LArOFCSubsetCnv_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
LArOFCCompleteCnv::createTransient
virtual LArOFCTransType * createTransient(const Token *token)
method to be implemented by the developer.
Definition
LArOFCCompleteCnv.cxx:27
LArOFCCompleteCnv::createPersistent
virtual LArOFCPersType * createPersistent(LArOFCTransType *transObj)
method to be implemented by the developer.
Definition
LArOFCCompleteCnv.cxx:17
LArOFCCopy
Definition
LArOFCCompleteCnv.h:37
LArOFCCopy::copyOldtoNew
void copyOldtoNew(const LArConditionsSubset< LArOFCP > *oldOFC, LArConditionsSubset< LArOFCP1 > *newOFC)
Definition
LArOFCCompleteCnv.cxx:73
LArOFCP1
c-struct reproducing the structure of the persistent data
Definition
LArOFCP1.h:22
LArOFCP
c-struct reproducing the structure of the persistent data
Definition
LArOFCP.h:15
LArOFCP::m_vOFC_a
std::vector< std::vector< float > > m_vOFC_a
Definition
LArOFCP.h:22
LArOFCP::m_vOFC_b
std::vector< std::vector< float > > m_vOFC_b
Definition
LArOFCP.h:23
LArOFCP::m_timeOffset
float m_timeOffset
Definition
LArOFCP.h:21
LArOFCSubsetCnv_p1
Definition
LArOFCSubsetCnv_p1.h:20
LArOFCSubset_p1
persistent class container of LArConditionsSubset for LArOFC data.
Definition
LArOFCSubset_p1.h:30
T_AthenaPoolCoolMultChanCnv< LArOFCComplete, LArOFCTransType, LArOFCPersType >::poolReadObject
P * poolReadObject(const Token *token)
T_AthenaPoolCoolMultChanCnv< LArOFCComplete, LArOFCTransType, LArOFCPersType >::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