ATLAS Offline Software
Loading...
Searching...
No Matches
MuonTGC_Cabling::TGCCableInSLB Class Reference

#include <TGCCableInSLB.h>

Inheritance diagram for MuonTGC_Cabling::TGCCableInSLB:
Collaboration diagram for MuonTGC_Cabling::TGCCableInSLB:

Public Types

enum  CableType {
  NoCableType =-1 , InASD , ASDToPP , InPP ,
  PPToSLB , InSLB , SLBToHPB , HPBToSL ,
  SLBToSSW , SSWToROD , MaxCableType
}

Public Member Functions

 TGCCableInSLB (void)
virtual ~TGCCableInSLB ()=default
virtual TGCChannelIdgetChannel (const TGCChannelId *channelId, bool orChannel=false) const
CableType getCableType (void) const

Protected Member Functions

virtual TGCModuleMapgetModuleIn (const TGCModuleId *) const
virtual TGCModuleMapgetModuleOut (const TGCModuleId *) const

Private Member Functions

virtual TGCChannelIdgetChannelIn (const TGCChannelId *slbout, bool orChannel=false) const
virtual TGCChannelIdgetChannelOut (const TGCChannelId *slbin, bool orChannel=false) const

Private Attributes

CableType m_type

Detailed Description

Definition at line 12 of file TGCCableInSLB.h.

Member Enumeration Documentation

◆ CableType

Enumerator
NoCableType 
InASD 
ASDToPP 
InPP 
PPToSLB 
InSLB 
SLBToHPB 
HPBToSL 
SLBToSSW 
SSWToROD 
MaxCableType 

Definition at line 18 of file TGCCable.h.

Constructor & Destructor Documentation

◆ TGCCableInSLB()

MuonTGC_Cabling::TGCCableInSLB::TGCCableInSLB ( void )
inline

Definition at line 15 of file TGCCableInSLB.h.

TGCCable(CableType type=NoCableType)
Definition TGCCable.h:24

◆ ~TGCCableInSLB()

virtual MuonTGC_Cabling::TGCCableInSLB::~TGCCableInSLB ( )
virtualdefault

Member Function Documentation

◆ getCableType()

CableType MuonTGC_Cabling::TGCCable::getCableType ( void ) const
inlineinherited

Definition at line 30 of file TGCCable.h.

30{ return m_type; }

◆ getChannel()

TGCChannelId * MuonTGC_Cabling::TGCCableInSLB::getChannel ( const TGCChannelId * channelId,
bool orChannel = false ) const
virtual

Definition at line 12 of file TGCCableInSLB.cxx.

13 {
14 if(channelId){
15 if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::SLBIn)
16 return getChannelOut(channelId,orChannel);
17 if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::SLBOut)
18 return getChannelIn(channelId,orChannel);
19 }
20 return nullptr;
21}
virtual TGCChannelId * getChannelOut(const TGCChannelId *slbin, bool orChannel=false) const
virtual TGCChannelId * getChannelIn(const TGCChannelId *slbout, bool orChannel=false) const

◆ getChannelIn()

TGCChannelId * MuonTGC_Cabling::TGCCableInSLB::getChannelIn ( const TGCChannelId * slbout,
bool orChannel = false ) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 23 of file TGCCableInSLB.cxx.

