ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LVL1TGC::TGCBIS78 Class Reference

#include <TGCBIS78.h>

Inheritance diagram for LVL1TGC::TGCBIS78:
Collaboration diagram for LVL1TGC::TGCBIS78:

Public Member Functions

 TGCBIS78 ()
 
virtual ~TGCBIS78 ()=default
 
 TGCBIS78 (const TGCBIS78 &right)=delete
 
const TGCBIS78operator= (const TGCBIS78 &right)=delete
 
bool operator== (const TGCBIS78 &right) const =delete
 
bool operator!= (const TGCBIS78 &right) const =delete
 
StatusCode retrieve (SG::ReadHandleKey< Muon::RpcBis78_TrigRawDataContainer > key)
 
std::shared_ptr< const BIS78TrigOutgetOutput (int TGC_TriggerSector) const
 
void print () const
 
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

std::shared_ptr< BIS78TrigOutm_buffer [kNPadBoards]
 

Private Member Functions

void setOutput (unsigned int BIS78PadBoard, uint8_t BIS78eta_6bit, uint8_t BIS78phi_6bit, uint8_t BIS78Deta_3bit, uint8_t BIS78Dphi_3bit, uint8_t BIS78flag3over3eta_1bit, uint8_t BIS78flag3over3phi_1bit)
 
void eraseOutput ()
 
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...
 

Static Private Attributes

static constexpr unsigned int kNPadBoards = 8
 

Detailed Description

Definition at line 20 of file TGCBIS78.h.

Constructor & Destructor Documentation

◆ TGCBIS78() [1/2]

LVL1TGC::TGCBIS78::TGCBIS78 ( )

Definition at line 12 of file TGCBIS78.cxx.

13 : AthMessaging("LVL1TGC::TGCBIS78") {
14  for (size_t PadBoard=0; PadBoard < kNPadBoards; PadBoard++) {
15  std::vector<int> vecPadBoard;
16  vecPadBoard.push_back(PadBoard);
17  m_buffer[PadBoard].reset(new BIS78TrigOut(vecPadBoard));
18  }
19 }

◆ ~TGCBIS78()

virtual LVL1TGC::TGCBIS78::~TGCBIS78 ( )
virtualdefault

◆ TGCBIS78() [2/2]

LVL1TGC::TGCBIS78::TGCBIS78 ( const TGCBIS78 right)
delete

Member Function Documentation

◆ eraseOutput()

void LVL1TGC::TGCBIS78::eraseOutput ( )
private

Definition at line 79 of file TGCBIS78.cxx.

80 {
81  for (size_t idx=0; idx < kNPadBoards; idx++){
82  m_buffer[idx]->clear();
83  }
84 }

◆ getOutput()

std::shared_ptr< const BIS78TrigOut > LVL1TGC::TGCBIS78::getOutput ( int  TGC_TriggerSector) const

Definition at line 51 of file TGCBIS78.cxx.

52 {
53  std::shared_ptr<BIS78TrigOut> trigBIS78_output;
54  trigBIS78_output.reset(new BIS78TrigOut());
55  trigBIS78_output->clear();
56  if ( TGC_TriggerSector<0 || TGC_TriggerSector>47 ) return 0;
57  int BIS78_TriggerSect = (TGC_TriggerSector - 2)/6;
58  if(TGC_TriggerSector < 2) BIS78_TriggerSect=7;
59  if(BIS78_TriggerSect>=0 && BIS78_TriggerSect<=7){
60  *trigBIS78_output+=*m_buffer[BIS78_TriggerSect];
61  }
62 
63  return trigBIS78_output;
64 }

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

◆ operator!=()

bool LVL1TGC::TGCBIS78::operator!= ( const TGCBIS78 right) const
delete

◆ operator=()

const TGCBIS78& LVL1TGC::TGCBIS78::operator= ( const TGCBIS78 right)
delete

◆ operator==()

bool LVL1TGC::TGCBIS78::operator== ( const TGCBIS78 right) const
delete

◆ print()

void LVL1TGC::TGCBIS78::print ( ) const

Definition at line 86 of file TGCBIS78.cxx.

87 {
88  for (size_t idx=0; idx < kNPadBoards; idx++){
89  m_buffer[idx]->print();
90  }
91 }

◆ retrieve()

StatusCode LVL1TGC::TGCBIS78::retrieve ( SG::ReadHandleKey< Muon::RpcBis78_TrigRawDataContainer key)

Definition at line 22 of file TGCBIS78.cxx.

