ATLAS Offline Software
Loading...
Searching...
No Matches
LArDSPConfig.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
7#include "CoralBase/Blob.h"
8
10 : LArCondFlatBase("LArDSPConfig"),
11 m_attrList(nullptr),m_pBlob(nullptr),m_nFebs(0)
12{}
13
15
16
18 : LArCondFlatBase("LArDSPConfig"),
19 m_attrList(attrList),m_pBlob(nullptr),m_nFebs(0)
20{
21 if (initializeBase().isFailure()) return;
22
23 const coral::Blob& myBlob = (*m_attrList)["febdata"].data<coral::Blob>();
24 m_pBlob=static_cast<const uint8_t*>(myBlob.startingAddress());
25 m_nFebs=myBlob.size()/sizeof(uint8_t); //FIXME check if we get the expected value
26 //m_nSamples=m_attr["nSamples"].data<unsigned>();
27}
28
29uint8_t LArDSPConfig::peakSampleByHash(const IdentifierHash& febHash) const {
30 return (m_pBlob[febHash] & PEAKSAMPLE_MASK);
31}
32
34 return ((m_pBlob[febHash] & MGRAMPINTERCEPT_MASK) !=0);
35}
36
38 return ((m_pBlob[febHash] & HGRAMPINTERCEPT_MASK) !=0);
39}
40
42 return ((m_pBlob[febHash] & LGRAMPINTERCEPT_MASK) !=0);
43}
44
46
47 if (this->initializeBase().isFailure()) return;
48
49
50 if (m_onlineHelper) { // Should never actually be null, but avoids a coverity warning.
51 m_nFebs=m_onlineHelper->febHashMax();
52 }
53 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
54 spec->extend("febdata", "blob");
55 spec->extend<unsigned>("version");
56 //spec->extend<unsigned>("nSamples");
57 m_attrListNC=std::unique_ptr<AthenaAttributeList>(new AthenaAttributeList(*spec));
58
59 (*m_attrListNC)["version"].setValue(0U);
60 coral::Blob& myBlob = (*m_attrListNC)["febdata"].data<coral::Blob>();
61 myBlob.resize(m_nFebs*sizeof(uint8_t));
62 m_pBlob_nc=static_cast<uint8_t*>(myBlob.startingAddress());
63 m_pBlob=m_pBlob_nc; //implict cast to const-ptr (for the underlying reading object
64
65 //Initialize the blob to 0
66 for (unsigned i=0;i<m_nFebs;++i)
67 m_pBlob_nc[i]=0;
68
69 // cppcheck-suppress memleak
70 spec = nullptr;
71 return;
72}
73
75 const uint8_t peakSample, const bool useMGRampIntercept) {
76
78 if (useMGRampIntercept) {
80 }
82 return;
83
84}
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 set(const IdentifierHash febId, const uint8_t peakSample, const bool useMGRampIntercept)
uint8_t * m_pBlob_nc
std::unique_ptr< AthenaAttributeList > m_attrListNC
bool useLGRampInterceptByHash(const IdentifierHash &febHash) const
virtual ~LArDSPConfig()
unsigned m_nFebs
uint8_t peakSampleByHash(const IdentifierHash &febHash) const
const uint8_t * m_pBlob
const AthenaAttributeList * m_attrList
bool useMGRampIntercept(const HWIdentifier FEBid) const
bool useHGRampInterceptByHash(const IdentifierHash &febHash) const
bool useMGRampInterceptByHash(const IdentifierHash &febHash) const
uint8_t peakSample(const HWIdentifier FEBid) const