ATLAS Offline Software
Loading...
Searching...
No Matches
LArDSPThresholdsFlat.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
7#include "CoralBase/Blob.h"
8#include "CoralBase/Attribute.h"
9#include "CoralBase/AttributeList.h"
10
12 LArCondFlatBase("LArDSPThresholdsFlat"),
13 m_nChannels(0),
14 m_ptQThr(nullptr),
15 m_psamplesThr(nullptr),
16 m_ptrigSumThr(nullptr)
17
18{}
19
21 LArCondFlatBase("LArDSPThresholdsFlat"),
22 m_nChannels(0),
23 m_ptQThr(nullptr),
24 m_psamplesThr(nullptr),
25 m_ptrigSumThr(nullptr)
26{
27 if (initializeBase().isFailure()) return;
28 readBlob(attrList);
29 return;
30}
31
32
33
34
35float LArDSPThresholdsFlat::tQThr(const HWIdentifier& CellID) const {
36 return this->tQThrByHash(m_onlineHelper->channel_Hash(CellID));
37}
38
40 if (h>=m_nChannels) {
41 ATH_MSG_ERROR ("tQThrByHash: Hash out of range ( " << h << ", max=" << m_nChannels << ")" );
42 return 0;
43 }
44 return m_ptQThr[h];
45}
46
48 return this->samplesThrByHash(m_onlineHelper->channel_Hash(CellID));
49}
50
52 if (h>=m_nChannels) {
53 ATH_MSG_ERROR( "samplesThrByHash: Hash out of range ( " << h << ", max=" << m_nChannels << ")" );
54 return 0;
55 }
56 return m_psamplesThr[h];
57}
58
60 return this->trigSumThrByHash(m_onlineHelper->channel_Hash(CellID));
61}
62
64 if (h>=m_nChannels) {
65 ATH_MSG_ERROR( "trigSumThrByHash: Hash out of range ( " << h << ", max=" << m_nChannels << ")" );
66 return 0;
67 }
68 return m_ptrigSumThr[h];
69}
70
73 //m_setName.clear();
74
75 if (!attrList) return;
76
77 //const coral::AttributeList& attr= attrList->coralList();
78
79 //m_setName=attr["Name"].data<std::string>();
80
81 const coral::Blob& tQThrBlob = (*attrList)["tQThr"].data<coral::Blob>();
82 const coral::Blob& samplesThrBlob = (*attrList)["samplesThr"].data<coral::Blob>();
83 const coral::Blob& trigSumThrBlob = (*attrList)["trigSumThr"].data<coral::Blob>();
84 //const coral::Blob *tQThrBlob = new coral::Blob(attr["tQThr"].data<coral::Blob>());
85 //const coral::Blob *samplesThrBlob = new coral::Blob(attr["samplesThr"].data<coral::Blob>());
86 //const coral::Blob *trigSumThrBlob = new coral::Blob(attr["trigSumThr"].data<coral::Blob>());
87
88 if (!(tQThrBlob.size()==samplesThrBlob.size() && samplesThrBlob.size()==trigSumThrBlob.size())) {
89 ATH_MSG_ERROR( "Unequal blob size tQThr/samplesThr/trigSumThr = "
90 << tQThrBlob.size() << "/" << samplesThrBlob.size() << "/" << trigSumThrBlob.size() );
91 return;
92 }
93
94 m_nChannels=tQThrBlob.size()/sizeof(float);
95
96
97 if (m_nChannels!=m_onlineHelper->channelHashMax()) {
98 ATH_MSG_WARNING( "Found data for " << m_nChannels << " but expected " << m_onlineHelper->channelHashMax() );
99 }
100
101 ATH_MSG_DEBUG( "Found data for " << m_nChannels );
102 m_ptQThr=static_cast<const float*>(tQThrBlob.startingAddress());
103 m_psamplesThr=static_cast<const float*>(samplesThrBlob.startingAddress());
104 m_ptrigSumThr=static_cast<const float*>(trigSumThrBlob.startingAddress());
105
106
107 return;
108}
#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