24 {
25 if(slbout->isValid()==false) return nullptr;
26
27 int channel = slbout->getChannel();
28 int block = slbout->getBlock();
29 TGCId::ModuleType moduleType = slbout->getModuleType();
30
31 int channelInBlock = TGCChannelSLBOut::getChannelInBlock(moduleType);
32 int numberOfLayer = TGCChannelSLBOut::getNumberOfLayer(moduleType);
33
34 int adjacentOfSLB = -1;
35 int channelInSLB = -1;
37 switch(moduleType){
38 case TGCId::WD:
39 // channel SLBIn
40 // 2*n CellB n+block*16
41 // 2*n+1 CellA n+block*16
42 if(orChannel==false){
43 if(channel%numberOfLayer==1){
44 cellType = TGCChannelSLBIn::CellA;
45 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
46 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
47 +adjacentOfSLB;
48 }
49 if(channel%numberOfLayer==0){
50 cellType = TGCChannelSLBIn::CellB;
51 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
52 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
53 +adjacentOfSLB;
54 }
55 }
56 if(orChannel==true){
57 if(channel%numberOfLayer==1){
58 cellType = TGCChannelSLBIn::CellC;
59 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
60 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
61 +adjacentOfSLB;
62 }
63 if(channel%numberOfLayer==0){
64 cellType = TGCChannelSLBIn::CellD;
65 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
66 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
67 +adjacentOfSLB;
68 }
69 }
70 break;
71 case TGCId::SD:
72 // channel SLBIn
73 // 2*n CellB n+block*16
74 // 2*n+1 CellA n+block*16
75 if(orChannel==false){
76 if(channel%numberOfLayer==1){
77 cellType = TGCChannelSLBIn::CellA;
78 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
79 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
80 +adjacentOfSLB;
81 }
82 if(channel%numberOfLayer==0){
83 cellType = TGCChannelSLBIn::CellB;
84 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
85 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
86 +adjacentOfSLB;
87 }
88 }
89 if(orChannel==true){
90 if(channel%numberOfLayer==1){
91 cellType = TGCChannelSLBIn::CellC;
92 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
93 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
94 +adjacentOfSLB;
95 }
96 if(channel%numberOfLayer==0){
97 cellType = TGCChannelSLBIn::CellD;
98 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
99 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
100 +adjacentOfSLB;
101 }
102 }
103 break;
104 case TGCId::WT:
105 // channel SLBIn
106 // 3*n CellC n+block*16
107 // 3*n+1 CellB n+block*16
108 // 3*n+2 CellA n+block*16
109 if((channel+block*channelInBlock)%numberOfLayer==2){
110 cellType = TGCChannelSLBIn::CellA;
111 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
112 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
113 +adjacentOfSLB;
114 }
115 if((channel+block*channelInBlock)%numberOfLayer==1){
116 cellType = TGCChannelSLBIn::CellB;
117 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
118 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
119 +adjacentOfSLB;
120 }
121 if((channel+block*channelInBlock)%numberOfLayer==0){
122 cellType = TGCChannelSLBIn::CellC;
123 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
124 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
125 +adjacentOfSLB;
126 }
127 break;
128 case TGCId::ST:
129 case TGCId::WI:
130 case TGCId::SI:
131 // channel SLBIn
132 // 2*n CellB n+block*16
133 // 2*n+1 CellA n+block*16
134 if(orChannel==false){
135 if(channel%numberOfLayer==1){
136 cellType = TGCChannelSLBIn::CellA;
137 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
138 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
139 +adjacentOfSLB;
140 }
141 if(channel%numberOfLayer==0){
142 cellType = TGCChannelSLBIn::CellB;
143 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
144 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
145 +adjacentOfSLB;
146 }
147 }
148 if(orChannel==true){
149 if(channel%numberOfLayer==1){
150 cellType = TGCChannelSLBIn::CellC;
151 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
152 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
153 +adjacentOfSLB;
154 }
155 if(channel%numberOfLayer==0){
156 cellType = TGCChannelSLBIn::CellD;
157 adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
158 channelInSLB = (channel+block*channelInBlock)/numberOfLayer
159 +adjacentOfSLB;
160 }
161 }
162 break;
163
164 default:
165 break;
166 }
167
168 TGCChannelSLBIn* slbin = nullptr;
169 if(channelInSLB!=-1){
170 int channelOfSLB = TGCChannelSLBIn::convertChannel(slbout->getModuleType(),
171 cellType,channelInSLB);
172 slbin = new TGCChannelSLBIn(slbout->getSideType(),
173 slbout->getModuleType(),
174 slbout->getRegionType(),
175 slbout->getSector(),
176 slbout->getId(),
177 channelOfSLB);
178
179 }
180 return slbin;
181}
static int getAdjacentOfSLB(TGCId::ModuleType moduleType, CellType cellType)
static int convertChannel(TGCId::ModuleType moduleType, CellType cellType, int channelInSLB)
static int getNumberOfLayer(TGCId::ModuleType moduleType)
static int getChannelInBlock(TGCId::ModuleType moduleType)

◆ getChannelOut()

TGCChannelId * MuonTGC_Cabling::TGCCableInSLB::getChannelOut ( const TGCChannelId * slbin,
bool orChannel = false ) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 183 of file TGCCableInSLB.cxx.

184 {
185 if(slbin->isValid()==false) return nullptr;
186
188 TGCChannelSLBIn::convertCellType(slbin->getChannel());
189 if(cellType==TGCChannelSLBIn::NoCellType) return nullptr;
190
191 TGCId::ModuleType moduleType = slbin->getModuleType();
192 int channelInCell =
193 TGCChannelSLBIn::convertChannelInCell(slbin->getChannel());
194 int channelInSLB =
195 TGCChannelSLBIn::convertChannelInSLB(moduleType,cellType,channelInCell);
196
197 int channelInBlock = TGCChannelSLBOut::getChannelInBlock(moduleType);
198 int numberOfLayer = TGCChannelSLBOut::getNumberOfLayer(moduleType);
199 int adjacentOfSLB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,cellType);
200
201 int channel = -1;
202 int block = -1;
203 switch(moduleType){
204 case TGCId::WD:
205 if(orChannel==false){
206 if(cellType==TGCChannelSLBIn::CellA)
207 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer+1;
208 if(cellType==TGCChannelSLBIn::CellB)
209 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer;
210 block = channel/channelInBlock;
211 channel = channel%channelInBlock;
212 }
213 if(orChannel==true){
214 if(cellType==TGCChannelSLBIn::CellC)
215 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer+1;
216 if(cellType==TGCChannelSLBIn::CellD)
217 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer;
218 block = channel/channelInBlock;
219 channel = channel%channelInBlock;
220 }
221 break;
222 case TGCId::SD:
223 if(orChannel==false){
224 if(cellType==TGCChannelSLBIn::CellA)
225 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer+1;
226 if(cellType==TGCChannelSLBIn::CellB)
227 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer;
228 block = channel/channelInBlock;
229 channel = channel%channelInBlock;
230 }
231 if(orChannel==true){
232 if(cellType==TGCChannelSLBIn::CellC)
233 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer+1;
234 if(cellType==TGCChannelSLBIn::CellD)
235 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer;
236 block = channel/channelInBlock;
237 channel = channel%channelInBlock;
238 }
239 break;
240 case TGCId::WT:
241 if(cellType==TGCChannelSLBIn::CellA)
242 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer+2;
243 if(cellType==TGCChannelSLBIn::CellB)
244 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer+1;
245 if(cellType==TGCChannelSLBIn::CellC)
246 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer;
247 block = channel/channelInBlock;
248 channel = channel%channelInBlock;
249 break;
250 case TGCId::ST:
251 case TGCId::WI:
252 case TGCId::SI:
253 if(cellType== TGCChannelSLBIn::CellA||cellType== TGCChannelSLBIn::CellB){
254 if(cellType==TGCChannelSLBIn::CellA)
255 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer+1;
256 if(cellType==TGCChannelSLBIn::CellB)
257 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer;
258 block = channel/channelInBlock;
259 channel = channel%channelInBlock;
260 }
261 if(cellType== TGCChannelSLBIn::CellC||cellType== TGCChannelSLBIn::CellD){
262 if(cellType==TGCChannelSLBIn::CellC)
263 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer+1;
264 if(cellType==TGCChannelSLBIn::CellD)
265 channel = (channelInSLB-adjacentOfSLB)*numberOfLayer;
266 block = channel/channelInBlock;
267 channel = channel%channelInBlock;
268 }
269 break;
270 default:
271 break;
272 }
273
274 TGCChannelSLBOut* slbout = nullptr;
275 if(block!=-1&&channel!=-1)
276 slbout = new TGCChannelSLBOut(slbin->getSideType(),
277 slbin->getModuleType(),
278 slbin->getRegionType(),
279 slbin->getSector(),
280 slbin->getId(),
281 block,
282 channel);
283
284 return slbout;
285}
static int convertChannelInSLB(TGCId::ModuleType moduleType, CellType cellType, int channel)
static int convertChannelInCell(int channel)
static CellType convertCellType(int channel)

◆ getModuleIn()

virtual TGCModuleMap * MuonTGC_Cabling::TGCCable::getModuleIn ( const TGCModuleId * ) const
inlineprotectedvirtualinherited

◆ getModuleOut()

virtual TGCModuleMap * MuonTGC_Cabling::TGCCable::getModuleOut ( const TGCModuleId * ) const
inlineprotectedvirtualinherited

Member Data Documentation

◆ m_type

CableType MuonTGC_Cabling::TGCCable::m_type
privateinherited

Definition at line 43 of file TGCCable.h.


The documentation for this class was generated from the following files: