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

#include <LArDSPThresholdsFlat.h>

Inheritance diagram for LArDSPThresholdsFlat:
Collaboration diagram for LArDSPThresholdsFlat:

Public Member Functions

 LArDSPThresholdsFlat (const AthenaAttributeList *attrList)
 
bool good () const
 
float tQThr (const HWIdentifier &CellID) const
 
float samplesThr (const HWIdentifier &CellID) const
 
float trigSumThr (const HWIdentifier &CellID) const
 
float tQThrByHash (const IdentifierHash &h) const
 
float samplesThrByHash (const IdentifierHash &h) const
 
float trigSumThrByHash (const IdentifierHash &h) const
 
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...
 

Protected Attributes

bool m_isInitialized
 
const LArOnlineIDm_onlineHelper
 

Private Member Functions

 LArDSPThresholdsFlat ()
 
void readBlob (const AthenaAttributeList *attr)
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

unsigned m_nChannels
 
const float * m_ptQThr
 
const float * m_psamplesThr
 
const float * m_ptrigSumThr
 
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 17 of file LArDSPThresholdsFlat.h.

Constructor & Destructor Documentation

◆ LArDSPThresholdsFlat() [1/2]

LArDSPThresholdsFlat::LArDSPThresholdsFlat ( )
private

Definition at line 11 of file LArDSPThresholdsFlat.cxx.

11  :
12  LArCondFlatBase("LArDSPThresholdsFlat"),
13  m_nChannels(0),
14  m_ptQThr(nullptr),
15  m_psamplesThr(nullptr),
16  m_ptrigSumThr(nullptr)
17 
18 {}

◆ LArDSPThresholdsFlat() [2/2]

LArDSPThresholdsFlat::LArDSPThresholdsFlat ( const AthenaAttributeList attrList)

Definition at line 20 of file LArDSPThresholdsFlat.cxx.

20  :
21  LArCondFlatBase("LArDSPThresholdsFlat"),
22  m_nChannels(0),
23  m_ptQThr(nullptr),
24  m_psamplesThr(nullptr),
25  m_ptrigSumThr(nullptr)
26 {
27  if (initializeBase().isFailure()) return;
28  readBlob(attrList);
29  return;
30 }

Member Function Documentation

◆ good()

bool LArDSPThresholdsFlat::good ( ) const
inline

Definition at line 27 of file LArDSPThresholdsFlat.h.

27 { return m_isInitialized && m_nChannels>0; }

◆ initializeBase()

StatusCode LArCondFlatBase::initializeBase ( )
inherited

Definition at line 29 of file LArCondFlatBase.cxx.

29  {
30 
31  ATH_MSG_DEBUG( "initializeBase " );
32 
33  if (m_isInitialized) {
34  ATH_MSG_DEBUG( "already initialized - returning " );
35  return (StatusCode::SUCCESS);
36  }
37  //Get LArOnlineID....
38  ISvcLocator* svcLoc = Gaudi::svcLocator( );
40  ATH_CHECK_WITH_CONTEXT( svcLoc->service("DetectorStore",detStore), "LArCondFlatBase" );
41  ATH_CHECK_WITH_CONTEXT( detStore->retrieve(m_onlineHelper,"LArOnlineID"), "LArCondFlatBase" );
42 
43  m_isInitialized = true;
44  ATH_MSG_DEBUG( "end initializeBase ");
45  return (StatusCode::SUCCESS);
46 }

◆ 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 LArDSPThresholdsFlat::readBlob ( const AthenaAttributeList attr)
private

Definition at line 71 of file LArDSPThresholdsFlat.cxx.

71  {
72  m_nChannels=0;
73  //m_setName.clear();
74 
75  if (!attrList) return;
76 
77  //const coral::AttributeList& attr= attrList->coralList();
78 
79  //m_setName=attr["Name"].data<std::string>();
80 
81  const coral::Blob& tQThrBlob = (*attrList)["tQThr"].data<coral::Blob>();
82  const coral::Blob& samplesThrBlob = (*attrList)["samplesThr"].data<coral::Blob>();
83  const coral::Blob& trigSumThrBlob = (*attrList)["trigSumThr"].data<coral::Blob>();
84  //const coral::Blob *tQThrBlob = new coral::Blob(attr["tQThr"].data<coral::Blob>());
85  //const coral::Blob *samplesThrBlob = new coral::Blob(attr["samplesThr"].data<coral::Blob>());
86  //const coral::Blob *trigSumThrBlob = new coral::Blob(attr["trigSumThr"].data<coral::Blob>());
87 
88  if (!(tQThrBlob.size()==samplesThrBlob.size() && samplesThrBlob.size()==trigSumThrBlob.size())) {
89  ATH_MSG_ERROR( "Unequal blob size tQThr/samplesThr/trigSumThr = "
90  << tQThrBlob.size() << "/" << samplesThrBlob.size() << "/" << trigSumThrBlob.size() );
91  return;
92  }
93 
94  m_nChannels=tQThrBlob.size()/sizeof(float);
95 
96 
98  ATH_MSG_WARNING( "Found data for " << m_nChannels << " but expected " << m_onlineHelper->channelHashMax() );
99  }
100 
101  ATH_MSG_DEBUG( "Found data for " << m_nChannels );
102  m_ptQThr=static_cast<const float*>(tQThrBlob.startingAddress());
103  m_psamplesThr=static_cast<const float*>(samplesThrBlob.startingAddress());
104  m_ptrigSumThr=static_cast<const float*>(trigSumThrBlob.startingAddress());
105 
106 
107  return;
108 }

