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

#include <LArDSPConfig.h>

Inheritance diagram for LArDSPConfigWrite:
Collaboration diagram for LArDSPConfigWrite:

Public Types

enum  { PEAKSAMPLE_MASK =0x1F, HGRAMPINTERCEPT_MASK =0x20, MGRAMPINTERCEPT_MASK =0x40, LGRAMPINTERCEPT_MASK =0x80 }
 

Public Member Functions

 LArDSPConfigWrite ()
 
void set (const IdentifierHash febId, const uint8_t peakSample, const bool useMGRampIntercept)
 
std::unique_ptr< AthenaAttributeListattributeList ()
 
bool good () const
 
bool useMGRampInterceptByHash (const IdentifierHash &febHash) const
 
bool useHGRampInterceptByHash (const IdentifierHash &febHash) const
 
bool useLGRampInterceptByHash (const IdentifierHash &febHash) const
 
bool useMGRampIntercept (const HWIdentifier FEBid) const
 
bool useHGRampIntercept (const HWIdentifier FEBid) const
 
bool useLGRampIntercept (const HWIdentifier FEBid) const
 
uint8_t peakSampleByHash (const IdentifierHash &febHash) const
 
uint8_t peakSample (const HWIdentifier FEBid) 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

const AthenaAttributeListm_attrList
 
const uint8_t * m_pBlob
 
unsigned m_nFebs
 
bool m_isInitialized
 
const LArOnlineIDm_onlineHelper
 

Private Member Functions

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

Private Attributes

std::unique_ptr< AthenaAttributeListm_attrListNC
 
uint8_t * m_pBlob_nc
 
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 69 of file LArDSPConfig.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
PEAKSAMPLE_MASK 
HGRAMPINTERCEPT_MASK 
MGRAMPINTERCEPT_MASK 
LGRAMPINTERCEPT_MASK 

Definition at line 25 of file LArDSPConfig.h.

25  {
26  //Encoding
27  //0R0P PPPP
28  PEAKSAMPLE_MASK=0x1F,
32  };

Constructor & Destructor Documentation

◆ LArDSPConfigWrite()

LArDSPConfigWrite::LArDSPConfigWrite ( )

Definition at line 45 of file LArDSPConfig.cxx.

45  : m_pBlob_nc(nullptr) {
46 
47  if (this->initializeBase().isFailure()) return;
48 
49 
51  coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
52  spec->extend("febdata", "blob");
53  spec->extend<unsigned>("version");
54  //spec->extend<unsigned>("nSamples");
55  m_attrListNC=std::unique_ptr<AthenaAttributeList>(new AthenaAttributeList(*spec));
56 
57  (*m_attrListNC)["version"].setValue(0U);
58  coral::Blob& myBlob = (*m_attrListNC)["febdata"].data<coral::Blob>();
59  myBlob.resize(m_nFebs*sizeof(uint8_t));
60  m_pBlob_nc=static_cast<uint8_t*>(myBlob.startingAddress());
61  m_pBlob=m_pBlob_nc; //implict cast to const-ptr (for the underlying reading object
62 
63  //Initialize the blob to 0
64  for (unsigned i=0;i<m_nFebs;++i)
65  m_pBlob_nc[i]=0;
66 
67  // cppcheck-suppress memleak
68  spec = nullptr;
69  return;
70 }

Member Function Documentation

◆ attributeList()

std::unique_ptr<AthenaAttributeList> LArDSPConfigWrite::attributeList ( )
inline

Definition at line 81 of file LArDSPConfig.h.

81 { return std::move(m_attrListNC); }

◆ good()

bool LArDSPConfig::good ( ) const
inlineinherited

Definition at line 38 of file LArDSPConfig.h.

38 { return m_isInitialized && m_nFebs>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 }

◆ peakSample()

uint8_t LArDSPConfig::peakSample ( const HWIdentifier  FEBid) const
inlineinherited

Definition at line 55 of file LArDSPConfig.h.

55  {
57  }

◆ peakSampleByHash()

uint8_t LArDSPConfig::peakSampleByHash ( const IdentifierHash febHash) const
inherited

Definition at line 29 of file LArDSPConfig.cxx.

29  {
30  return (m_pBlob[febHash] & PEAKSAMPLE_MASK);
31 }

◆ set()

void LArDSPConfigWrite::set ( const IdentifierHash  febId,
const uint8_t  peakSample,
const bool  useMGRampIntercept 
)

Definition at line 72 of file LArDSPConfig.cxx.

73  {
74 
76  if (useMGRampIntercept) {
78  }
80  return;
81 
82 }

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

◆ useHGRampIntercept()

bool LArDSPConfig::useHGRampIntercept ( const HWIdentifier  FEBid) const
inlineinherited

Definition at line 47 of file LArDSPConfig.h.

47  {
49  };

◆ useHGRampInterceptByHash()

bool LArDSPConfig::useHGRampInterceptByHash ( const IdentifierHash febHash) const
inherited

Definition at line 37 of file LArDSPConfig.cxx.

