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

#include <TGCBIS78CoincidenceMap.h>

Inheritance diagram for LVL1TGC::TGCBIS78CoincidenceMap:
Collaboration diagram for LVL1TGC::TGCBIS78CoincidenceMap:

Public Member Functions

 TGCBIS78CoincidenceMap (LVL1TGCTrigger::TGCArguments *tgcargs, const std::string &version)
 
virtual ~TGCBIS78CoincidenceMap ()=default
 
 TGCBIS78CoincidenceMap (const TGCBIS78CoincidenceMap &right)
 
int TGCBIS78_pt (const BIS78TrigOut *bis78Out, int) const
 
int getFlagROI (const unsigned int roi, const unsigned int ssc, const unsigned int sec, const unsigned int side) const
 
const std::string & getVersion () const
 
bool readMap ()
 
LVL1TGCTrigger::TGCArgumentstgcArgs ()
 
const LVL1TGCTrigger::TGCArgumentstgcArgs () 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...
 

Private Member Functions

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

Private Attributes

std::vector< short int > m_CW [N_DETA][N_DPHI]
 
int m_flagROI [kNRoiInSSC][kNMaxSSC][kNEndcapTrigSector]
 
std::string m_verName
 
ToolHandle< ITGCTriggerDbToolm_condDbTool
 
LVL1TGCTrigger::TGCArgumentsm_tgcArgs
 
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 N_DETA = 64
 
static constexpr unsigned int N_DPHI = 16
 

Detailed Description

Definition at line 24 of file TGCBIS78CoincidenceMap.h.

Constructor & Destructor Documentation

◆ TGCBIS78CoincidenceMap() [1/3]

LVL1TGC::TGCBIS78CoincidenceMap::TGCBIS78CoincidenceMap ( LVL1TGCTrigger::TGCArguments tgcargs,
const std::string &  version 
)

Definition at line 19 of file TGCBIS78CoincidenceMap.cxx.

20 : AthMessaging("TGCBIS78CoincidenceMap"),
22  m_condDbTool("TGCTriggerDbTool"),
23  m_tgcArgs(tgcargs)
24 {
25  setLevel(tgcArgs()->MSGLEVEL());
26 
27  if(!tgcArgs()->USE_BIS78()){return;}
28 
29  // initialize map
30  for (size_t sec=0; sec < kNEndcapTrigSector; sec++){
31  for (size_t ssc=0; ssc < kNMaxSSC; ssc++){
32  for (size_t pos=0; pos < kNRoiInSSC; pos++){
33  m_flagROI[pos][ssc][sec] = 1;
34  }
35  }
36  }
37 
38  for (size_t dr=0; dr!=N_DETA; dr++) {
39  for (size_t dphi=0; dphi!=N_DPHI; dphi++) {
40  m_CW[dr][dphi].resize(kNumberOfEndcapRoI);
41  std::fill(m_CW[dr][dphi].begin(), m_CW[dr][dphi].end(), 0);
42  }
43  }
44 
45  //---------Read out CW data---------
46  if (!this->readMap()) {
47  // BIS78 trigger flag is set to false when the map reading failed.
48  tgcArgs()->set_USE_BIS78(false);
49  ATH_MSG_INFO("NOT using BIS78");
50  } else {
51  ATH_MSG_INFO("TGC BIS78 CW version of " << m_verName << " is selected");
52  }
53 }

◆ ~TGCBIS78CoincidenceMap()

virtual LVL1TGC::TGCBIS78CoincidenceMap::~TGCBIS78CoincidenceMap ( )
virtualdefault

◆ TGCBIS78CoincidenceMap() [2/3]

LVL1TGC::TGCBIS78CoincidenceMap::TGCBIS78CoincidenceMap ( const TGCBIS78CoincidenceMap right)

◆ TGCBIS78CoincidenceMap() [3/3]

LVL1TGC::TGCBIS78CoincidenceMap::TGCBIS78CoincidenceMap ( )
privatedelete

Member Function Documentation

◆ getFlagROI()

int LVL1TGC::TGCBIS78CoincidenceMap::getFlagROI ( const unsigned int  roi,
const unsigned int  ssc,
const unsigned int  sec,
const unsigned int  side 
) const

Definition at line 77 of file TGCBIS78CoincidenceMap.cxx.

81 {
82  if (side != TGCSide::ASIDE) return 0; // BIS78 only in A side
83 
84  if (roi >= kNRoiInSSC) return -1;
85  if (ssc >= kNMaxSSC) return 0;
86  if (sec >= kNEndcapTrigSector) return -1;
87 
88  // which inner LUT will be implemented
89  return m_flagROI[roi][ssc][sec];
90 }

◆ getVersion()

const std::string& LVL1TGC::TGCBIS78CoincidenceMap::getVersion ( ) const
inline

Definition at line 34 of file TGCBIS78CoincidenceMap.h.

34 { return m_verName; }

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

◆ readMap()

bool LVL1TGC::TGCBIS78CoincidenceMap::readMap ( )

Definition at line 92 of file TGCBIS78CoincidenceMap.cxx.

93 {
94  // no LUT available for TGC-BIS78 coincidence
95  // just return true for now
96 
97  return true;
98 }

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

◆ tgcArgs() [1/2]

LVL1TGCTrigger::TGCArguments* LVL1TGC::TGCBIS78CoincidenceMap::tgcArgs ( )
inline

Definition at line 37 of file TGCBIS78CoincidenceMap.h.

37 { return m_tgcArgs;}

◆ tgcArgs() [2/2]

