ATLAS Offline Software
LArDSPConfig.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 
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 
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 
45 LArDSPConfigWrite::LArDSPConfigWrite() : m_pBlob_nc(nullptr) {
46 
47  if (this->initializeBase().isFailure()) return;
48 
49 
51  coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
52  spec->extend("febdata", "blob");
53  spec->extend<unsigned>("version");
54  //spec->extend<unsigned>("nSamples");
55  m_attrListNC=std::unique_ptr<AthenaAttributeList>(new AthenaAttributeList(*spec));
56 
57  (*m_attrListNC)["version"].setValue(0U);
58  coral::Blob& myBlob = (*m_attrListNC)["febdata"].data<coral::Blob>();
59  myBlob.resize(m_nFebs*sizeof(uint8_t));
60  m_pBlob_nc=static_cast<uint8_t*>(myBlob.startingAddress());
61  m_pBlob=m_pBlob_nc; //implict cast to const-ptr (for the underlying reading object
62 
63  //Initialize the blob to 0
64  for (unsigned i=0;i<m_nFebs;++i)
65  m_pBlob_nc[i]=0;
66 
67  // cppcheck-suppress memleak
68  spec = nullptr;
69  return;
70 }
71 
73  const uint8_t peakSample, const bool useMGRampIntercept) {
74 
76  if (useMGRampIntercept) {
78  }
80  return;
81 
82 }
LArDSPConfig::useLGRampInterceptByHash
bool useLGRampInterceptByHash(const IdentifierHash &febHash) const
Definition: LArDSPConfig.cxx:41
LArDSPConfig::useHGRampInterceptByHash
bool useHGRampInterceptByHash(const IdentifierHash &febHash) const
Definition: LArDSPConfig.cxx:37
LArDSPConfigWrite::m_attrListNC
std::unique_ptr< AthenaAttributeList > m_attrListNC
Definition: LArDSPConfig.h:84
LArDSPConfig::LArDSPConfig
LArDSPConfig()
Definition: LArDSPConfig.cxx:9
LArDSPConfig::useMGRampIntercept
bool useMGRampIntercept(const HWIdentifier FEBid) const
Definition: LArDSPConfig.h:44
LArOnlineID_Base::febHashMax
size_type febHashMax(void) const
define feb hash tables max size
Definition: LArOnlineID_Base.cxx:1892
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
LArDSPConfig::~LArDSPConfig
virtual ~LArDSPConfig()
Definition: LArDSPConfig.cxx:14
LArDSPConfig::useMGRampInterceptByHash
bool useMGRampInterceptByHash(const IdentifierHash &febHash) const
Definition: LArDSPConfig.cxx:33
LArCondFlatBase
Definition: LArCondFlatBase.h:15
LArDSPConfig::PEAKSAMPLE_MASK
@ PEAKSAMPLE_MASK
Definition: LArDSPConfig.h:28
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
LArCondFlatBase::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArCondFlatBase.h:24
AthenaAttributeList.h
LArDSPConfigWrite::LArDSPConfigWrite
LArDSPConfigWrite()
Definition: LArDSPConfig.cxx:45
LArDSPConfig.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
LArDSPConfig::MGRAMPINTERCEPT_MASK
@ MGRAMPINTERCEPT_MASK
Definition: LArDSPConfig.h:30
LArDSPConfig::LGRAMPINTERCEPT_MASK
@ LGRAMPINTERCEPT_MASK
Definition: LArDSPConfig.h:31
LArDSPConfig::m_pBlob
const uint8_t * m_pBlob
Definition: LArDSPConfig.h:61
LArDSPConfig::peakSampleByHash
uint8_t peakSampleByHash(const IdentifierHash &febHash) const
Definition: LArDSPConfig.cxx:29
LArCondFlatBase::initializeBase
StatusCode initializeBase()
Definition: LArCondFlatBase.cxx:26
LArDSPConfigWrite::set
void set(const IdentifierHash febId, const uint8_t peakSample, const bool useMGRampIntercept)
Definition: LArDSPConfig.cxx:72
LArDSPConfigWrite::m_pBlob_nc
uint8_t * m_pBlob_nc
Definition: LArDSPConfig.h:85
LArDSPConfig::m_nFebs
unsigned m_nFebs
Definition: LArDSPConfig.h:62
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
LArDSPConfig::peakSample
uint8_t peakSample(const HWIdentifier FEBid) const
Definition: LArDSPConfig.h:55
LArDSPConfig::HGRAMPINTERCEPT_MASK
@ HGRAMPINTERCEPT_MASK
Definition: LArDSPConfig.h:29