22  {
23  ATH_MSG_DEBUG("retrieve");
24 
25  this->eraseOutput();
26 
27  //The following part will be available when RPC BIS78 Trigger Output is available.
28  SG::ReadHandle<Muon::RpcBis78_TrigRawDataContainer> readBIS78_TrigRawDataContainer(key);
29  if(!readBIS78_TrigRawDataContainer.isValid()){
30  ATH_MSG_ERROR("Cannot retrieve RPC BIS78 TrigRawData Container.");
31  return StatusCode::FAILURE;
32  }
33  const Muon::RpcBis78_TrigRawDataContainer* bis78_TrigRawDataContainer = readBIS78_TrigRawDataContainer.cptr();
34  for(const Muon::RpcBis78_TrigRawData* bis78_sector : *bis78_TrigRawDataContainer){
35  if ( bis78_sector->sideId() != 1 ) continue; // BIS78 is only in A side!
36  for(const Muon::RpcBis78_TrigRawDataSegment* bis78_hit : *bis78_sector){
37  this->setOutput(bis78_sector->sectorId(),
38  bis78_hit->etaIndex(), // Eta-index
39  bis78_hit->phiIndex(), // Phi-index
40  bis78_hit->deltaEta(), // Delta eta
41  bis78_hit->deltaPhi(), // Delta phi
42  bis78_hit->flag3over3Eta(), //
43  bis78_hit->flag3over3Phi() );
44  }
45  }
46 
47  return StatusCode::SUCCESS;
48 }

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

◆ setOutput()

void LVL1TGC::TGCBIS78::setOutput ( unsigned int  BIS78PadBoard,
uint8_t  BIS78eta_6bit,
uint8_t  BIS78phi_6bit,
uint8_t  BIS78Deta_3bit,
uint8_t  BIS78Dphi_3bit,
uint8_t  BIS78flag3over3eta_1bit,
uint8_t  BIS78flag3over3phi_1bit 
)
private

Definition at line 66 of file TGCBIS78.cxx.

66  {
67 
68  if (BIS78PadBoard >= kNPadBoards) return;
69  m_buffer[BIS78PadBoard]->setBIS78PadBoard(BIS78PadBoard);
70  m_buffer[BIS78PadBoard]->setEta(BIS78eta_6bit);
71  m_buffer[BIS78PadBoard]->setPhi(BIS78phi_6bit);
72  m_buffer[BIS78PadBoard]->setDeta(BIS78Deta_3bit);
73  m_buffer[BIS78PadBoard]->setDphi(BIS78Dphi_3bit);
74  m_buffer[BIS78PadBoard]->setflag3over3eta(BIS78flag3over3eta_1bit);
75  m_buffer[BIS78PadBoard]->setflag3over3phi(BIS78flag3over3phi_1bit);
76 }

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.

◆ kNPadBoards

constexpr unsigned int LVL1TGC::TGCBIS78::kNPadBoards = 8
staticconstexprprivate

Definition at line 40 of file TGCBIS78.h.

◆ m_buffer

std::shared_ptr<BIS78TrigOut> LVL1TGC::TGCBIS78::m_buffer[kNPadBoards]
protected

Definition at line 43 of file TGCBIS78.h.

◆ m_imsg

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

MessageSvc pointer.

Definition at line 135 of file AthMessaging.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_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.


The documentation for this class was generated from the following files:
LVL1TGC::TGCBIS78::m_buffer
std::shared_ptr< BIS78TrigOut > m_buffer[kNPadBoards]
Definition: TGCBIS78.h:43
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
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
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LVL1TGC::TGCBIS78::setOutput
void setOutput(unsigned int BIS78PadBoard, uint8_t BIS78eta_6bit, uint8_t BIS78phi_6bit, uint8_t BIS78Deta_3bit, uint8_t BIS78Dphi_3bit, uint8_t BIS78flag3over3eta_1bit, uint8_t BIS78flag3over3phi_1bit)
Definition: TGCBIS78.cxx:66
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Muon::RpcBis78_TrigRawDataContainer
Definition: RpcBis78_TrigRawDataContainer.h:21
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
LVL1TGC::TGCBIS78::eraseOutput
void eraseOutput()
Definition: TGCBIS78.cxx:79
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
LVL1TGC::TGCBIS78::kNPadBoards
static constexpr unsigned int kNPadBoards
Definition: TGCBIS78.h:40
Muon::RpcBis78_TrigRawData
Definition: RpcBis78_TrigRawData.h:22
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
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Muon::RpcBis78_TrigRawDataSegment
Definition: RpcBis78_TrigRawDataSegment.h:21