ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCOOLConditions
src
LArPedestalBlob.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArCOOLConditions/LArPedestalBlob.h
"
6
#include "
AthenaPoolUtilities/CondAttrListCollection.h
"
7
#include "CoralBase/Blob.h"
8
#include "CoralBase/Attribute.h"
9
#include "CoralBase/AttributeList.h"
10
#include "CoralBase/AttributeListSpecification.h"
11
12
LArPedestalBlob::LArPedestalBlob
():
13
m_nChannels
(0)
14
{}
15
16
LArPedestalBlob::~LArPedestalBlob
() {}
17
18
void
LArPedestalBlob::readBlob
(
const
CondAttrListCollection
* attrList, MsgStream&
msg
) {
19
m_nChannels
=0;
20
m_pPedestal
.clear();
21
m_pPedestalRMS
.clear();
22
23
if
(!attrList)
return
;
24
25
CondAttrListCollection::const_iterator
gainIt=attrList->
begin
();
26
CondAttrListCollection::const_iterator
gainIt_e=attrList->
end
();
27
28
m_pPedestal
.resize(attrList->
size
());
29
m_pPedestalRMS
.resize(attrList->
size
());
30
msg
<< MSG::DEBUG <<
"Found data for "
<< attrList->
size
() <<
" gains."
<<
endmsg
;
31
32
int
blobSize=0;
33
34
for
(;gainIt!=gainIt_e;++gainIt) {
35
const
unsigned
gain=gainIt->first;
36
if
(gain>=attrList->
size
()) {
37
msg
<< MSG::ERROR <<
"Found unexpected COOL-channel (=gain) number:"
<< gain <<
endmsg
;
38
return
;
//ERROR
39
}
40
const
coral::AttributeList& attr=gainIt->second;
41
const
coral::Blob& pedBlob = attr[
"Pedestal"
].data<coral::Blob>();
42
const
coral::Blob& rmsBlob = attr[
"PedestalRMS"
].data<coral::Blob>();
43
if
(blobSize==0) blobSize=pedBlob.size();
44
45
//Sanity checks:
46
if
(blobSize!=pedBlob.size() || blobSize!=rmsBlob.size()) {
47
msg
<< MSG::ERROR <<
"Unequal blob size ("
<< blobSize <<
"/"
48
<< pedBlob.size() <<
"/"
<< rmsBlob.size() <<
")"
<<
endmsg
;
49
return
;
50
}
51
m_pPedestal
[gain]=
static_cast<
const
float
*
>
(pedBlob.startingAddress());
52
m_pPedestalRMS
[gain]=
static_cast<
const
float
*
>
(rmsBlob.startingAddress());
53
}
// end loop over COOL channels
54
55
56
m_nChannels
=blobSize/
sizeof
(float);
57
msg
<< MSG::DEBUG <<
"Found data for "
<<
m_nChannels
<<
endmsg
;
58
return
;
59
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
LArPedestalBlob.h
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
LArPedestalBlob::m_pPedestalRMS
std::vector< const float * > m_pPedestalRMS
Definition
LArPedestalBlob.h:42
LArPedestalBlob::LArPedestalBlob
LArPedestalBlob()
Definition
LArPedestalBlob.cxx:12
LArPedestalBlob::m_pPedestal
std::vector< const float * > m_pPedestal
Definition
LArPedestalBlob.h:41
LArPedestalBlob::m_nChannels
unsigned m_nChannels
Definition
LArPedestalBlob.h:44
LArPedestalBlob::~LArPedestalBlob
~LArPedestalBlob()
Definition
LArPedestalBlob.cxx:16
LArPedestalBlob::readBlob
void readBlob(const CondAttrListCollection *attrList, MsgStream &msg)
Definition
LArPedestalBlob.cxx:18
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0