ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
LArDAC2uASC Class Reference

#include <LArDAC2uASC.h>

Inheritance diagram for LArDAC2uASC:
Collaboration diagram for LArDAC2uASC:

Public Types

enum  { ERRORCODE = LArElecCalib::ERRORCODE }
 

Public Member Functions

 LArDAC2uASC ()
 
 LArDAC2uASC (const CondAttrListCollection *attrList)
 
virtual ~LArDAC2uASC ()
 
bool good () const
 
virtual const float & DAC2UA (const HWIdentifier &chid) const
 access to DAC2UA conversion factor index by Identifier, and gain setting More...
 
StatusCode initializeBase ()
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 
void readBlob (const CondAttrListCollection *attrList, const char *attrName, MsgStream &msg)
 

Protected Member Functions

const float & getDataByHash (const IdentifierHash &hs, const unsigned gain) const
 

Protected Attributes

bool m_isInitialized
 
const LArOnline_SuperCellIDm_scOnlineID
 
std::vector< const float * > m_pValues
 
unsigned m_nChannels
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 16 of file LArDAC2uASC.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
ERRORCODE 

Definition at line 37 of file ILArDAC2uA.h.

Constructor & Destructor Documentation

◆ LArDAC2uASC() [1/2]

LArDAC2uASC::LArDAC2uASC ( )

Definition at line 9 of file LArDAC2uASC.cxx.

10  : LArCondSuperCellBase ("LArDAC2uASC")
11 {}

◆ LArDAC2uASC() [2/2]

LArDAC2uASC::LArDAC2uASC ( const CondAttrListCollection attrList)

Definition at line 16 of file LArDAC2uASC.cxx.

17  : LArCondSuperCellBase ("LArDAC2uASC")
18 {
19  if (initializeBase().isFailure()) return;
20 
21  readBlob(attrList,"DAC2uA",msg());
22 
23  if (m_pValues.size()!=1) {
24  ATH_MSG_ERROR( "Found unexpected number of gains (" << m_pValues.size() <<"). Expected exactly one gain." );
25  }
26 
27  return;
28 }

◆ ~LArDAC2uASC()

LArDAC2uASC::~LArDAC2uASC ( )
virtual

Definition at line 13 of file LArDAC2uASC.cxx.

13 {}

Member Function Documentation

◆ DAC2UA()

const float & LArDAC2uASC::DAC2UA ( const HWIdentifier id) const
virtual

access to DAC2UA conversion factor index by Identifier, and gain setting

Implements ILArDAC2uA.

Definition at line 31 of file LArDAC2uASC.cxx.

31  {
33  return this->getDataByHash(hash, 0);
34 }

◆ getDataByHash()

const float& LArSingleFloatBlob::getDataByHash ( const IdentifierHash hs,
const unsigned  gain 
) const
inlineprotectedinherited

Definition at line 25 of file LArSingleFloatBlob.h.

25  {
26  return m_pValues[gain][hs];
27  }

◆ good()

bool LArDAC2uASC::good ( ) const
inline

Definition at line 26 of file LArDAC2uASC.h.

26 { return m_isInitialized && m_nChannels>0; }

◆ 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 }

◆ 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  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ 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 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ 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 179 of file AthMessaging.h.

