ATLAS Offline Software
Loading...
Searching...
No Matches
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
9#include "CoralBase/Blob.h"
10#include "CoralBase/Attribute.h"
11#include "CoralBase/AttributeList.h"
12
14 LArCondFlatBase("LArDSPThresholdsFlat"),
15 m_nChannels(0),
16 m_ptQThr(nullptr),
17 m_psamplesThr(nullptr),
18 m_ptrigSumThr(nullptr)
19
20{}
21
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
37float LArDSPThresholdsFlat::tQThr(const HWIdentifier& CellID) const {
38 return this->tQThrByHash(m_onlineHelper->channel_Hash(CellID));
39}
40
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
50 return this->samplesThrByHash(m_onlineHelper->channel_Hash(CellID));
51}
52
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
62 return this->trigSumThrByHash(m_onlineHelper->channel_Hash(CellID));
63}
64
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
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}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Header file for AthHistogramAlgorithm.
An AttributeList represents a logical row of attributes in a metadata table.
This is a "hash" representation of an Identifier.
LArCondFlatBase(const std::string &name)
const LArOnlineID * m_onlineHelper
StatusCode initializeBase()
void readBlob(const AthenaAttributeList *attr)
float trigSumThrByHash(const IdentifierHash &h) const
float tQThrByHash(const IdentifierHash &h) const
float samplesThrByHash(const IdentifierHash &h) const
float trigSumThr(const HWIdentifier &CellID) const
float samplesThr(const HWIdentifier &CellID) const
float tQThr(const HWIdentifier &CellID) const