ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCnv
LArCondAthenaPool
src
LArShape32MCCnv.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 "
LArShape32MCCnv.h
"
12
#include "
LArCondTPCnv/LArShapeSubsetCnv_p1.h
"
13
#include "
LArShapeCompleteCnv.h
"
14
#include <cmath>
15
#include <limits>
16
17
static
const
LArShapeSubsetCnv_p1
TPconverter
;
18
19
#if 0
20
namespace
{
21
23
inline
24
float
toFloat (
double
x
)
25
{
26
if
(std::abs (
x
) > std::numeric_limits<float>::max()) {
27
if
(
x
> 0)
28
return
std::numeric_limits<float>::max();
29
else
30
return
- std::numeric_limits<float>::max();
31
}
32
return
x
;
33
}
34
35
}
// anonymous namespace
36
#endif
37
38
LArShapeSubset_p1
*
39
LArShape32MCCnv::createPersistent
(
LArShapeTransType
* transObj)
40
{
41
MsgStream log(msgSvc(),
"LArShape32MCCnv"
);
42
//log << MSG::DEBUG << "LArShape32MC write" << endmsg;
43
LArShapePersType
* persObj =
TPconverter
.createPersistentConst( transObj, log );
44
//log << MSG::DEBUG << "Success" << endmsg;
45
return
persObj;
46
}
47
48
LArConditionsSubset<LArShapeP1>
*
49
LArShape32MCCnv::createTransient
(
const
Token
* token)
50
{
51
static
const
pool::Guid
p1_guid(
"95B61750-4C45-412D-B4D4-9758E9DB40D1"
);
52
static
const
pool::Guid
p0_guid(
"055CF2F5-08D0-4EAA-B154-8CE5B1A599E7"
);
53
MsgStream log(msgSvc(),
"LArShape32MCCnv"
);
54
if
(
compareClassGuid
(token, p1_guid) ) {
55
// using unique_ptr ensures deletion of the persistent object
56
std::unique_ptr< LArShapeSubset_p1 > col_vect(
poolReadObject< LArShapeSubset_p1 >
(token) );
57
//
58
log << MSG::DEBUG <<
"Reading LArShapeSubset_p1"
<<
endmsg
;
59
return
TPconverter
.createTransientConst( col_vect.get(), log );
60
}
61
else
if
(
compareClassGuid
(token, p0_guid) ) {
62
// subset from before TP separation
63
log << MSG::DEBUG <<
"Reading LArShapeSubset (original)"
<<
endmsg
;
64
65
std::unique_ptr< LArConditionsSubset<LArShapeP> > subset (
poolReadObject
<
LArConditionsSubset<LArShapeP>
>(token) );
66
// Here we must convert from LArShapeP to LArShapeP1
67
68
log << MSG::VERBOSE <<
"subset ptr "
<< subset.get() <<
endmsg
;
69
70
return
(
createTransient
(subset.get()));
71
72
}
73
throw
std::runtime_error(
"Unsupported persistent version of LArShape32MCCnv"
);
74
}
75
76
LArConditionsSubset<LArShapeP1>
*
77
LArShape32MCCnv::createTransient
(
LArConditionsSubset<LArShapeP>
* orig)
78
{
79
80
//MsgStream log(msgSvc(), "LArShapeMCCnv" );
81
//log << MSG::DEBUG << "LArShapeMCCnv::createTransient orig " << orig << endmsg;
82
83
LArConditionsSubset<LArShapeP1>
* result =
new
LArConditionsSubset<LArShapeP1>
();
84
85
// Copy LArShapeP subset to LArShapeP1
86
LArShapeCopy
copier;
87
copier.
copyOldtoNew
(orig, result);
88
89
return
(result);
90
}
91
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
TPconverter
static const LArAutoCorrSubsetCnv_p1 TPconverter
Definition
LArAutoCorrCompleteCnv.cxx:14
LArShape32MCCnv.h
AthenaPool converter LArShape32MC.
LArShapePersType
LArShapeSubset_p1 LArShapePersType
Definition
LArShape32MCCnv.h:21
LArShapeTransType
LArConditionsSubset< LArShapeP1 > LArShapeTransType
Definition
LArShape32MCCnv.h:20
LArShapeCompleteCnv.h
AthenaPool converter LArShapeComplete.
LArShapeSubsetCnv_p1.h
x
#define x
LArConditionsSubset
template class for use for I/O of conditions data
Definition
LArConditionsSubset.h:122
LArShape32MCCnv::createPersistent
virtual LArShapePersType * createPersistent(LArShapeTransType *transObj)
method to be implemented by the developer.
Definition
LArShape32MCCnv.cxx:39
LArShape32MCCnv::createTransient
virtual LArShapeTransType * createTransient(const Token *token)
method to be implemented by the developer.
Definition
LArShape32MCCnv.cxx:49
LArShapeCopy
Definition
LArShapeCompleteCnv.h:40
LArShapeCopy::copyOldtoNew
void copyOldtoNew(const LArConditionsSubset< LArShapeP > *oldShape, LArConditionsSubset< LArShapeP1 > *newShape)
Definition
LArShapeCompleteCnv.cxx:85
LArShapeSubsetCnv_p1
Definition
LArShapeSubsetCnv_p1.h:20
LArShapeSubset_p1
persistent class container of LArConditionsSubset for LArShape data.
Definition
LArShapeSubset_p1.h:30
T_AthenaPoolCoolMultChanCnv< LArShape32MC, LArShapeTransType, LArShapePersType >::poolReadObject
P * poolReadObject(const Token *token)
T_AthenaPoolCoolMultChanCnv< LArShape32MC, LArShapeTransType, LArShapePersType >::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