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

◆ ~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 76 of file TGCBIS78CoincidenceMap.cxx.

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

◆ getVersion()

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

Definition at line 33 of file TGCBIS78CoincidenceMap.h.

33 { 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 91 of file TGCBIS78CoincidenceMap.cxx.

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

◆ 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 36 of file TGCBIS78CoincidenceMap.h.

36 { return m_tgcArgs;}

◆ tgcArgs() [2/2]

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

Definition at line 37 of file TGCBIS78CoincidenceMap.h.

37 { return m_tgcArgs;}

◆ TGCBIS78_pt()

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

Definition at line 56 of file TGCBIS78CoincidenceMap.cxx.

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

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_CW

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

Definition at line 47 of file TGCBIS78CoincidenceMap.h.

◆ m_flagROI

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

Definition at line 49 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 54 of file TGCBIS78CoincidenceMap.h.

◆ m_verName

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

Definition at line 52 of file TGCBIS78CoincidenceMap.h.

◆ N_DETA

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

Definition at line 43 of file TGCBIS78CoincidenceMap.h.

◆ N_DPHI

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

Definition at line 44 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:49
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:91
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:43
LVL1TGC::TGCBIS78CoincidenceMap::m_tgcArgs
LVL1TGCTrigger::TGCArguments * m_tgcArgs
Definition: TGCBIS78CoincidenceMap.h:54
LVL1TGC::TGCBIS78CoincidenceMap::m_verName
std::string m_verName
Definition: TGCBIS78CoincidenceMap.h:52
LVL1TGC::TGCBIS78CoincidenceMap::m_CW
std::vector< short int > m_CW[N_DETA][N_DPHI]
Definition: TGCBIS78CoincidenceMap.h:47
LVL1TGC::TGCBIS78CoincidenceMap::N_DPHI
static constexpr unsigned int N_DPHI
Definition: TGCBIS78CoincidenceMap.h:44
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
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:36
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
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