ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCOOLConditions
src
LArOFCSC.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArCOOLConditions/LArOFCSC.h
"
6
#include "
AthenaPoolUtilities/CondAttrListCollection.h
"
7
#include "CoralBase/Blob.h"
8
9
LArOFCSC::LArOFCSC
():
10
LArCondSuperCellBase
(
"LArOFCSC"
),
11
m_nChannels
(0),
12
m_nSamples
(0)
13
{
14
}
15
16
LArOFCSC::~LArOFCSC
() {}
17
18
19
LArOFCSC::LArOFCSC
(
const
CondAttrListCollection
* attrList) :
20
LArCondSuperCellBase
(
"LArOFCSC"
),
21
m_nChannels
(0),
22
m_nSamples
(0)
23
{
24
25
if
(
initializeBase
().isFailure())
return
;
26
27
if
(!attrList)
return
;
28
29
CondAttrListCollection::const_iterator
gainIt=attrList->
begin
();
30
CondAttrListCollection::const_iterator
gainIt_e=attrList->
end
();
31
32
m_pOFCa
.resize(attrList->
size
());
33
m_pOFCb
.resize(attrList->
size
());
34
m_pTimeOffset
.resize(attrList->
size
());
35
ATH_MSG_DEBUG
(
"Found data for "
<< attrList->
size
() <<
" gains."
);
36
37
int
blobSize=0;
//FIXME Force size to hash-max??? m_scOnlineID->channelHashMax()
38
39
m_nSamples
=0;
40
41
for
(;gainIt!=gainIt_e;++gainIt) {
42
const unsigned gain=gainIt->first;
43
if (gain>=attrList->size() || gain>2) {
44
ATH_MSG_ERROR(
"Found unexpected COOL-channel (=gain) number:"
<< gain);
45
return;
//ERROR
46
}
47
const
coral::AttributeList& attr=gainIt->second;
48
const
coral::Blob& ofcaBlob = attr[
"OFCa"
].data<coral::Blob>();
49
const
coral::Blob& ofcbBlob = attr[
"OFCb"
].data<coral::Blob>();
50
const
coral::Blob& toBlob = attr[
"TimeOffset"
].data<coral::Blob>();
51
if
(blobSize==0) blobSize=ofcaBlob.size();
52
if
(
m_nSamples
==0)
m_nSamples
=attr[
"nSamples"
].data<unsigned>();
53
54
//Sanity checks:
55
if
(blobSize!=ofcaBlob.size() || blobSize!=ofcbBlob.size()) {
56
ATH_MSG_ERROR(
"Unequal blob size ("
<< blobSize <<
"/"
57
<< ofcaBlob.size() <<
"/"
<< ofcbBlob.size() <<
")"
);
58
return;
59
}
60
if
(
m_nSamples
!=attr[
"nSamples"
].data<unsigned>()) {
61
ATH_MSG_ERROR
(
"Unequal number of samples ("
<<
m_nSamples
<<
"/"
62
<< attr[
"nSamples"
].data<unsigned>() <<
")"
);
63
return
;
64
}
65
66
67
m_pOFCa
[gain]=
static_cast<
const
float
*
>
(ofcaBlob.startingAddress());
68
m_pOFCb
[gain]=
static_cast<
const
float
*
>
(ofcbBlob.startingAddress());
69
m_pTimeOffset
[gain]=
static_cast<
const
float
*
>
(toBlob.startingAddress());
70
}
// end loop over COOL channels
71
72
if
(m_nSamples==0) {
73
ATH_MSG_ERROR
(
"Number of samples is zero!"
);
74
return
;
75
}
76
m_nChannels=blobSize/(
sizeof
(
float
)*m_nSamples);
77
ATH_MSG_DEBUG
(
"Found data for "
<< m_nChannels);
78
}
79
80
LArOFCSC::OFCRef_t
LArOFCSC::OFC_a
(
const
HWIdentifier
& onId,
int
gain,
int
tbin)
const
{
81
if
(tbin!=0)
return
OFCRef_t
(
nullptr
,
nullptr
);
82
return
this->
OFC_a
(
m_scOnlineID
->channel_Hash(onId),gain);
83
}
84
85
LArOFCSC::OFCRef_t
LArOFCSC::OFC_b
(
const
HWIdentifier
& onId,
int
gain,
int
tbin)
const
{
86
if
(tbin!=0)
return
OFCRef_t
(
nullptr
,
nullptr
);
87
return
this->
OFC_b
(
m_scOnlineID
->channel_Hash(onId),gain);
88
}
89
90
float
LArOFCSC::timeOffset
(
const
HWIdentifier
& CellID,
int
gain)
const
{
91
const
IdentifierHash
hs=
m_scOnlineID
->channel_Hash(CellID);
92
return
m_pTimeOffset
[gain][hs];
93
}
94
95
96
unsigned
LArOFCSC::nTimeBins
(
const
HWIdentifier
&,
int
)
const
{
97
return
1;
98
}
99
100
101
float
LArOFCSC::timeBinWidth
(
const
HWIdentifier
&,
int
)
const
{
102
return
(25./24.);
103
}
104
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
LArOFCSC.h
if
if(pathvar)
Definition
SealSharedLib.cxx:168
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number.
Definition
CondAttrListCollection.h:51
CondAttrListCollection::end
const_iterator end() const
Definition
CondAttrListCollection.h:314
CondAttrListCollection::begin
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
Definition
CondAttrListCollection.h:308
CondAttrListCollection::size
size_type size() const
number of Chan/AttributeList pairs
Definition
CondAttrListCollection.h:321
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition
CondAttrListCollection.h:62
HWIdentifier
Definition
HWIdentifier.h:13
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
LArCondSuperCellBase::initializeBase
StatusCode initializeBase()
Definition
LArCondSuperCellBase.cxx:21
LArCondSuperCellBase::m_scOnlineID
const LArOnline_SuperCellID * m_scOnlineID
Definition
LArCondSuperCellBase.h:23
LArCondSuperCellBase::LArCondSuperCellBase
LArCondSuperCellBase(const std::string &name)
Definition
LArCondSuperCellBase.cxx:14
LArOFCSC::m_nChannels
unsigned m_nChannels
Definition
LArOFCSC.h:79
LArOFCSC::m_nSamples
unsigned m_nSamples
Definition
LArOFCSC.h:80
LArOFCSC::OFC_b
virtual OFCRef_t OFC_b(const HWIdentifier &CellID, int gain, int tbin=0) const
Definition
LArOFCSC.cxx:85
LArOFCSC::timeOffset
virtual float timeOffset(const HWIdentifier &CellID, int gain) const
Definition
LArOFCSC.cxx:90
LArOFCSC::m_pTimeOffset
std::vector< const float * > m_pTimeOffset
Definition
LArOFCSC.h:77
LArOFCSC::nTimeBins
virtual unsigned nTimeBins(const HWIdentifier &CellID, int gain) const
Definition
LArOFCSC.cxx:96
LArOFCSC::~LArOFCSC
virtual ~LArOFCSC()
Definition
LArOFCSC.cxx:16
LArOFCSC::OFC_a
virtual OFCRef_t OFC_a(const HWIdentifier &CellID, int gain, int tbin=0) const
access to OFCs by online ID, gain, and tbin (!=0 for testbeam)
Definition
LArOFCSC.cxx:80
LArOFCSC::OFCRef_t
ILArOFC::OFCRef_t OFCRef_t
Definition
LArOFCSC.h:24
LArOFCSC::m_pOFCb
std::vector< const float * > m_pOFCb
Definition
LArOFCSC.h:76
LArOFCSC::LArOFCSC
LArOFCSC()
Definition
LArOFCSC.cxx:9
LArOFCSC::timeBinWidth
virtual float timeBinWidth(const HWIdentifier &CellID, int gain) const
Definition
LArOFCSC.cxx:101
LArOFCSC::m_pOFCa
std::vector< const float * > m_pOFCa
Definition
LArOFCSC.h:75
python.LArMinBiasAlgConfig.float
float
Definition
LArMinBiasAlgConfig.py:66
Generated on
for ATLAS Offline Software by
1.17.0