180 { 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_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ readBlob()

void LArSingleFloatBlob::readBlob ( const CondAttrListCollection attrList,
const char *  attrName,
MsgStream &  msg 
)
inherited

Definition at line 15 of file LArSingleFloatBlob.cxx.

15  {
16  m_nChannels=0;
17 
18  if (!attrList) return;
19 
21  CondAttrListCollection::const_iterator gainIt_e=attrList->end();
22 
23  m_pValues.resize(attrList->size());
24  msg << MSG::DEBUG << "Found data for " << attrList->size() << " gains." << endmsg;
25 
26  int blobSize=0; //FIXME Force size to hash-max??? m_onlineHelper->channelHashMax()
27 
28  for(;gainIt!=gainIt_e;++gainIt) {
29  unsigned gain=gainIt->first;
30  //Special case: Single-gain constant in channel 1
31  if (gain==1 && attrList->size()==1) gain=0;
32 
33  if (gain>=attrList->size() || gain>2) {
34  msg << MSG::ERROR << "Found unexpected COOL-channel (=gain) number:" << gain << endmsg;
35  return; //ERROR
36  }
37 
38  const coral::AttributeList& attr=gainIt->second;
39  const coral::Blob& myBlob = attr[attrName].data<coral::Blob>();
40  m_pValues[gain]=static_cast<const float*>(myBlob.startingAddress());
41  if (blobSize==0) {
42  blobSize=myBlob.size();
43  }
44  else {
45  if (blobSize!=myBlob.size())
46  msg << MSG::ERROR << "Unequal blob size (" << blobSize << "/" << myBlob.size() << ")" << endmsg;
47  }
48  }// end loop over COOL channels
49 
50  m_nChannels=blobSize/sizeof(float);
51  msg << MSG::DEBUG << "Found data for " << m_nChannels << " Channels" << endmsg;
52  return;
53 }

◆ 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.

◆ 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.

◆ 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 LArSingleFloatBlob::m_nChannels
protectedinherited

Definition at line 30 of file LArSingleFloatBlob.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_pValues

std::vector<const float*> LArSingleFloatBlob::m_pValues
protectedinherited

Definition at line 29 of file LArSingleFloatBlob.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:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
CondAttrListCollection::end
const_iterator end() const
Definition: CondAttrListCollection.h:315
LArOnlineID_Base::channel_Hash
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
Definition: LArOnlineID_Base.cxx:1632
LArSingleFloatBlob::readBlob
void readBlob(const CondAttrListCollection *attrList, const char *attrName, MsgStream &msg)
Definition: LArSingleFloatBlob.cxx:15
LArCondSuperCellBase::m_scOnlineID
const LArOnline_SuperCellID * m_scOnlineID
Definition: LArCondSuperCellBase.h:23
ATH_CHECK_WITH_CONTEXT
#define ATH_CHECK_WITH_CONTEXT
Evaluate an expression and check for errors, with an explicitly specified context name.
Definition: AthCheckMacros.h:36
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
CondAttrListCollection::begin
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
Definition: CondAttrListCollection.h:309
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
LArCondSuperCellBase::LArCondSuperCellBase
LArCondSuperCellBase(const std::string &name)
Definition: LArCondSuperCellBase.cxx:15
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
LArSingleFloatBlob::m_nChannels
unsigned m_nChannels
Definition: LArSingleFloatBlob.h:30
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CreatePhysValWebPage.hs
hs
Definition: CreatePhysValWebPage.py:107
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArCondSuperCellBase::initializeBase
StatusCode initializeBase()
Definition: LArCondSuperCellBase.cxx:22
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
LArSingleFloatBlob::getDataByHash
const float & getDataByHash(const IdentifierHash &hs, const unsigned gain) const
Definition: LArSingleFloatBlob.h:25
LArSingleFloatBlob::m_pValues
std::vector< const float * > m_pValues
Definition: LArSingleFloatBlob.h:29
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
CondAttrListCollection::size
size_type size() const
number of Chan/AttributeList pairs
Definition: CondAttrListCollection.h:322
python.PoolAttributeHelper.attrName
attrName
Definition: PoolAttributeHelper.py:100
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
DEBUG
#define DEBUG
Definition: page_access.h:11
ILArDAC2uA::ERRORCODE
@ ERRORCODE
Definition: ILArDAC2uA.h:37
LArElecCalib::ERRORCODE
@ ERRORCODE
Definition: LArCalibErrorCode.h:17
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
LArCondSuperCellBase::m_isInitialized
bool m_isInitialized
Definition: LArCondSuperCellBase.h:22
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
readCCLHist.float
float
Definition: readCCLHist.py:83