ATLAS Offline Software
Loading...
Searching...
No Matches
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 (const SG::ReadHandleKey< Muon::RpcBis78_TrigRawDataContainer > &key, const EventContext &ctx)
std::shared_ptr< const BIS78TrigOutgetOutput (int TGC_TriggerSector) const
void print () const
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

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.

Private Attributes

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

Static Private Attributes

static constexpr 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 13 of file TGCBIS78.cxx.

14: AthMessaging("LVL1TGC::TGCBIS78") {
15 for (int PadBoard=0; PadBoard < kNPadBoards; PadBoard++) {
16 m_buffer[PadBoard] = std::make_shared<BIS78TrigOut>(std::vector<int>{PadBoard});
17 }
18}
AthMessaging()
Default constructor:
static constexpr int kNPadBoards
Definition TGCBIS78.h:41
std::shared_ptr< BIS78TrigOut > m_buffer[kNPadBoards]
Definition TGCBIS78.h:44

◆ ~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 74 of file TGCBIS78.cxx.

75{
76 for (size_t idx=0; idx < kNPadBoards; idx++){
77 m_buffer[idx]->clear();
78 }
79}

◆ getOutput()

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

Definition at line 48 of file TGCBIS78.cxx.

49{
50 auto trigBIS78_output = std::make_shared<BIS78TrigOut>();
51 if ( TGC_TriggerSector<0 || TGC_TriggerSector>47 ) return 0;
52 int BIS78_TriggerSect = (TGC_TriggerSector - 2)/6;
53 if(TGC_TriggerSector < 2) BIS78_TriggerSect=7;
54 if(BIS78_TriggerSect>=0 && BIS78_TriggerSect<=7){
55 *trigBIS78_output+=*m_buffer[BIS78_TriggerSect];
56 }
57
58 return trigBIS78_output;
59}

◆ 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 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

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

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

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

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ 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_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ 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 81 of file TGCBIS78.cxx.

82{
83 for (size_t idx=0; idx < kNPadBoards; idx++){
84 m_buffer[idx]->print();
85 }
86}

◆ retrieve()

StatusCode LVL1TGC::TGCBIS78::retrieve ( const SG::ReadHandleKey< Muon::RpcBis78_TrigRawDataContainer > & key,
const EventContext & ctx )

Definition at line 21 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, ctx);
29 ATH_CHECK( readBIS78_TrigRawDataContainer.isValid() );
30
31 for(const Muon::RpcBis78_TrigRawData* bis78_sector : *readBIS78_TrigRawDataContainer){
32 if ( bis78_sector->sideId() != 1 ) continue; // BIS78 is only in A side!
33 for(const Muon::RpcBis78_TrigRawDataSegment* bis78_hit : *bis78_sector){
34 this->setOutput(bis78_sector->sectorId(),
35 bis78_hit->etaIndex(), // Eta-index
36 bis78_hit->phiIndex(), // Phi-index
37 bis78_hit->deltaEta(), // Delta eta
38 bis78_hit->deltaPhi(), // Delta phi
39 bis78_hit->flag3over3Eta(), //
40 bis78_hit->flag3over3Phi() );
41 }
42 }
43
44 return StatusCode::SUCCESS;
45}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
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:61

◆ 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 61 of file TGCBIS78.cxx.

61 {
62
63 if (BIS78PadBoard >= kNPadBoards) return;
64 m_buffer[BIS78PadBoard]->setBIS78PadBoard(BIS78PadBoard);
65 m_buffer[BIS78PadBoard]->setEta(BIS78eta_6bit);
66 m_buffer[BIS78PadBoard]->setPhi(BIS78phi_6bit);
67 m_buffer[BIS78PadBoard]->setDeta(BIS78Deta_3bit);
68 m_buffer[BIS78PadBoard]->setDphi(BIS78Dphi_3bit);
69 m_buffer[BIS78PadBoard]->setflag3over3eta(BIS78flag3over3eta_1bit);
70 m_buffer[BIS78PadBoard]->setflag3over3phi(BIS78flag3over3phi_1bit);
71}

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

int LVL1TGC::TGCBIS78::kNPadBoards = 8
staticconstexprprivate

Definition at line 41 of file TGCBIS78.h.

◆ m_buffer

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

Definition at line 44 of file TGCBIS78.h.

◆ m_imsg

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

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

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