ATLAS Offline Software
TGCTriggerData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
9 {}
10 
12 {}
13 
14 std::string TGCTriggerData::getType(int cwtype) const
15 {
16  return m_type[cwtype];
17 }
18 
19 bool TGCTriggerData::isActive(int cwtype) const
20 {
21  return m_active[cwtype];
22 }
23 
24 int8_t TGCTriggerData::getTYPE(const int16_t lDR, const int16_t hDR, const int16_t lDPhi, const int16_t hDPhi) const
25 {
26  if((lDR == -DR_HIGH_RANGE) && (hDR == DR_HIGH_RANGE)) {
27  if ((lDPhi == -DPHI_HIGH_RANGE) && (hDPhi == DPHI_HIGH_RANGE)) return COIN_HH;
28  else if((lDPhi == -DPHI_LOW_RANGE) && (hDPhi == DPHI_LOW_RANGE)) return COIN_HL;
29  } else if((lDR == -DR_LOW_RANGE) && (hDR == DR_LOW_RANGE)) {
30  if ((lDPhi == -DPHI_HIGH_RANGE) && (hDPhi == DPHI_HIGH_RANGE)) return COIN_LH;
31  else if((lDPhi == -DPHI_LOW_RANGE) && (hDPhi == DPHI_LOW_RANGE)) return COIN_LL;
32  }
33  return -1;
34 }
35 
37 {
38  std::unordered_map<uint32_t, uint8_t>::const_iterator it = m_ptmap_bw.find(addr);
39  if(it == m_ptmap_bw.end()) return 0x0; // outside from defined window, i.e. pT=0
40  else return it->second;
41 }
42 
43 unsigned short TGCTriggerData::getTrigBitEifi(int side, int slot, int ssc, int sectorId) const
44 {
45  int sideindex = (m_type[CW_EIFI] != "full") ? 0 : side;
46  uint16_t addr = ((sideindex & SIDE_MASK)<<ADDR_SIDE_SHIFT) +
47  ((sectorId & SECTOR_MASK)<<ADDR_SECTOR_SHIFT) +
48  (ssc & SSC_MASK);
49  addr = (addr<<EIFI_TRIGBIT_SHIFT) + slot;
50  std::unordered_map<uint16_t, uint16_t>::const_iterator it = m_trigbit_eifi.find(addr);
51  if(it == m_trigbit_eifi.end()) return 0x0; // undefined sector (or active=0)
52  else return it->second;
53 }
54 
55 unsigned char TGCTriggerData::getFlagPtEifi(int side, int ssc, int sectorId) const
56 {
57  int sideindex = (m_type[CW_EIFI] != "full") ? 0 : side;
58  uint16_t addr = ((sideindex & SIDE_MASK)<<ADDR_SIDE_SHIFT) +
59  ((sectorId & SECTOR_MASK)<<ADDR_SECTOR_SHIFT) +
60  (ssc & SSC_MASK);
61  std::unordered_map<uint16_t, uint8_t>::const_iterator it = m_flagpt_eifi.find(addr);
62  if(it == m_flagpt_eifi.end()) return 0x0; // undefined sector (or active=0)
63  else return it->second;
64 }
65 
66 unsigned char TGCTriggerData::getFlagRoiEifi(int side, int ssc, int sectorId) const
67 {
68  int sideindex = (m_type[CW_EIFI] != "full") ? 0 : side;
69  uint16_t addr = ((sideindex & SIDE_MASK)<<ADDR_SIDE_SHIFT) +
70  ((sectorId & SECTOR_MASK)<<ADDR_SECTOR_SHIFT) +
71  (ssc & SSC_MASK);
72  std::unordered_map<uint16_t, uint8_t>::const_iterator it = m_flagroi_eifi.find(addr);
73  if(it == m_flagroi_eifi.end()) return 0x0; // undefined sector (or active=0)
74  else return it->second;
75 }
76 
77 uint16_t TGCTriggerData::getTrigMaskTile(int ssc, int sectorId, int side) const
78 {
79  uint16_t addr = ((side & SIDE_MASK)<<ADDR_SIDE_SHIFT) +
80  ((sectorId & SECTOR_MASK)<<ADDR_SECTOR_SHIFT) +
81  (ssc & SSC_MASK);
82  std::unordered_map<uint16_t, uint16_t>::const_iterator it = m_trigbit_tile.find(addr);
83  if(it == m_trigbit_tile.end()) return 0x0; // undefined sector (or active=0)
84  else return it->second;
85 }
86 
87 uint8_t TGCTriggerData::getFlagPtTile(int ssc, int sectorId, int side) const
88 {
89  uint16_t addr = ((side & SIDE_MASK)<<ADDR_SIDE_SHIFT) +
90  ((sectorId & SECTOR_MASK)<<ADDR_SECTOR_SHIFT) +
91  (ssc & SSC_MASK);
92  std::unordered_map<uint16_t, uint8_t>::const_iterator it = m_flagpt_tile.find(addr);
93  if(it == m_flagpt_tile.end()) return 0x0; // undefined sector (or active=0)
94  else return it->second;
95 }
96 
97 uint8_t TGCTriggerData::getFlagRoiTile(int ssc, int sectorId, int side) const
98 {
99  uint16_t addr = ((side & SIDE_MASK)<<ADDR_SIDE_SHIFT) +
100  ((sectorId & SECTOR_MASK)<<ADDR_SECTOR_SHIFT) +
101  (ssc & SSC_MASK);
102  std::unordered_map<uint16_t, uint8_t>::const_iterator it = m_flagroi_tile.find(addr);
103  if(it == m_flagroi_tile.end()) return 0x0; // undefined sector (or active=0)
104  else return it->second;
105 }
106 
TGCTriggerData::SECTOR_MASK
static constexpr uint8_t SECTOR_MASK
Mask for trigger sector for the (EIFI/TILE) ADDR.
Definition: TGCTriggerData.h:150
TGCTriggerData::ADDR_SECTOR_SHIFT
static constexpr uint8_t ADDR_SECTOR_SHIFT
Bit position of the trigger sector bit in the (EIFI/TILE) ADDR.
Definition: TGCTriggerData.h:156
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
TGCTriggerData::DR_LOW_RANGE
static constexpr uint8_t DR_LOW_RANGE
Range of DR in the BW coincidence window for 2-station.
Definition: TGCTriggerData.h:144
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TGCTriggerData::m_trigbit_tile
std::unordered_map< uint16_t, uint16_t > m_trigbit_tile
Definition: TGCTriggerData.h:207
TGCTriggerData::ADDR_SIDE_SHIFT
static constexpr uint8_t ADDR_SIDE_SHIFT
Bit position of the side bit in the (EIFI/TILE) ADDR.
Definition: TGCTriggerData.h:154
TGCTriggerData::CW_EIFI
@ CW_EIFI
Definition: TGCTriggerData.h:160
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
TGCTriggerData::TGCTriggerData
TGCTriggerData()
Definition: TGCTriggerData.cxx:8
TGCTriggerData::EIFI_TRIGBIT_SHIFT
static constexpr uint8_t EIFI_TRIGBIT_SHIFT
Special bit shift for the EIFI Trigger bit.
Definition: TGCTriggerData.h:158
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TGCTriggerData::DPHI_HIGH_RANGE
static constexpr uint8_t DPHI_HIGH_RANGE
Range of DPhi in the BW coincidence window for 3-station.
Definition: TGCTriggerData.h:146
TGCTriggerData::getBigWheelPt
uint8_t getBigWheelPt(const uint32_t addr) const
Definition: TGCTriggerData.cxx:36
TGCTriggerData::SSC_MASK
static constexpr uint8_t SSC_MASK
Mask for SSC for the (EIFI/TILE) ADDR.
Definition: TGCTriggerData.h:152
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
TGCTriggerData::getTrigBitEifi
unsigned short getTrigBitEifi(int side, int slot, int ssc, int sectorId) const
Definition: TGCTriggerData.cxx:43
TGCTriggerData::getFlagRoiTile
uint8_t getFlagRoiTile(int ssc, int sectorId, int side) const
Definition: TGCTriggerData.cxx:97
TGCTriggerData::getTrigMaskTile
unsigned short getTrigMaskTile(int ssc, int sectorId, int side) const
Definition: TGCTriggerData.cxx:77
TGCTriggerData::m_flagpt_tile
std::unordered_map< uint16_t, uint8_t > m_flagpt_tile
Definition: TGCTriggerData.h:205
TGCTriggerData::isActive
bool isActive(int cwtype) const
Definition: TGCTriggerData.cxx:19
TGCTriggerData::m_ptmap_bw
std::unordered_map< uint32_t, uint8_t > m_ptmap_bw
Run-2 BW-CW LUT map.
Definition: TGCTriggerData.h:197
TGCTriggerData::m_active
bool m_active[CW_NUM]
Definition: TGCTriggerData.h:194
TGCTriggerData::getType
std::string getType(int cwtype) const
Definition: TGCTriggerData.cxx:14
TGCTriggerData::COIN_LH
@ COIN_LH
Definition: TGCTriggerData.h:172
TGCTriggerData::COIN_HL
@ COIN_HL
Definition: TGCTriggerData.h:172
TGCTriggerData::SIDE_MASK
static constexpr uint8_t SIDE_MASK
Mask for extracting the side from the GLOBALADDR.
Definition: TGCTriggerData.h:107
TGCTriggerData::DR_HIGH_RANGE
static constexpr uint8_t DR_HIGH_RANGE
Range of DR in the BW coincidence window for 3-station.
Definition: TGCTriggerData.h:142
TGCTriggerData::m_trigbit_eifi
std::unordered_map< uint16_t, uint16_t > m_trigbit_eifi
Definition: TGCTriggerData.h:202
TGCTriggerData::m_flagroi_eifi
std::unordered_map< uint16_t, uint8_t > m_flagroi_eifi
Definition: TGCTriggerData.h:201
TGCTriggerData::getFlagPtEifi
unsigned char getFlagPtEifi(int side, int ssc, int sectorId) const
Definition: TGCTriggerData.cxx:55
TGCTriggerData::m_flagpt_eifi
std::unordered_map< uint16_t, uint8_t > m_flagpt_eifi
Definition: TGCTriggerData.h:200
TGCTriggerData::getTYPE
int8_t getTYPE(const int16_t lDR, const int16_t hDR, const int16_t lDPhi, const int16_t hDPhi) const
Definition: TGCTriggerData.cxx:24
TGCTriggerData::~TGCTriggerData
virtual ~TGCTriggerData()
Definition: TGCTriggerData.cxx:11
TGCTriggerData::m_flagroi_tile
std::unordered_map< uint16_t, uint8_t > m_flagroi_tile
Definition: TGCTriggerData.h:206
AthMessaging.h
TGCTriggerData::COIN_LL
@ COIN_LL
Definition: TGCTriggerData.h:172
TGCTriggerData::getFlagPtTile
unsigned char getFlagPtTile(int ssc, int sectorId, int side) const
Definition: TGCTriggerData.cxx:87
TGCTriggerData::COIN_HH
@ COIN_HH
Definition: TGCTriggerData.h:172
TGCTriggerData::m_type
std::string m_type[CW_NUM]
Definition: TGCTriggerData.h:193
TGCTriggerData::DPHI_LOW_RANGE
static constexpr uint8_t DPHI_LOW_RANGE
Range of DPhi in the BW coincidence window for 2-station.
Definition: TGCTriggerData.h:148
TGCTriggerData::getFlagRoiEifi
unsigned char getFlagRoiEifi(int side, int ssc, int sectorId) const
Definition: TGCTriggerData.cxx:66
TGCTriggerData.h