ATLAS Offline Software
Loading...
Searching...
No Matches
LArRampBlob Class Reference

#include <LArRampBlob.h>

Inheritance diagram for LArRampBlob:
Collaboration diagram for LArRampBlob:

Public Types

enum  { ERRORCODE = LArElecCalib::ERRORCODE }

Public Member Functions

 LArRampBlob ()
 ~LArRampBlob ()

Protected Member Functions

void readBlob (const CondAttrListCollection *attrList, MsgStream &msg)
ILArRamp::RampRef_t ADC2DACByHash (const IdentifierHash &hs, int gain) const

Protected Attributes

unsigned m_nChannels
unsigned m_nPoints

Private Attributes

std::vector< const float * > m_pRamp

Detailed Description

Definition at line 17 of file LArRampBlob.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ERRORCODE 

Definition at line 20 of file LArRampBlob.h.

Constructor & Destructor Documentation

◆ LArRampBlob()

LArRampBlob::LArRampBlob ( )

Definition at line 9 of file LArRampBlob.cxx.

10 :m_nChannels(0),
11 m_nPoints(0)
12{}
unsigned m_nPoints
Definition LArRampBlob.h:38
unsigned m_nChannels
Definition LArRampBlob.h:37

◆ ~LArRampBlob()

LArRampBlob::~LArRampBlob ( )

Definition at line 14 of file LArRampBlob.cxx.

15{}

Member Function Documentation

◆ ADC2DACByHash()

ILArRamp::RampRef_t LArRampBlob::ADC2DACByHash ( const IdentifierHash & hs,
int gain ) const
inlineprotected

Definition at line 28 of file LArRampBlob.h.

28 {
29 const float* start=m_pRamp[gain]+hs*m_nPoints;
30 if (*start==static_cast<float>(ERRORCODE))
31 return ILArRamp::RampRef_t(NULL,NULL);
32 else
33 return ILArRamp::RampRef_t(start,start+m_nPoints);
34 }
LArVectorProxy RampRef_t
This class defines the interface for accessing Ramp @stereotype Interface.
Definition ILArRamp.h:31
std::vector< const float * > m_pRamp
Definition LArRampBlob.h:41

◆ readBlob()

void LArRampBlob::readBlob ( const CondAttrListCollection * attrList,
MsgStream & msg )
protected

Definition at line 18 of file LArRampBlob.cxx.

18 {
20 m_nPoints=0;
21 m_pRamp.clear();
22
23 if (!attrList) return;
24
27
28 m_pRamp.resize(attrList->size());
29 msg << MSG::DEBUG << "Found data for " << attrList->size() << " gains." << endmsg;
30
31 int blobSize=0;
32
33 for(;gainIt!=gainIt_e;++gainIt) {
34 const unsigned gain=gainIt->first;
35 if (gain>=attrList->size() || gain>2) {
36 msg << MSG::ERROR << "Found unexpected COOL-channel (=gain) number:" << gain << endmsg;
37 return; //ERROR
38 }
39 const coral::AttributeList& attr=gainIt->second;
40 const coral::Blob& rampBlob = attr["RampVec"].data<coral::Blob>();
41 if (blobSize==0) blobSize=rampBlob.size();
42 if (m_nPoints==0) m_nPoints=attr["nPoints"].data<unsigned>();
43
44 //Sanity checks:
45 if (blobSize!=rampBlob.size()) {
46 msg << MSG::ERROR << "Unequal blob size (" << blobSize << "/"
47 << rampBlob.size() << ")" <<endmsg;
48 return;
49 }
50 if (m_nPoints!=attr["nPoints"].data<unsigned>()) {
51 msg << MSG::ERROR << "Unequal polynom degree (" << m_nPoints << "/"
52 << attr["nPoints"].data<unsigned>() << ")" << endmsg;
53 return;
54 }
55
56 m_pRamp[gain]=static_cast<const float*>(rampBlob.startingAddress());
57 }// end loop over COOL channels
58
59
60 if (m_nPoints==0) {
61 msg << MSG::ERROR << "Number of points is zero!" << endmsg;
62 return;
63 }
64 m_nChannels=blobSize/(sizeof(float)*m_nPoints);
65 msg << MSG::DEBUG << "Found data for " << m_nChannels << endmsg;
66 return;
67}
#define endmsg
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
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
MsgStream & msg
Definition testRead.cxx:32

Member Data Documentation

◆ m_nChannels

unsigned LArRampBlob::m_nChannels
protected

Definition at line 37 of file LArRampBlob.h.

◆ m_nPoints

unsigned LArRampBlob::m_nPoints
protected

Definition at line 38 of file LArRampBlob.h.

◆ m_pRamp

std::vector<const float*> LArRampBlob::m_pRamp
private

Definition at line 41 of file LArRampBlob.h.


The documentation for this class was generated from the following files: