ATLAS Offline Software
TGCChannelSLBIn.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8 
9 namespace MuonTGC_Cabling
10 {
11 
12 // Constructor
14  TGCIdBase::ModuleType vmodule,
15  TGCIdBase::RegionType vregion,
16  int vsector,
17  int vid,
18  int vchannel)
19  : TGCChannelId(TGCIdBase::SLBIn)
20 {
21  setSideType(vside);
22  setModuleType(vmodule);
23  setRegionType(vregion);
24  setSector(vsector);
25  setId(vid);
27 }
28 
30 {
31  return (new TGCModuleSLB(getSideType(),
32  getModuleType(),
33  getRegionType(),
34  getSector(),
35  getId()));
36 }
37 
38 bool TGCChannelSLBIn::isValid(void) const
39 {
46  (getOctant() >=0) &&
47  (getOctant() <8) &&
48  (getId() >=0) &&
49  (getChannel() >=0) &&
51  (m_channelInSLB >=0) )
52  return true;
53  return false;
54 }
55 
56 
57 // Trig A B C D
58 const int TGCChannelSLBIn::s_lengthCell[] = {40, 36, 36, 44, 44};
59 const int TGCChannelSLBIn::s_offsetCell[] = { 0, 40, 76,112,156};
60 const int TGCChannelSLBIn::s_lengthWD[] = {40, 36, 36, 44, 44};
61 const int TGCChannelSLBIn::s_lengthSD[] = {40, 32, 32, 32, 32};
62 const int TGCChannelSLBIn::s_lengthWT[] = {40, 36, 36, 36, 36};
63 const int TGCChannelSLBIn::s_lengthST[] = {40, 32, 32, 32, 32};
64 const int TGCChannelSLBIn::s_adjacentCell[]= { 0, 2, 2, 6, 6};
65 const int TGCChannelSLBIn::s_adjacentWD[] = { 0, 2, 2, 6, 6};
66 const int TGCChannelSLBIn::s_adjacentSD[] = { 0, 0, 0, 0, 0};
67 const int TGCChannelSLBIn::s_adjacentWT[] = { 0, 2, 2, 2, 2};
68 const int TGCChannelSLBIn::s_adjacentST[] = { 0, 0, 0, 0, 0};
69 
70 
72  return s_lengthCell[cellType];
73 }
74 
76  return s_offsetCell[cellType];
77 }
78 
80  CellType cellType) {
81  switch(moduleType){
82  case TGCIdBase::WD:
83  return s_lengthWD[cellType];
84  case TGCIdBase::SD:
85  return s_lengthSD[cellType];
86  case TGCIdBase::WT:
87  return s_lengthWT[cellType];
88  case TGCIdBase::ST:
89  return s_lengthST[cellType];
90  case TGCIdBase::WI:
91  return s_lengthST[cellType];
92  case TGCIdBase::SI:
93  return s_lengthST[cellType];
94  default:
95  break;
96  }
97  return -1;
98 }
99 
101  return s_adjacentCell[cellType];
102 }
103 
105  CellType cellType) {
106  switch(moduleType){
107  case TGCIdBase::WD:
108  return s_adjacentWD[cellType];
109  case TGCIdBase::SD:
110  return s_adjacentSD[cellType];
111  case TGCIdBase::WT:
112  return s_adjacentWT[cellType];
113  case TGCIdBase::ST:
114  return s_adjacentST[cellType];
115  case TGCIdBase::WI:
116  return s_adjacentST[cellType];
117  case TGCIdBase::SI:
118  return s_adjacentST[cellType];
119  default:
120  break;
121  }
122  return -1;
123 
124 }
125 
130  }
133  return channel-getOffsetOfCell(CellA);
134  }
137  return channel-getOffsetOfCell(CellB);
138  }
141  return channel-getOffsetOfCell(CellC);
142  }
145  return channel-getOffsetOfCell(CellD);
146  }
147  return -1;
148 }
149 
153  return CellTrig;
154  }
157  return CellA;
158  }
161  return CellB;
162  }
165  return CellC;
166  }
169  return CellD;
170  }
171  return NoCellType;
172 }
173 
175  CellType cellType, int channel) {
176  int offset = getAdjacentOfCell(cellType)
177  -getAdjacentOfSLB(moduleType, cellType);
178  return channel-offset;
179 }
180 
182  CellType cellType, int channelInSLB) {
183  int offset = getAdjacentOfCell(cellType)
184  -getAdjacentOfSLB(moduleType, cellType);
185  return getOffsetOfCell(cellType)+offset+channelInSLB;
186 }
187 
189  return m_channelInCell;
190 }
191 
193  return m_channelInSLB;
194 }
195 
196 void TGCChannelSLBIn::setChannel(int vchannel) {
197  TGCId::setChannel(vchannel);
198  m_cellType = convertCellType(vchannel);
201  getChannelInCell());
202 }
203 
204 
205 } // end of namespace
MuonTGC_Cabling::TGCChannelSLBIn::s_adjacentST
static const int s_adjacentST[]
Definition: TGCChannelSLBIn.h:75
MuonTGC_Cabling::TGCId::setRegionType
void setRegionType(RegionType region)
Definition: TGCId.cxx:99
TGCIdBase::getRegionType
RegionType getRegionType(void) const
Definition: TGCIdBase.cxx:41
MuonTGC_Cabling::TGCChannelSLBIn::setChannel
virtual void setChannel(int channel)
Definition: TGCChannelSLBIn.cxx:196
MuonTGC_Cabling::TGCChannelSLBIn::s_lengthWD
static const int s_lengthWD[]
Definition: TGCChannelSLBIn.h:67
TGCIdBase::NoRegionType
@ NoRegionType
Definition: TGCIdBase.h:39
TGCIdBase::getChannel
virtual int getChannel(void) const
Definition: TGCIdBase.cxx:50
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
MuonTGC_Cabling::TGCChannelSLBIn::CellB
@ CellB
Definition: TGCChannelSLBIn.h:33
MuonTGC_Cabling::TGCChannelSLBIn::getAdjacentOfCell
static int getAdjacentOfCell(CellType cellType)
Definition: TGCChannelSLBIn.cxx:100
MuonTGC_Cabling::TGCChannelSLBIn::CellC
@ CellC
Definition: TGCChannelSLBIn.h:33
MuonTGC_Cabling::TGCChannelSLBIn::s_adjacentCell
static const int s_adjacentCell[]
Definition: TGCChannelSLBIn.h:71
MuonTGC_Cabling::TGCChannelSLBIn::getChannelInCell
virtual int getChannelInCell(void) const
Definition: TGCChannelSLBIn.cxx:188
TGCIdBase::WT
@ WT
Definition: TGCIdBase.h:33
MuonTGC_Cabling::TGCId::setId
void setId(int id)
Definition: TGCId.cxx:210
TGCIdBase::MaxRegionType
@ MaxRegionType
Definition: TGCIdBase.h:40
MuonTGC_Cabling::TGCModuleSLB
Definition: TGCModuleSLB.h:14
TGCIdBase::MaxModuleType
@ MaxModuleType
Definition: TGCIdBase.h:34
MuonTGC_Cabling::TGCId::setModuleType
void setModuleType(ModuleType module)
Definition: TGCId.cxx:51
MuonTGC_Cabling::TGCChannelSLBIn::getLengthOfCell
static int getLengthOfCell(CellType cellType)
Definition: TGCChannelSLBIn.cxx:71
TGCIdBase::SD
@ SD
Definition: TGCIdBase.h:33
MuonTGC_Cabling::TGCId::setSideType
void setSideType(SideType side)
Definition: TGCId.cxx:47
MuonTGC_Cabling::TGCId::setSector
virtual void setSector(int sector)
Definition: TGCId.cxx:115
MuonTGC_Cabling::TGCChannelSLBIn::getAdjacentOfSLB
static int getAdjacentOfSLB(TGCIdBase::ModuleType moduleType, CellType cellType)
Definition: TGCChannelSLBIn.cxx:104
MuonTGC_Cabling::TGCChannelSLBIn::s_adjacentSD
static const int s_adjacentSD[]
Definition: TGCChannelSLBIn.h:73
MuonTGC_Cabling::TGCChannelSLBIn::convertChannelInSLB
static int convertChannelInSLB(TGCIdBase::ModuleType moduleType, CellType cellType, int channel)
Definition: TGCChannelSLBIn.cxx:174
TGCIdBase::getModuleType
ModuleType getModuleType(void) const
Definition: TGCIdBase.cxx:38
TGCIdBase::getSector
virtual int getSector(void) const
Definition: TGCIdBase.cxx:45
TGCIdBase::WI
@ WI
Definition: TGCIdBase.h:33
MuonTGC_Cabling::TGCChannelSLBIn::s_lengthCell
static const int s_lengthCell[]
Definition: TGCChannelSLBIn.h:65
MuonTGC_Cabling::TGCChannelSLBIn::isValid
virtual bool isValid(void) const
Definition: TGCChannelSLBIn.cxx:38
MuonTGC_Cabling::TGCChannelSLBIn::m_cellType
CellType m_cellType
Definition: TGCChannelSLBIn.h:61
TGCIdBase::NoModuleType
@ NoModuleType
Definition: TGCIdBase.h:33
MuonTGC_Cabling::TGCChannelSLBIn::s_lengthST
static const int s_lengthST[]
Definition: TGCChannelSLBIn.h:70
MuonTGC_Cabling::TGCChannelSLBIn::m_channelInCell
int m_channelInCell
Definition: TGCChannelSLBIn.h:62
MuonTGC_Cabling::TGCChannelSLBIn::convertChannelInCell
static int convertChannelInCell(int channel)
Definition: TGCChannelSLBIn.cxx:126
TGCIdBase::ModuleType
ModuleType
Definition: TGCIdBase.h:33
MuonTGC_Cabling
Definition: TGCCable.h:13
MuonTGC_Cabling::TGCChannelSLBIn::m_channelInSLB
int m_channelInSLB
Definition: TGCChannelSLBIn.h:63
TGCIdBase::getSideType
SideType getSideType(void) const
Definition: TGCIdBase.cxx:37
MuonTGC_Cabling::TGCChannelSLBIn::NoCellType
@ NoCellType
Definition: TGCChannelSLBIn.h:32
MuonTGC_Cabling::TGCChannelSLBIn::getModule
virtual TGCModuleId * getModule(void) const
Definition: TGCChannelSLBIn.cxx:29
MuonTGC_Cabling::TGCChannelSLBIn::CellA
@ CellA
Definition: TGCChannelSLBIn.h:33
TGCIdBase::RegionType
RegionType
Definition: TGCIdBase.h:39
MuonTGC_Cabling::TGCChannelSLBIn::convertCellType
static CellType convertCellType(int channel)
Definition: TGCChannelSLBIn.cxx:150
TGCIdBase::ST
@ ST
Definition: TGCIdBase.h:33
TGCIdBase
Definition: TGCIdBase.h:18
MuonTGC_Cabling::TGCChannelSLBIn::s_offsetCell
static const int s_offsetCell[]
Definition: TGCChannelSLBIn.h:66
MuonTGC_Cabling::TGCChannelId
Definition: TGCChannelId.h:15
TGCChannelSLBIn.h
TGCIdBase::NoSideType
@ NoSideType
Definition: TGCIdBase.h:31
MuonTGC_Cabling::TGCChannelSLBIn::s_lengthWT
static const int s_lengthWT[]
Definition: TGCChannelSLBIn.h:69
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
MuonTGC_Cabling::TGCChannelSLBIn::CellType
CellType
Definition: TGCChannelSLBIn.h:32
TGCIdBase::getOctant
int getOctant(void) const
Definition: TGCIdBase.cxx:44
MuonTGC_Cabling::TGCChannelSLBIn::TGCChannelSLBIn
TGCChannelSLBIn(void)
Definition: TGCChannelSLBIn.h:77
MuonTGC_Cabling::TGCChannelSLBIn::CellD
@ CellD
Definition: TGCChannelSLBIn.h:33
MuonTGC_Cabling::TGCChannelSLBIn::convertChannel
static int convertChannel(TGCIdBase::ModuleType moduleType, CellType cellType, int channelInSLB)
Definition: TGCChannelSLBIn.cxx:181
MuonTGC_Cabling::TGCChannelSLBIn::getOffsetOfCell
static int getOffsetOfCell(CellType cellType)
Definition: TGCChannelSLBIn.cxx:75
TGCIdBase::SideType
SideType
Definition: TGCIdBase.h:31
MuonTGC_Cabling::TGCChannelSLBIn::getCellType
virtual CellType getCellType(void) const
Definition: TGCChannelSLBIn.h:50
MuonTGC_Cabling::TGCChannelSLBIn::getChannelInSLB
virtual int getChannelInSLB(void) const
Definition: TGCChannelSLBIn.cxx:192
MuonTGC_Cabling::TGCModuleId
Definition: TGCModuleId.h:14
TGCIdBase::MaxSideType
@ MaxSideType
Definition: TGCIdBase.h:32
TGCModuleSLB.h
MuonTGC_Cabling::TGCChannelSLBIn::s_adjacentWD
static const int s_adjacentWD[]
Definition: TGCChannelSLBIn.h:72
TGCIdBase::getId
int getId(void) const
Definition: TGCIdBase.cxx:48
TGCIdBase::SI
@ SI
Definition: TGCIdBase.h:33
MuonTGC_Cabling::TGCChannelSLBIn::s_adjacentWT
static const int s_adjacentWT[]
Definition: TGCChannelSLBIn.h:74
MuonTGC_Cabling::TGCChannelSLBIn::CellTrig
@ CellTrig
Definition: TGCChannelSLBIn.h:33
MuonTGC_Cabling::TGCChannelSLBIn::getLengthOfSLB
static int getLengthOfSLB(TGCIdBase::ModuleType moduleType, CellType cellType)
Definition: TGCChannelSLBIn.cxx:79
MuonTGC_Cabling::TGCId::setChannel
virtual void setChannel(int channel)
Definition: TGCId.cxx:218
TGCIdBase::WD
@ WD
Definition: TGCIdBase.h:33
MuonTGC_Cabling::TGCChannelSLBIn::s_lengthSD
static const int s_lengthSD[]
Definition: TGCChannelSLBIn.h:68