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

#include <LArPedestalSC.h>

Inheritance diagram for LArPedestalSC:
Collaboration diagram for LArPedestalSC:

Public Types

enum  { ERRORCODE = LArElecCalib::ERRORCODE }

Public Member Functions

 LArPedestalSC (const CondAttrListCollection *attrList)
bool good () const
virtual float pedestal (const HWIdentifier &CellID, int gain) const
virtual float pedestalRMS (const HWIdentifier &CellID, int gain) const
 access to RMS of Pedestal index by Identifier, and gain setting
StatusCode initializeBase ()
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Protected Member Functions

void readBlob (const CondAttrListCollection *attrList, MsgStream &msg)
float pedestalByHash (const IdentifierHash &hs, const unsigned gain) const
float pedestalRMSByHash (const IdentifierHash &hs, const unsigned gain) const

Protected Attributes

bool m_isInitialized
const LArOnline_SuperCellIDm_scOnlineID
unsigned m_nChannels

Private Member Functions

 LArPedestalSC ()
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)
std::vector< const float * > m_pPedestal
std::vector< const float * > m_pPedestalRMS

Detailed Description

Definition at line 19 of file LArPedestalSC.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
ERRORCODE 

Definition at line 47 of file ILArPedestal.h.

Constructor & Destructor Documentation

◆ LArPedestalSC() [1/2]

LArPedestalSC::LArPedestalSC ( )
private

Definition at line 8 of file LArPedestalSC.cxx.

9 : LArCondSuperCellBase ("LArPedestalSC")
10{}
LArCondSuperCellBase(const std::string &name)

◆ LArPedestalSC() [2/2]

LArPedestalSC::LArPedestalSC ( const CondAttrListCollection * attrList)

Definition at line 12 of file LArPedestalSC.cxx.

13 : LArCondSuperCellBase ("LArPedestalSC")
14{
15 if (initializeBase().isFailure()) return;
16
17 readBlob(attrList,msg());
18}
MsgStream & msg() const
The standard message stream.
void readBlob(const CondAttrListCollection *attrList, MsgStream &msg)

Member Function Documentation

◆ good()

bool LArPedestalSC::good ( ) const
inline

Definition at line 31 of file LArPedestalSC.h.

◆ initializeBase()

StatusCode LArCondSuperCellBase::initializeBase ( )
inherited

Definition at line 22 of file LArCondSuperCellBase.cxx.

22 {
23
24 ATH_MSG_DEBUG( "initializeBase " );
25
26 if (m_isInitialized) {
27 ATH_MSG_DEBUG( "already initialized - returning " );
28 return (StatusCode::SUCCESS);
29 }
30 //Get SuperCellID ...
31 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
32 ATH_CHECK_WITH_CONTEXT( detStore.isValid(), "LArCondSuperCellBase" );
33 ATH_CHECK_WITH_CONTEXT( detStore->retrieve( m_scOnlineID,"LArOnline_SuperCellID"), "LArCondSuperCellBase" );
34
35 m_isInitialized = true;
36 ATH_MSG_DEBUG( "end initializeBase " );
37 return (StatusCode::SUCCESS);
38}
#define ATH_CHECK_WITH_CONTEXT
Evaluate an expression and check for errors, with an explicitly specified context name.
#define ATH_MSG_DEBUG(x)
const LArOnline_SuperCellID * m_scOnlineID

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 178 of file AthMessaging.h.

179{ return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ pedestal()

float LArPedestalSC::pedestal ( const HWIdentifier & CellID,
int gain ) const
virtual

Implements ILArPedestal.

Definition at line 21 of file LArPedestalSC.cxx.

21 {
22 const IdentifierHash hash=m_scOnlineID->channel_Hash(hwid);
23 return this->pedestalByHash(hash,0);
24}
float pedestalByHash(const IdentifierHash &hs, const unsigned gain) const

◆ pedestalByHash()

float LArPedestalBlob::pedestalByHash ( const IdentifierHash & hs,
const unsigned gain ) const
inlineprotectedinherited

Definition at line 26 of file LArPedestalBlob.h.

26 {
27 // check ranges ???
28 return m_pPedestal[gain][hs];
29 }
std::vector< const float * > m_pPedestal

◆ pedestalRMS()

float LArPedestalSC::pedestalRMS ( const HWIdentifier & id,
int gain ) const
virtual

access to RMS of Pedestal index by Identifier, and gain setting

Implements ILArPedestal.

Definition at line 26 of file LArPedestalSC.cxx.

26 {
27 const IdentifierHash hash=m_scOnlineID->channel_Hash(hwid);
28 return this->pedestalRMSByHash(hash,0);
29}
float pedestalRMSByHash(const IdentifierHash &hs, const unsigned gain) const

◆ pedestalRMSByHash()

float LArPedestalBlob::pedestalRMSByHash ( const IdentifierHash & hs,
const unsigned gain ) const
inlineprotectedinherited

Definition at line 31 of file LArPedestalBlob.h.

31 {
32 // check ranges ???
33 return m_pPedestalRMS[gain][hs];
34 }
std::vector< const float * > m_pPedestalRMS

◆ readBlob()

void LArPedestalBlob::readBlob ( const CondAttrListCollection * attrList,
MsgStream & msg )
protectedinherited

Definition at line 18 of file LArPedestalBlob.cxx.

18 {
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
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

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_isInitialized

bool LArCondSuperCellBase::m_isInitialized
protectedinherited

Definition at line 22 of file LArCondSuperCellBase.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nChannels

unsigned LArPedestalBlob::m_nChannels
protectedinherited

Definition at line 40 of file LArPedestalBlob.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_pPedestal

std::vector<const float*> LArPedestalBlob::m_pPedestal
privateinherited

Definition at line 37 of file LArPedestalBlob.h.

◆ m_pPedestalRMS

std::vector<const float*> LArPedestalBlob::m_pPedestalRMS
privateinherited

Definition at line 38 of file LArPedestalBlob.h.

◆ m_scOnlineID

const LArOnline_SuperCellID* LArCondSuperCellBase::m_scOnlineID
protectedinherited

Definition at line 23 of file LArCondSuperCellBase.h.


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