const LVL1TGCTrigger::TGCArguments* LVL1TGC::TGCBIS78CoincidenceMap::tgcArgs ( ) const
inline

Definition at line 38 of file TGCBIS78CoincidenceMap.h.

38 { return m_tgcArgs;}

◆ TGCBIS78_pt()

int LVL1TGC::TGCBIS78CoincidenceMap::TGCBIS78_pt ( const BIS78TrigOut bis78Out,
int   
) const

Definition at line 57 of file TGCBIS78CoincidenceMap.cxx.

58 {
59  std::vector<uint8_t> bis78Eta_vec=bis78Out->getBIS78eta();
60  std::vector<uint8_t> bis78Phi_vec=bis78Out->getBIS78phi();
61  std::vector<uint8_t> bis78Deta_vec=bis78Out->getBIS78Deta();
62  std::vector<uint8_t> bis78Dphi_vec=bis78Out->getBIS78Dphi();
63  std::vector<uint8_t> bis78flag3over3eta_vec=bis78Out->getBIS78flag3over3eta();
64  std::vector<uint8_t> bis78flag3over3phi_vec=bis78Out->getBIS78flag3over3phi();
65 
66  int pt=0;
67  // temporal algorithm
68  for(unsigned int bis78hit_id=0; bis78hit_id!=bis78Eta_vec.size(); bis78hit_id++){
69  // calculate dR, dPhi bin # from eta/phiIndex?
70  // for now, if there is a hit at BIS78, it returns true always
71  pt=1;
72  }
73 
74  return pt;
75 }

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_condDbTool

ToolHandle<ITGCTriggerDbTool> LVL1TGC::TGCBIS78CoincidenceMap::m_condDbTool
private

Definition at line 55 of file TGCBIS78CoincidenceMap.h.

◆ m_CW

std::vector<short int> LVL1TGC::TGCBIS78CoincidenceMap::m_CW[N_DETA][N_DPHI]
private

Definition at line 48 of file TGCBIS78CoincidenceMap.h.

◆ m_flagROI

int LVL1TGC::TGCBIS78CoincidenceMap::m_flagROI[kNRoiInSSC][kNMaxSSC][kNEndcapTrigSector]
private

Definition at line 50 of file TGCBIS78CoincidenceMap.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.

◆ m_tgcArgs

LVL1TGCTrigger::TGCArguments* LVL1TGC::TGCBIS78CoincidenceMap::m_tgcArgs
private

Definition at line 56 of file TGCBIS78CoincidenceMap.h.

◆ m_verName

std::string LVL1TGC::TGCBIS78CoincidenceMap::m_verName
private

Definition at line 53 of file TGCBIS78CoincidenceMap.h.

◆ N_DETA

constexpr unsigned int LVL1TGC::TGCBIS78CoincidenceMap::N_DETA = 64
staticconstexprprivate

Definition at line 44 of file TGCBIS78CoincidenceMap.h.

◆ N_DPHI

constexpr unsigned int LVL1TGC::TGCBIS78CoincidenceMap::N_DPHI = 16
staticconstexprprivate

Definition at line 45 of file TGCBIS78CoincidenceMap.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
LVL1TGC::TGCBIS78CoincidenceMap::m_flagROI
int m_flagROI[kNRoiInSSC][kNMaxSSC][kNEndcapTrigSector]
Definition: TGCBIS78CoincidenceMap.h:50
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
test_pyathena.pt
pt
Definition: test_pyathena.py:11
LVL1TGC::TGCBIS78CoincidenceMap::readMap
bool readMap()
Definition: TGCBIS78CoincidenceMap.cxx:92
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
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
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TRT::Hit::side
@ side
Definition: HitInfo.h:83
AthMessaging::setLevel
void setLevel(MSG::Level lvl)
Change the current logging level.
Definition: AthMessaging.cxx:28
LVL1TGCTrigger::TGCArguments::set_USE_BIS78
void set_USE_BIS78(bool v)
Definition: TGCArguments.cxx:38
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
LVL1TGC::TGCBIS78CoincidenceMap::N_DETA
static constexpr unsigned int N_DETA
Definition: TGCBIS78CoincidenceMap.h:44
LVL1TGC::TGCBIS78CoincidenceMap::m_tgcArgs
LVL1TGCTrigger::TGCArguments * m_tgcArgs
Definition: TGCBIS78CoincidenceMap.h:56
LVL1TGC::TGCBIS78CoincidenceMap::m_verName
std::string m_verName
Definition: TGCBIS78CoincidenceMap.h:53
LVL1TGC::TGCBIS78CoincidenceMap::m_CW
std::vector< short int > m_CW[N_DETA][N_DPHI]
Definition: TGCBIS78CoincidenceMap.h:48
LVL1TGC::TGCBIS78CoincidenceMap::N_DPHI
static constexpr unsigned int N_DPHI
Definition: TGCBIS78CoincidenceMap.h:45
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
LVL1TGC::ASIDE
@ ASIDE
Definition: TGCNumbering.h:14
get_generator_info.version
version
Definition: get_generator_info.py:33
LVL1TGC::TGCBIS78CoincidenceMap::tgcArgs
LVL1TGCTrigger::TGCArguments * tgcArgs()
Definition: TGCBIS78CoincidenceMap.h:37
lumiFormat.fill
fill
Definition: lumiFormat.py:111
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
LVL1TGC::TGCBIS78CoincidenceMap::m_condDbTool
ToolHandle< ITGCTriggerDbTool > m_condDbTool
Definition: TGCBIS78CoincidenceMap.h:55
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