◆ samplesThr()

float LArDSPThresholdsFlat::samplesThr ( const HWIdentifier CellID) const

Definition at line 47 of file LArDSPThresholdsFlat.cxx.

47  {
48  return this->samplesThrByHash(m_onlineHelper->channel_Hash(CellID));
49 }

◆ samplesThrByHash()

float LArDSPThresholdsFlat::samplesThrByHash ( const IdentifierHash h) const

Definition at line 51 of file LArDSPThresholdsFlat.cxx.

51  {
52  if (h>=m_nChannels) {
53  ATH_MSG_ERROR( "samplesThrByHash: Hash out of range ( " << h << ", max=" << m_nChannels << ")" );
54  return 0;
55  }
56  return m_psamplesThr[h];
57 }

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

◆ tQThr()

float LArDSPThresholdsFlat::tQThr ( const HWIdentifier CellID) const

Definition at line 35 of file LArDSPThresholdsFlat.cxx.

35  {
36  return this->tQThrByHash(m_onlineHelper->channel_Hash(CellID));
37 }

◆ tQThrByHash()

float LArDSPThresholdsFlat::tQThrByHash ( const IdentifierHash h) const

Definition at line 39 of file LArDSPThresholdsFlat.cxx.

39  {
40  if (h>=m_nChannels) {
41  ATH_MSG_ERROR ("tQThrByHash: Hash out of range ( " << h << ", max=" << m_nChannels << ")" );
42  return 0;
43  }
44  return m_ptQThr[h];
45 }

◆ trigSumThr()

float LArDSPThresholdsFlat::trigSumThr ( const HWIdentifier CellID) const

Definition at line 59 of file LArDSPThresholdsFlat.cxx.

59  {
60  return this->trigSumThrByHash(m_onlineHelper->channel_Hash(CellID));
61 }

◆ trigSumThrByHash()

float LArDSPThresholdsFlat::trigSumThrByHash ( const IdentifierHash h) const

Definition at line 63 of file LArDSPThresholdsFlat.cxx.

63  {
64  if (h>=m_nChannels) {
65  ATH_MSG_ERROR( "trigSumThrByHash: Hash out of range ( " << h << ", max=" << m_nChannels << ")" );
66  return 0;
67  }
68  return m_ptrigSumThr[h];
69 }

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 LArCondFlatBase::m_isInitialized
protectedinherited

Definition at line 28 of file LArCondFlatBase.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 LArDSPThresholdsFlat::m_nChannels
private

Definition at line 47 of file LArDSPThresholdsFlat.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_onlineHelper

const LArOnlineID* LArCondFlatBase::m_onlineHelper
protectedinherited

Definition at line 29 of file LArCondFlatBase.h.

◆ m_psamplesThr

const float* LArDSPThresholdsFlat::m_psamplesThr
private

Definition at line 49 of file LArDSPThresholdsFlat.h.

◆ m_ptQThr

const float* LArDSPThresholdsFlat::m_ptQThr
private

Definition at line 48 of file LArDSPThresholdsFlat.h.

◆ m_ptrigSumThr

const float* LArDSPThresholdsFlat::m_ptrigSumThr
private

Definition at line 50 of file LArDSPThresholdsFlat.h.


The documentation for this class was generated from the following files:
LArDSPThresholdsFlat::trigSumThrByHash
float trigSumThrByHash(const IdentifierHash &h) const
Definition: LArDSPThresholdsFlat.cxx:63
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
LArDSPThresholdsFlat::m_psamplesThr
const float * m_psamplesThr
Definition: LArDSPThresholdsFlat.h:49
LArOnlineID_Base::channel_Hash
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
Definition: LArOnlineID_Base.cxx:1636
LArDSPThresholdsFlat::tQThrByHash
float tQThrByHash(const IdentifierHash &h) const
Definition: LArDSPThresholdsFlat.cxx:39
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
LArDSPThresholdsFlat::m_nChannels
unsigned m_nChannels
Definition: LArDSPThresholdsFlat.h:47
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
LArCondFlatBase::m_isInitialized
bool m_isInitialized
Definition: LArCondFlatBase.h:28
LArCondFlatBase::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArCondFlatBase.h:29
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
LArDSPThresholdsFlat::samplesThrByHash
float samplesThrByHash(const IdentifierHash &h) const
Definition: LArDSPThresholdsFlat.cxx:51
LArCondFlatBase::LArCondFlatBase
LArCondFlatBase(const std::string &name)
Definition: LArCondFlatBase.cxx:19
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
extractSporadic.h
list h
Definition: extractSporadic.py:97
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArDSPThresholdsFlat::m_ptQThr
const float * m_ptQThr
Definition: LArDSPThresholdsFlat.h:48
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
LArDSPThresholdsFlat::m_ptrigSumThr
const float * m_ptrigSumThr
Definition: LArDSPThresholdsFlat.h:50
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
LArOnlineID_Base::channelHashMax
size_type channelHashMax(void) const
Define channel hash tables max size.
Definition: LArOnlineID_Base.cxx:1901
LArDSPThresholdsFlat::readBlob
void readBlob(const AthenaAttributeList *attr)
Definition: LArDSPThresholdsFlat.cxx:71
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
LArCondFlatBase::initializeBase
StatusCode initializeBase()
Definition: LArCondFlatBase.cxx:29
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
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
readCCLHist.float
float
Definition: readCCLHist.py:83