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

#include <LArRampFlat.h>

Inheritance diagram for LArRampFlat:
Collaboration diagram for LArRampFlat:

Public Types

typedef LArVectorProxy RampRef_t
 This class defines the interface for accessing Ramp @stereotype Interface. More...
 
enum  { ERRORCODE = LArElecCalib::ERRORCODE }
 

Public Member Functions

 LArRampFlat (const CondAttrListCollection *attrList)
 
virtual ~LArRampFlat ()
 
bool good () const
 
virtual RampRef_t ADC2DAC (const HWIdentifier &CellID, int gain) 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 Member Functions

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

Protected Attributes

bool m_isInitialized
 
const LArOnlineIDm_onlineHelper
 
unsigned m_nChannels
 
unsigned m_nPoints
 

Private Member Functions

 LArRampFlat ()
 
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...
 
std::vector< const float * > m_pRamp
 

Detailed Description

Definition at line 17 of file LArRampFlat.h.

Member Typedef Documentation

◆ RampRef_t

This class defines the interface for accessing Ramp @stereotype Interface.

Author
H. Ma
Version
0-0-1 , 22/08/2002

Modifications: W. Lampl, S. Laplace, 10/12/2003:

  • Add method using online ID
  • Add 3rd argument isOffline S. Laplace, 16/01/2004: WARNING -> IMPORTANT CHANGE !
  • ILArRamp now contains the ADC to DAC conversion factor only (not ADC to GeV anymore). S. Laplace, 08/02/2004
  • new online ID

Definition at line 31 of file ILArRamp.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
ERRORCODE 

Definition at line 20 of file LArRampBlob.h.

Constructor & Destructor Documentation

◆ LArRampFlat() [1/2]

LArRampFlat::LArRampFlat ( )
private

Definition at line 9 of file LArRampFlat.cxx.

10  : LArCondFlatBase("LArRampFlat")
11 {}

◆ LArRampFlat() [2/2]

LArRampFlat::LArRampFlat ( const CondAttrListCollection attrList)

Definition at line 16 of file LArRampFlat.cxx.

17  : LArCondFlatBase("LArRampFlat")
18 {
19  if (initializeBase().isFailure()) return;
20 
21  readBlob(attrList,msg());
22 }

◆ ~LArRampFlat()

LArRampFlat::~LArRampFlat ( )
virtual

Definition at line 13 of file LArRampFlat.cxx.

13 {}

Member Function Documentation

◆ ADC2DAC()

LArRampFlat::RampRef_t LArRampFlat::ADC2DAC ( const HWIdentifier CellID,
int  gain 
) const
virtual

Implements ILArRamp.

Definition at line 24 of file LArRampFlat.cxx.

25 {
27 }

◆ ADC2DACByHash()

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

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

◆ good()

bool LArRampFlat::good ( ) const
inline

Definition at line 27 of file LArRampFlat.h.

27 { return m_isInitialized && m_nChannels>0; }

◆ initializeBase()

StatusCode LArCondFlatBase::initializeBase ( )
inherited

Definition at line 26 of file LArCondFlatBase.cxx.

26  {
27 
28  ATH_MSG_DEBUG( "initializeBase " );
29 
30  if (m_isInitialized) {
31  ATH_MSG_DEBUG( "already initialized - returning " );
32  return (StatusCode::SUCCESS);
33  }
34  //Get LArOnlineID....
35  SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
36  ATH_CHECK_WITH_CONTEXT( detStore.isValid(), "LArCondFlatBase" );
37  ATH_CHECK_WITH_CONTEXT( detStore->retrieve(m_onlineHelper,"LArOnlineID"), "LArCondFlatBase" );
38 
39  m_isInitialized = true;
40  ATH_MSG_DEBUG( "end initializeBase ");
41  return (StatusCode::SUCCESS);
42 }

◆ 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 LArRampBlob::readBlob ( const CondAttrListCollection attrList,
MsgStream &  msg 
)
protectedinherited

Definition at line 18 of file LArRampBlob.cxx.

18  {
19  m_nChannels=0;
20  m_nPoints=0;
21  m_pRamp.clear();
22 
23  if (!attrList) return;
24 
26  CondAttrListCollection::const_iterator gainIt_e=attrList->end();
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 }

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

Definition at line 23 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 LArRampBlob::m_nChannels
protectedinherited

Definition at line 37 of file LArRampBlob.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_nPoints

unsigned LArRampBlob::m_nPoints
protectedinherited

Definition at line 38 of file LArRampBlob.h.

◆ m_onlineHelper

const LArOnlineID* LArCondFlatBase::m_onlineHelper
protectedinherited

Definition at line 24 of file LArCondFlatBase.h.

◆ m_pRamp

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

Definition at line 41 of file LArRampBlob.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
LArRampBlob::readBlob
void readBlob(const CondAttrListCollection *attrList, MsgStream &msg)
Definition: LArRampBlob.cxx:18
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
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
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
LArCondFlatBase::m_isInitialized
bool m_isInitialized
Definition: LArCondFlatBase.h:23
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
LArCondFlatBase::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArCondFlatBase.h:24
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
LArCondFlatBase::LArCondFlatBase
LArCondFlatBase(const std::string &name)
Definition: LArCondFlatBase.cxx:19
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
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
LArRampBlob::m_nChannels
unsigned m_nChannels
Definition: LArRampBlob.h:37
LArRampBlob::ERRORCODE
@ ERRORCODE
Definition: LArRampBlob.h:20
LArRampBlob::m_pRamp
std::vector< const float * > m_pRamp
Definition: LArRampBlob.h:41
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
LArRampBlob::m_nPoints
unsigned m_nPoints
Definition: LArRampBlob.h:38
ILArRamp::RampRef_t
LArVectorProxy RampRef_t
This class defines the interface for accessing Ramp @stereotype Interface.
Definition: ILArRamp.h:31
LArRampBlob::ADC2DACByHash
ILArRamp::RampRef_t ADC2DACByHash(const IdentifierHash &hs, int gain) const
Definition: LArRampBlob.h:28
CondAttrListCollection::size
size_type size() const
number of Chan/AttributeList pairs
Definition: CondAttrListCollection.h:322
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
LArCondFlatBase::initializeBase
StatusCode initializeBase()
Definition: LArCondFlatBase.cxx:26
LArElecCalib::ERRORCODE
@ ERRORCODE
Definition: LArCalibErrorCode.h:17
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
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
readCCLHist.float
float
Definition: readCCLHist.py:83