37  {
38  return ((m_pBlob[febHash] & HGRAMPINTERCEPT_MASK) !=0);
39 }

◆ useLGRampIntercept()

bool LArDSPConfig::useLGRampIntercept ( const HWIdentifier  FEBid) const
inlineinherited

Definition at line 50 of file LArDSPConfig.h.

50  {
52  };

◆ useLGRampInterceptByHash()

bool LArDSPConfig::useLGRampInterceptByHash ( const IdentifierHash febHash) const
inherited

Definition at line 41 of file LArDSPConfig.cxx.

41  {
42  return ((m_pBlob[febHash] & LGRAMPINTERCEPT_MASK) !=0);
43 }

◆ useMGRampIntercept()

bool LArDSPConfig::useMGRampIntercept ( const HWIdentifier  FEBid) const
inlineinherited

Definition at line 44 of file LArDSPConfig.h.

44  {
46  };

◆ useMGRampInterceptByHash()

bool LArDSPConfig::useMGRampInterceptByHash ( const IdentifierHash febHash) const
inherited

Definition at line 33 of file LArDSPConfig.cxx.

33  {
34  return ((m_pBlob[febHash] & MGRAMPINTERCEPT_MASK) !=0);
35 }

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_attrList

const AthenaAttributeList* LArDSPConfig::m_attrList
protectedinherited

Definition at line 60 of file LArDSPConfig.h.

◆ m_attrListNC

std::unique_ptr<AthenaAttributeList> LArDSPConfigWrite::m_attrListNC
private

Definition at line 84 of file LArDSPConfig.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_nFebs

unsigned LArDSPConfig::m_nFebs
protectedinherited

Definition at line 62 of file LArDSPConfig.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_pBlob

const uint8_t* LArDSPConfig::m_pBlob
protectedinherited

Definition at line 61 of file LArDSPConfig.h.

◆ m_pBlob_nc

uint8_t* LArDSPConfigWrite::m_pBlob_nc
private

Definition at line 85 of file LArDSPConfig.h.


The documentation for this class was generated from the following files:
LArDSPConfig::useLGRampInterceptByHash
bool useLGRampInterceptByHash(const IdentifierHash &febHash) const
Definition: LArDSPConfig.cxx:41
LArDSPConfig::useHGRampInterceptByHash
bool useHGRampInterceptByHash(const IdentifierHash &febHash) const
Definition: LArDSPConfig.cxx:37
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
LArDSPConfigWrite::m_attrListNC
std::unique_ptr< AthenaAttributeList > m_attrListNC
Definition: LArDSPConfig.h:84
LArDSPConfig::useMGRampIntercept
bool useMGRampIntercept(const HWIdentifier FEBid) const
Definition: LArDSPConfig.h:44
LArOnlineID_Base::febHashMax
size_type febHashMax(void) const
define feb hash tables max size
Definition: LArOnlineID_Base.cxx:1896
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
LArDSPConfig::useMGRampInterceptByHash
bool useMGRampInterceptByHash(const IdentifierHash &febHash) const
Definition: LArDSPConfig.cxx:33
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
LArDSPConfig::MGRAMPINTERCEPT_MASK
@ MGRAMPINTERCEPT_MASK
Definition: LArDSPConfig.h:30
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
LArDSPConfig::PEAKSAMPLE_MASK
@ PEAKSAMPLE_MASK
Definition: LArDSPConfig.h:28
LArCondFlatBase::m_isInitialized
bool m_isInitialized
Definition: LArCondFlatBase.h:28
LArCondFlatBase::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArCondFlatBase.h:29
LArDSPConfig::LGRAMPINTERCEPT_MASK
@ LGRAMPINTERCEPT_MASK
Definition: LArDSPConfig.h:31
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
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
lumiFormat.i
int i
Definition: lumiFormat.py:92
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArDSPConfig::HGRAMPINTERCEPT_MASK
@ HGRAMPINTERCEPT_MASK
Definition: LArDSPConfig.h:29
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
LArDSPConfig::m_pBlob
const uint8_t * m_pBlob
Definition: LArDSPConfig.h:61
LArDSPConfig::peakSampleByHash
uint8_t peakSampleByHash(const IdentifierHash &febHash) const
Definition: LArDSPConfig.cxx:29
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
LArCondFlatBase::initializeBase
StatusCode initializeBase()
Definition: LArCondFlatBase.cxx:29
LArDSPConfigWrite::m_pBlob_nc
uint8_t * m_pBlob_nc
Definition: LArDSPConfig.h:85
LArDSPConfig::m_nFebs
unsigned m_nFebs
Definition: LArDSPConfig.h:62
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
LArDSPConfig::peakSample
uint8_t peakSample(const HWIdentifier FEBid) const
Definition: LArDSPConfig.h:55
LArOnlineID_Base::feb_Hash
IdentifierHash feb_Hash(HWIdentifier febId) const
Create feb hash identifiers from feb identifiers.
Definition: LArOnlineID_Base.cxx:1516