ATLAS Offline Software
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 
7 namespace LVL1TGCTrigger {
8 
11  {
12  m_sideId = -1;
13  m_slotId = -1;
14  m_tgcArgs = nullptr;
16  }
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 
87  unsigned short TGCInnerTrackletSlot::getTriggerWord() const{
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
LVL1TGCTrigger::TGCInnerTrackletSlot::NUMBER_OF_TRIGGER_BITS
@ NUMBER_OF_TRIGGER_BITS
Definition: TGCInnerTrackletSlot.h:39
LVL1TGCTrigger::TGCInnerTrackletSlot::m_triggerBit
bool m_triggerBit[NUMBER_OF_REGIONS][NUMBER_OF_READOUTS][NUMBER_OF_TRIGGER_BITS]
Definition: TGCInnerTrackletSlot.h:52
TGCInnerTrackletSlot.h
LVL1TGCTrigger::TGCInnerTrackletSlot::NUMBER_OF_READOUTS
@ NUMBER_OF_READOUTS
Definition: TGCInnerTrackletSlot.h:38
LVL1TGCTrigger::TGCInnerTrackletSlot::setSideId
void setSideId(const int sideId)
Definition: TGCInnerTrackletSlot.cxx:22
LVL1TGCTrigger::TGCInnerTrackletSlot::getTriggerWord
unsigned short getTriggerWord() const
Definition: TGCInnerTrackletSlot.cxx:87
LVL1TGCTrigger::TGCInnerTrackletSlot::getTriggerBit
bool getTriggerBit(const unsigned int region, const unsigned int readout, const unsigned int iBit) const
Definition: TGCInnerTrackletSlot.cxx:57
LVL1TGCTrigger::TGCInnerTrackletSlot::setTriggerBit
bool setTriggerBit(const unsigned int region, const unsigned int readout, const unsigned int iBit, const bool triggerBit)
Definition: TGCInnerTrackletSlot.cxx:49
LVL1TGCTrigger::TGCInnerTrackletSlot::setSlotId
void setSlotId(const int slotId)
Definition: TGCInnerTrackletSlot.cxx:30
LVL1TGCTrigger::TGCInnerTrackletSlot::m_slotId
int m_slotId
Definition: TGCInnerTrackletSlot.h:49
LVL1TGCTrigger::TGCInnerTrackletSlot::setTgcArguments
void setTgcArguments(const TGCArguments *)
Definition: TGCInnerTrackletSlot.cxx:18
LVL1TGCTrigger::TGCInnerTrackletSlot::m_sideId
int m_sideId
Definition: TGCInnerTrackletSlot.h:46
LVL1TGCTrigger::TGCInnerTrackletSlot::setTriggerBits
bool setTriggerBits(const bool val)
Definition: TGCInnerTrackletSlot.cxx:38
LVL1TGCTrigger
Definition: LVL1TGCTrigger.cxx:47
LVL1TGCTrigger::TGCInnerTrackletSlot::TGCInnerTrackletSlot
TGCInnerTrackletSlot()
Constructor.
Definition: TGCInnerTrackletSlot.cxx:10
LVL1TGCTrigger::TGCArguments
Definition: TGCArguments.h:12
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
LVL1TGCTrigger::TGCInnerTrackletSlot::getSideId
int getSideId() const
Definition: TGCInnerTrackletSlot.cxx:26
LVL1TGCTrigger::TGCInnerTrackletSlot::NUMBER_OF_REGIONS
@ NUMBER_OF_REGIONS
Definition: TGCInnerTrackletSlot.h:35
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
LVL1TGCTrigger::TGCInnerTrackletSlot::m_tgcArgs
const TGCArguments * m_tgcArgs
Definition: TGCInnerTrackletSlot.h:54
LVL1TGCTrigger::TGCInnerTrackletSlot::setTriggerWord
void setTriggerWord(unsigned int word)
Definition: TGCInnerTrackletSlot.cxx:75
LVL1TGCTrigger::TGCInnerTrackletSlot::clearTriggerBits
void clearTriggerBits()
Definition: TGCInnerTrackletSlot.cxx:65
LVL1TGCTrigger::TGCInnerTrackletSlot::getSlotId
int getSlotId() const
Definition: TGCInnerTrackletSlot.cxx:34