ATLAS Offline Software
Loading...
Searching...
No Matches
TGCInnerTrackletSlot.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace LVL1TGCTrigger {
8
17
19 m_tgcArgs = tgcargs;
20 }
21
22 void TGCInnerTrackletSlot::setSideId(const int sideId) {
23 m_sideId = sideId;
24 }
25
27 return m_sideId;
28 }
29
30 void TGCInnerTrackletSlot::setSlotId(const int slotId) {
31 m_slotId = slotId;
32 }
33
35 return m_slotId;
36 }
37
39 for (int region=0; region<NUMBER_OF_REGIONS; region++){
40 for (int readout=0; readout<NUMBER_OF_READOUTS; readout++){
41 for (int iBit=0; iBit<NUMBER_OF_TRIGGER_BITS; iBit++){
42 m_triggerBit[region][readout][iBit] = val;
43 }
44 }
45 }
46 return true;
47 }
48
49 bool TGCInnerTrackletSlot::setTriggerBit(const unsigned int region, const unsigned int readout, const unsigned int iBit, const bool triggerBit) {
50 if(region>=NUMBER_OF_REGIONS) return false;
51 if(readout>=NUMBER_OF_READOUTS) return false;
52 if(iBit>=NUMBER_OF_TRIGGER_BITS) return false;
53 m_triggerBit[region][readout][iBit] = triggerBit;
54 return true;
55 }
56
57 bool TGCInnerTrackletSlot::getTriggerBit(const unsigned int region, const unsigned int readout, const unsigned int iBit) const {
58 if(region>=NUMBER_OF_REGIONS) return false;
59 if(readout>=NUMBER_OF_READOUTS) return false;
60 if(iBit>=NUMBER_OF_TRIGGER_BITS) return false;
61
62 return m_triggerBit[region][readout][iBit];
63 }
64
66 for(unsigned int region=0; region<NUMBER_OF_REGIONS; region++) {
67 for(unsigned int readout=0; readout<NUMBER_OF_READOUTS; readout++) {
68 for(unsigned int iBit=0; iBit<NUMBER_OF_TRIGGER_BITS; iBit++) {
69 m_triggerBit[region][readout][iBit] = false;
70 }
71 }
72 }
73 }
74
75 void TGCInnerTrackletSlot::setTriggerWord(unsigned int word){
76 unsigned int tstBit =1;
77 for(unsigned int region=0; region<NUMBER_OF_REGIONS; region++) {
78 for(unsigned int readout=0; readout<NUMBER_OF_READOUTS; readout++) {
79 for(unsigned int iBit=0; iBit<NUMBER_OF_TRIGGER_BITS; iBit++) {
80 m_triggerBit[region][readout][iBit] = ((tstBit & word) !=0 );
81 tstBit = tstBit*2;
82 }
83 }
84 }
85 }
86
88 unsigned int word=0;
89 unsigned int pos =0;
90 for(unsigned int region=0; region<NUMBER_OF_REGIONS; region++) {
91 for(unsigned int readout=0; readout<NUMBER_OF_READOUTS; readout++) {
92 for(unsigned int iBit=0; iBit<NUMBER_OF_TRIGGER_BITS; iBit++) {
93 if (m_triggerBit[region][readout][iBit]) {
94 word += 1 << pos;
95 }
96 pos += 1;
97 }
98 }
99 }
100 return word;
101 }
102
103} //end of namespace bracket
bool getTriggerBit(const unsigned int region, const unsigned int readout, const unsigned int iBit) const
bool m_triggerBit[NUMBER_OF_REGIONS][NUMBER_OF_READOUTS][NUMBER_OF_TRIGGER_BITS]
bool setTriggerBit(const unsigned int region, const unsigned int readout, const unsigned int iBit, const bool triggerBit)