ATLAS Offline Software
Loading...
Searching...
No Matches
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
7#include "CoralBase/Blob.h"
8#include "CoralBase/Attribute.h"
9#include "CoralBase/AttributeList.h"
10#include "CoralBase/AttributeListSpecification.h"
11
15
17
18void LArPedestalBlob::readBlob(const CondAttrListCollection* attrList, MsgStream& msg) {
20 m_pPedestal.clear();
21 m_pPedestalRMS.clear();
22
23 if (!attrList) return;
24
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}
#define endmsg
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
This class is a collection of AttributeLists where each one is associated with a channel number.
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
size_type size() const
number of Chan/AttributeList pairs
ChanAttrListMap::const_iterator const_iterator
std::vector< const float * > m_pPedestalRMS
std::vector< const float * > m_pPedestal
void readBlob(const CondAttrListCollection *attrList, MsgStream &msg)
MsgStream & msg
Definition testRead.cxx:32