ATLAS Offline Software
Loading...
Searching...
No Matches
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
10
13
14std::string TGCTriggerData::getType(int cwtype) const
15{
16 return m_type[cwtype];
17}
18
19bool TGCTriggerData::isActive(int cwtype) const
20{
21 return m_active[cwtype];
22}
23
24int8_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
36uint8_t TGCTriggerData::getBigWheelPt(const uint32_t addr) const
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
43unsigned 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
55unsigned 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
66unsigned 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
77uint16_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
87uint8_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
97uint8_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
uint8_t getFlagRoiTile(int ssc, int sectorId, int side) const
std::unordered_map< uint16_t, uint8_t > m_flagroi_eifi
static constexpr uint8_t SECTOR_MASK
Mask for trigger sector for the (EIFI/TILE) ADDR.
virtual ~TGCTriggerData()
unsigned char getFlagPtTile(int ssc, int sectorId, int side) const
static constexpr uint8_t EIFI_TRIGBIT_SHIFT
Special bit shift for the EIFI Trigger bit.
bool m_active[CW_NUM]
static constexpr uint8_t SIDE_MASK
Mask for extracting the side from the GLOBALADDR.
unsigned short getTrigBitEifi(int side, int slot, int ssc, int sectorId) const
std::unordered_map< uint32_t, uint8_t > m_ptmap_bw
Run-2 BW-CW LUT map.
static constexpr uint8_t DPHI_LOW_RANGE
Range of DPhi in the BW coincidence window for 2-station.
std::unordered_map< uint16_t, uint16_t > m_trigbit_eifi
std::unordered_map< uint16_t, uint8_t > m_flagroi_tile
static constexpr uint8_t DR_HIGH_RANGE
Range of DR in the BW coincidence window for 3-station.
unsigned short getTrigMaskTile(int ssc, int sectorId, int side) const
std::unordered_map< uint16_t, uint8_t > m_flagpt_eifi
unsigned char getFlagRoiEifi(int side, int ssc, int sectorId) const
std::unordered_map< uint16_t, uint16_t > m_trigbit_tile
bool isActive(int cwtype) const
std::unordered_map< uint16_t, uint8_t > m_flagpt_tile
static constexpr uint8_t ADDR_SIDE_SHIFT
Bit position of the side bit in the (EIFI/TILE) ADDR.
std::string getType(int cwtype) const
static constexpr uint8_t DR_LOW_RANGE
Range of DR in the BW coincidence window for 2-station.
static constexpr uint8_t DPHI_HIGH_RANGE
Range of DPhi in the BW coincidence window for 3-station.
uint8_t getBigWheelPt(const uint32_t addr) const
static constexpr uint8_t SSC_MASK
Mask for SSC for the (EIFI/TILE) ADDR.
unsigned char getFlagPtEifi(int side, int ssc, int sectorId) const
int8_t getTYPE(const int16_t lDR, const int16_t hDR, const int16_t lDPhi, const int16_t hDPhi) const
std::string m_type[CW_NUM]
static constexpr uint8_t ADDR_SECTOR_SHIFT
Bit position of the trigger sector bit in the (EIFI/TILE) ADDR.