ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCOOLConditions
src
LArDSPThresholdsFlat.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArCOOLConditions/LArDSPThresholdsFlat.h
"
6
#include "
AthenaPoolUtilities/AthenaAttributeList.h
"
7
#include "
Identifier/IdentifierHash.h
"
8
#include "
LArIdentifier/LArOnlineID.h
"
9
#include "CoralBase/Blob.h"
10
#include "CoralBase/Attribute.h"
11
#include "CoralBase/AttributeList.h"
12
13
LArDSPThresholdsFlat::LArDSPThresholdsFlat
():
14
LArCondFlatBase
(
"LArDSPThresholdsFlat"
),
15
m_nChannels
(0),
16
m_ptQThr
(nullptr),
17
m_psamplesThr
(nullptr),
18
m_ptrigSumThr
(nullptr)
19
20
{}
21
22
LArDSPThresholdsFlat::LArDSPThresholdsFlat
(
const
AthenaAttributeList
* attrList):
23
LArCondFlatBase
(
"LArDSPThresholdsFlat"
),
24
m_nChannels
(0),
25
m_ptQThr
(nullptr),
26
m_psamplesThr
(nullptr),
27
m_ptrigSumThr
(nullptr)
28
{
29
if
(
initializeBase
().isFailure())
return
;
30
readBlob
(attrList);
31
return
;
32
}
33
34
35
36
37
float
LArDSPThresholdsFlat::tQThr
(
const
HWIdentifier
& CellID)
const
{
38
return
this->
tQThrByHash
(
m_onlineHelper
->channel_Hash(CellID));
39
}
40
41
float
LArDSPThresholdsFlat::tQThrByHash
(
const
IdentifierHash
&
h
)
const
{
42
if
(
h
>=
m_nChannels
) {
43
ATH_MSG_ERROR
(
"tQThrByHash: Hash out of range ( "
<<
h
<<
", max="
<<
m_nChannels
<<
")"
);
44
return
0;
45
}
46
return
m_ptQThr
[
h
];
47
}
48
49
float
LArDSPThresholdsFlat::samplesThr
(
const
HWIdentifier
& CellID)
const
{
50
return
this->
samplesThrByHash
(
m_onlineHelper
->channel_Hash(CellID));
51
}
52
53
float
LArDSPThresholdsFlat::samplesThrByHash
(
const
IdentifierHash
&
h
)
const
{
54
if
(
h
>=
m_nChannels
) {
55
ATH_MSG_ERROR
(
"samplesThrByHash: Hash out of range ( "
<<
h
<<
", max="
<<
m_nChannels
<<
")"
);
56
return
0;
57
}
58
return
m_psamplesThr
[
h
];
59
}
60
61
float
LArDSPThresholdsFlat::trigSumThr
(
const
HWIdentifier
& CellID)
const
{
62
return
this->
trigSumThrByHash
(
m_onlineHelper
->channel_Hash(CellID));
63
}
64
65
float
LArDSPThresholdsFlat::trigSumThrByHash
(
const
IdentifierHash
&
h
)
const
{
66
if
(
h
>=
m_nChannels
) {
67
ATH_MSG_ERROR
(
"trigSumThrByHash: Hash out of range ( "
<<
h
<<
", max="
<<
m_nChannels
<<
")"
);
68
return
0;
69
}
70
return
m_ptrigSumThr
[
h
];
71
}
72
73
void
LArDSPThresholdsFlat::readBlob
(
const
AthenaAttributeList
* attrList) {
74
m_nChannels
=0;
75
//m_setName.clear();
76
77
if
(!attrList)
return
;
78
79
//const coral::AttributeList& attr= attrList->coralList();
80
81
//m_setName=attr["Name"].data<std::string>();
82
83
const
coral::Blob& tQThrBlob = (*attrList)[
"tQThr"
].data<coral::Blob>();
84
const
coral::Blob& samplesThrBlob = (*attrList)[
"samplesThr"
].data<coral::Blob>();
85
const
coral::Blob& trigSumThrBlob = (*attrList)[
"trigSumThr"
].data<coral::Blob>();
86
//const coral::Blob *tQThrBlob = new coral::Blob(attr["tQThr"].data<coral::Blob>());
87
//const coral::Blob *samplesThrBlob = new coral::Blob(attr["samplesThr"].data<coral::Blob>());
88
//const coral::Blob *trigSumThrBlob = new coral::Blob(attr["trigSumThr"].data<coral::Blob>());
89
90
if
(!(tQThrBlob.size()==samplesThrBlob.size() && samplesThrBlob.size()==trigSumThrBlob.size())) {
91
ATH_MSG_ERROR
(
"Unequal blob size tQThr/samplesThr/trigSumThr = "
92
<< tQThrBlob.size() <<
"/"
<< samplesThrBlob.size() <<
"/"
<< trigSumThrBlob.size() );
93
return
;
94
}
95
96
m_nChannels
=tQThrBlob.size()/
sizeof
(float);
97
98
99
if
(
m_nChannels
!=
m_onlineHelper
->channelHashMax()) {
100
ATH_MSG_WARNING
(
"Found data for "
<<
m_nChannels
<<
" but expected "
<<
m_onlineHelper
->channelHashMax() );
101
}
102
103
ATH_MSG_DEBUG
(
"Found data for "
<<
m_nChannels
);
104
m_ptQThr
=
static_cast<
const
float
*
>
(tQThrBlob.startingAddress());
105
m_psamplesThr
=
static_cast<
const
float
*
>
(samplesThrBlob.startingAddress());
106
m_ptrigSumThr
=
static_cast<
const
float
*
>
(trigSumThrBlob.startingAddress());
107
108
109
return
;
110
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
AthenaAttributeList.h
IdentifierHash.h
LArDSPThresholdsFlat.h
LArOnlineID.h
h
Header file for AthHistogramAlgorithm.
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table.
Definition
PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:46
HWIdentifier
Definition
HWIdentifier.h:13
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
LArCondFlatBase::LArCondFlatBase
LArCondFlatBase(const std::string &name)
Definition
LArCondFlatBase.cxx:19
LArCondFlatBase::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition
LArCondFlatBase.h:25
LArCondFlatBase::initializeBase
StatusCode initializeBase()
Definition
LArCondFlatBase.cxx:26
LArDSPThresholdsFlat::m_psamplesThr
const float * m_psamplesThr
Definition
LArDSPThresholdsFlat.h:46
LArDSPThresholdsFlat::readBlob
void readBlob(const AthenaAttributeList *attr)
Definition
LArDSPThresholdsFlat.cxx:73
LArDSPThresholdsFlat::trigSumThrByHash
float trigSumThrByHash(const IdentifierHash &h) const
Definition
LArDSPThresholdsFlat.cxx:65
LArDSPThresholdsFlat::tQThrByHash
float tQThrByHash(const IdentifierHash &h) const
Definition
LArDSPThresholdsFlat.cxx:41
LArDSPThresholdsFlat::m_ptrigSumThr
const float * m_ptrigSumThr
Definition
LArDSPThresholdsFlat.h:47
LArDSPThresholdsFlat::samplesThrByHash
float samplesThrByHash(const IdentifierHash &h) const
Definition
LArDSPThresholdsFlat.cxx:53
LArDSPThresholdsFlat::m_ptQThr
const float * m_ptQThr
Definition
LArDSPThresholdsFlat.h:45
LArDSPThresholdsFlat::trigSumThr
float trigSumThr(const HWIdentifier &CellID) const
Definition
LArDSPThresholdsFlat.cxx:61
LArDSPThresholdsFlat::LArDSPThresholdsFlat
LArDSPThresholdsFlat()
Definition
LArDSPThresholdsFlat.cxx:13
LArDSPThresholdsFlat::samplesThr
float samplesThr(const HWIdentifier &CellID) const
Definition
LArDSPThresholdsFlat.cxx:49
LArDSPThresholdsFlat::tQThr
float tQThr(const HWIdentifier &CellID) const
Definition
LArDSPThresholdsFlat.cxx:37
LArDSPThresholdsFlat::m_nChannels
unsigned m_nChannels
Definition
LArDSPThresholdsFlat.h:44
Generated on
for ATLAS Offline Software by
1.17.0