ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCOOLConditions
src
LArDSPConfig.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/LArDSPConfig.h
"
6
7
#include "CoralBase/Blob.h"
8
9
LArDSPConfig::LArDSPConfig
()
10
:
LArCondFlatBase
(
"LArDSPConfig"
),
11
m_attrList
(nullptr),
m_pBlob
(nullptr),
m_nFebs
(0)
12
{}
13
14
LArDSPConfig::~LArDSPConfig
() {}
15
16
17
LArDSPConfig::LArDSPConfig
(
const
AthenaAttributeList
* attrList)
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
29
uint8_t
LArDSPConfig::peakSampleByHash
(
const
IdentifierHash
& febHash)
const
{
30
return
(
m_pBlob
[febHash] &
PEAKSAMPLE_MASK
);
31
}
32
33
bool
LArDSPConfig::useMGRampInterceptByHash
(
const
IdentifierHash
& febHash)
const
{
34
return
((
m_pBlob
[febHash] &
MGRAMPINTERCEPT_MASK
) !=0);
35
}
36
37
bool
LArDSPConfig::useHGRampInterceptByHash
(
const
IdentifierHash
& febHash)
const
{
38
return
((
m_pBlob
[febHash] &
HGRAMPINTERCEPT_MASK
) !=0);
39
}
40
41
bool
LArDSPConfig::useLGRampInterceptByHash
(
const
IdentifierHash
& febHash)
const
{
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
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
74
void
LArDSPConfigWrite::set
(
const
IdentifierHash
febId,
75
const
uint8_t
peakSample
,
const
bool
useMGRampIntercept
) {
76
77
m_pBlob_nc
[febId]= (
peakSample
&
PEAKSAMPLE_MASK
);
78
if
(
useMGRampIntercept
) {
79
m_pBlob_nc
[febId] |=
MGRAMPINTERCEPT_MASK
;
80
}
81
m_pBlob_nc
[febId] |=
LGRAMPINTERCEPT_MASK
;
82
return
;
83
84
}
LArDSPConfig.h
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table.
Definition
PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:46
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
LArDSPConfigWrite::set
void set(const IdentifierHash febId, const uint8_t peakSample, const bool useMGRampIntercept)
Definition
LArDSPConfig.cxx:74
LArDSPConfigWrite::LArDSPConfigWrite
LArDSPConfigWrite()
Definition
LArDSPConfig.cxx:45
LArDSPConfigWrite::m_pBlob_nc
uint8_t * m_pBlob_nc
Definition
LArDSPConfig.h:89
LArDSPConfigWrite::m_attrListNC
std::unique_ptr< AthenaAttributeList > m_attrListNC
Definition
LArDSPConfig.h:88
LArDSPConfig::useLGRampInterceptByHash
bool useLGRampInterceptByHash(const IdentifierHash &febHash) const
Definition
LArDSPConfig.cxx:41
LArDSPConfig::~LArDSPConfig
virtual ~LArDSPConfig()
Definition
LArDSPConfig.cxx:14
LArDSPConfig::LGRAMPINTERCEPT_MASK
@ LGRAMPINTERCEPT_MASK
Definition
LArDSPConfig.h:35
LArDSPConfig::PEAKSAMPLE_MASK
@ PEAKSAMPLE_MASK
Definition
LArDSPConfig.h:32
LArDSPConfig::MGRAMPINTERCEPT_MASK
@ MGRAMPINTERCEPT_MASK
Definition
LArDSPConfig.h:34
LArDSPConfig::HGRAMPINTERCEPT_MASK
@ HGRAMPINTERCEPT_MASK
Definition
LArDSPConfig.h:33
LArDSPConfig::m_nFebs
unsigned m_nFebs
Definition
LArDSPConfig.h:66
LArDSPConfig::peakSampleByHash
uint8_t peakSampleByHash(const IdentifierHash &febHash) const
Definition
LArDSPConfig.cxx:29
LArDSPConfig::m_pBlob
const uint8_t * m_pBlob
Definition
LArDSPConfig.h:65
LArDSPConfig::LArDSPConfig
LArDSPConfig()
Definition
LArDSPConfig.cxx:9
LArDSPConfig::m_attrList
const AthenaAttributeList * m_attrList
Definition
LArDSPConfig.h:64
LArDSPConfig::useMGRampIntercept
bool useMGRampIntercept(const HWIdentifier FEBid) const
Definition
LArDSPConfig.h:48
LArDSPConfig::useHGRampInterceptByHash
bool useHGRampInterceptByHash(const IdentifierHash &febHash) const
Definition
LArDSPConfig.cxx:37
LArDSPConfig::useMGRampInterceptByHash
bool useMGRampInterceptByHash(const IdentifierHash &febHash) const
Definition
LArDSPConfig.cxx:33
LArDSPConfig::peakSample
uint8_t peakSample(const HWIdentifier FEBid) const
Definition
LArDSPConfig.h:59
Generated on
for ATLAS Offline Software by
1.17.0