]>
Commit | Line | Data |
---|---|---|
1 | /************************************************************************** | |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | ||
18 | // ------------------ | |
19 | // Class AliMUONTriggerCircuit | |
20 | // ------------------ | |
21 | // description of the global position of the trigger boards strip positions | |
22 | // based on the "old" segmentation (to be replaced soon) | |
23 | ||
24 | ||
25 | #include <TMath.h> | |
26 | ||
27 | #include "AliMUONTriggerCircuit.h" | |
28 | #include "AliRun.h" | |
29 | #include "AliMUON.h" | |
30 | #include "AliMUONTriggerConstants.h" | |
31 | #include "AliMUONGeometrySegmentation.h" | |
32 | #include "AliMUONSegmentation.h" | |
33 | #include "AliMUONConstants.h" | |
34 | #include "AliLog.h" | |
35 | ||
36 | /// \cond CLASSIMP | |
37 | ClassImp(AliMUONTriggerCircuit) | |
38 | /// \endcond | |
39 | ||
40 | //---------------------------------------------------------------------- | |
41 | AliMUONTriggerCircuit::AliMUONTriggerCircuit() | |
42 | : TObject(), | |
43 | fIdCircuit(0), | |
44 | fX2m(0), | |
45 | fX2ud(0) | |
46 | { | |
47 | /// Constructor | |
48 | ||
49 | fOrMud[0]=fOrMud[1]=0; | |
50 | Int_t i; | |
51 | for (i=0; i<4; i++) { | |
52 | for (Int_t j=0; j<32; j++) { | |
53 | fXcode[i][j]=0; | |
54 | fYcode[i][j]=0; | |
55 | } | |
56 | } | |
57 | for (i=0; i<16; i++) { fXpos11[i]=0.; } | |
58 | for (i=0; i<31; i++) { fYpos11[i]=0.; } | |
59 | for (i=0; i<63; i++) { fYpos21[i]=0.; } | |
60 | } | |
61 | ||
62 | //---------------------------------------------------------------------- | |
63 | AliMUONTriggerCircuit::~AliMUONTriggerCircuit() | |
64 | { | |
65 | /// Destructor | |
66 | } | |
67 | ||
68 | //---------------------------------------------------------------------- | |
69 | void AliMUONTriggerCircuit::Init(Int_t iCircuit) { | |
70 | /// initialize circuit characteristics | |
71 | fIdCircuit=AliMUONTriggerConstants::CircuitId(iCircuit); | |
72 | ||
73 | LoadX2(); | |
74 | LoadXCode(); | |
75 | LoadYCode(); | |
76 | ||
77 | LoadXPos2(); | |
78 | LoadYPos2(); | |
79 | ||
80 | } | |
81 | ||
82 | //---------------------------------------------------------------------- | |
83 | Int_t AliMUONTriggerCircuit::CircuitNumber(Int_t idCircuit) const { | |
84 | /// returns circuit number iCircuit (0-234) corresponding to circuit idCircuit | |
85 | Int_t iCircuit=0; | |
86 | for (Int_t i=0; i<234; i++) { | |
87 | if (AliMUONTriggerConstants::CircuitId(i)==idCircuit) { | |
88 | iCircuit=i; | |
89 | break; | |
90 | } | |
91 | } | |
92 | return iCircuit; | |
93 | } | |
94 | //---------------------------------------------------------------------- | |
95 | Int_t AliMUONTriggerCircuit::ModuleNumber(Int_t idModule) const { | |
96 | /// returns module number imod (from 0 to 63) corresponding to module idmodule | |
97 | Int_t absidModule=TMath::Abs(idModule); | |
98 | Int_t iModule=0; | |
99 | for (Int_t i=0; i<63; i++) { | |
100 | if (AliMUONTriggerConstants::ModuleId(i)==absidModule) { | |
101 | iModule=i; | |
102 | break; | |
103 | } | |
104 | } | |
105 | return iModule; | |
106 | } | |
107 | ||
108 | //---------------------------------------------------------------------- | |
109 | Int_t AliMUONTriggerCircuit::Module(Int_t idCircuit) const { | |
110 | /// returns ModuleId where Circuit idCircuit is sitting | |
111 | return Int_t(idCircuit/10); | |
112 | } | |
113 | //---------------------------------------------------------------------- | |
114 | Int_t AliMUONTriggerCircuit::Position(Int_t idCircuit) const { | |
115 | /// returns position of idCircuit in correcponding Module | |
116 | return TMath::Abs(idCircuit)-TMath::Abs(Module(idCircuit))*10; | |
117 | } | |
118 | ||
119 | //---------------------------------------------------------------------- | |
120 | void AliMUONTriggerCircuit::LoadX2() { | |
121 | /// initialize fX2m, fX2ud and fOrMud | |
122 | ||
123 | Int_t idModule=Module(fIdCircuit); // corresponding module Id. | |
124 | // and its number of X strips | |
125 | Int_t nStrX=AliMUONTriggerConstants::NstripX(ModuleNumber(idModule)); | |
126 | // and its number of Y strips | |
127 | Int_t nStrY=AliMUONTriggerConstants::NstripY(ModuleNumber(idModule)); | |
128 | Int_t iPosCircuit=Position(fIdCircuit); // position of circuit in module | |
129 | ||
130 | // first step : look at lower part | |
131 | if (iPosCircuit==1) { // need to scan lower module | |
132 | if(idModule<91&&TMath::Abs(idModule)!=41&&idModule>-91) { | |
133 | fOrMud[0]=1; | |
134 | Int_t idModuleD=(TMath::Abs(idModule)+10)*(TMath::Abs(idModule)/idModule); | |
135 | Int_t nStrD=AliMUONTriggerConstants::NstripY(ModuleNumber(idModuleD)); | |
136 | ||
137 | if (nStrY!=nStrD | |
138 | &&TMath::Abs(idModule)!=42&&TMath::Abs(idModule)!=52) { | |
139 | if (nStrY==8) fX2m=1; | |
140 | if (nStrD==8) fX2ud=1; | |
141 | } | |
142 | } | |
143 | ||
144 | } else { // lower strips within same module | |
145 | fOrMud[0]=0; | |
146 | } | |
147 | ||
148 | // second step : look at upper part | |
149 | if ((iPosCircuit==1&&nStrX==16)||(iPosCircuit==2&&nStrX==32)|| | |
150 | (iPosCircuit==3&&nStrX==48)||(iPosCircuit==4&&nStrX==64)) { | |
151 | if ((idModule>17||idModule<-17)&&TMath::Abs(idModule)!=61) { | |
152 | fOrMud[1]=1; | |
153 | Int_t idModuleU=(TMath::Abs(idModule)-10)*(TMath::Abs(idModule)/idModule); | |
154 | Int_t nStrU=AliMUONTriggerConstants::NstripY(ModuleNumber(idModuleU)); | |
155 | ||
156 | if (nStrY!=nStrU | |
157 | &&TMath::Abs(idModule)!=62&&TMath::Abs(idModule)!=52) { | |
158 | if (nStrY==8) fX2m=1; | |
159 | if (nStrU==8) fX2ud=1; | |
160 | } | |
161 | } | |
162 | ||
163 | } else { // upper strips within same module | |
164 | fOrMud[1]=0; | |
165 | } | |
166 | } | |
167 | ||
168 | //---------------------------------------------------------------------- | |
169 | void AliMUONTriggerCircuit::LoadXCode(){ | |
170 | /// assign a Id. number to each X strip of current circuit | |
171 | /// Id.=(corresponding module Id.)*100+(Id. strip of module) | |
172 | ||
173 | // first part : fill XMC11 XMC12 and strips 8 to 24 (middle) XMC21 XMC22 | |
174 | Int_t iStripCircMT1=0, iStripCircMT2=8; | |
175 | Int_t idModule=Module(fIdCircuit); // corresponding module Id. | |
176 | // and its number of strips | |
177 | Int_t nStrX=AliMUONTriggerConstants::NstripX(ModuleNumber(idModule)); | |
178 | Int_t iPosCircuit=Position(fIdCircuit); // position of circuit in module | |
179 | Int_t sign=TMath::Abs(idModule)/idModule; // left or right | |
180 | Int_t istrip; | |
181 | ||
182 | for (istrip=(iPosCircuit-1)*16; | |
183 | istrip<(iPosCircuit-1)*16+16; istrip++) { | |
184 | ||
185 | fXcode[0][iStripCircMT1]=sign*(TMath::Abs(idModule)*100+istrip); | |
186 | fXcode[1][iStripCircMT1]=sign*(TMath::Abs(idModule)*100+istrip); | |
187 | fXcode[2][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
188 | fXcode[3][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
189 | iStripCircMT1++; | |
190 | iStripCircMT2++; | |
191 | } | |
192 | ||
193 | // second part | |
194 | // XMC21 XMC22 strips 0 to 7 and 24 to 31 | |
195 | Int_t idModuleD, idModuleU; | |
196 | Int_t nStrD, nStrU; | |
197 | ||
198 | idModule=Module(fIdCircuit); // corresponding module Id. | |
199 | // number of X strips | |
200 | nStrX=AliMUONTriggerConstants::NstripX(ModuleNumber(idModule)); | |
201 | sign=TMath::Abs(idModule)/idModule; | |
202 | ||
203 | // fill lower part (0 to 7) | |
204 | if (iPosCircuit==1) { // need to scan lower module | |
205 | if(idModule<91&&TMath::Abs(idModule)!=41&&idModule>-91) { // non-existing | |
206 | idModuleD=sign*(TMath::Abs(idModule)+10); // lower module Id | |
207 | // and its number of strips | |
208 | nStrD=AliMUONTriggerConstants::NstripX(ModuleNumber(idModuleD)); | |
209 | ||
210 | iStripCircMT2=0; | |
211 | for (istrip=nStrD-8; istrip<nStrD; istrip++) { | |
212 | fXcode[2][iStripCircMT2]=sign*(TMath::Abs(idModuleD)*100+istrip); | |
213 | fXcode[3][iStripCircMT2]=sign*(TMath::Abs(idModuleD)*100+istrip); | |
214 | iStripCircMT2++; | |
215 | } | |
216 | } | |
217 | ||
218 | } else { // lower strips within same module | |
219 | ||
220 | iStripCircMT2=0; | |
221 | for (istrip=(iPosCircuit-1)*16-8; | |
222 | istrip<(iPosCircuit-1)*16; istrip++) { | |
223 | fXcode[2][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
224 | fXcode[3][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
225 | iStripCircMT2++; | |
226 | } | |
227 | } | |
228 | ||
229 | // fill upper part (24 to 31) | |
230 | if ((iPosCircuit==1&&nStrX==16)||(iPosCircuit==2&&nStrX==32)|| | |
231 | (iPosCircuit==3&&nStrX==48)||(iPosCircuit==4&&nStrX==64)) { | |
232 | if ((idModule>17||idModule<-17)&&TMath::Abs(idModule)!=61) { | |
233 | idModuleU=sign*(TMath::Abs(idModule)-10); // upper module Id | |
234 | // and its number of strips | |
235 | nStrU=AliMUONTriggerConstants::NstripX(ModuleNumber(idModuleU)); | |
236 | ||
237 | iStripCircMT2=24; | |
238 | for (istrip=0; istrip<8; istrip++) { | |
239 | fXcode[2][iStripCircMT2]=sign*(TMath::Abs(idModuleU)*100+istrip); | |
240 | fXcode[3][iStripCircMT2]=sign*(TMath::Abs(idModuleU)*100+istrip); | |
241 | iStripCircMT2++; | |
242 | } | |
243 | } | |
244 | ||
245 | } else if ((iPosCircuit==1&&nStrX>16)||(iPosCircuit==2&&nStrX>32)|| | |
246 | (iPosCircuit==3&&nStrX>48)) { // upper strips within same mod. | |
247 | ||
248 | iStripCircMT2=24; | |
249 | for (istrip=(iPosCircuit-1)*16+16; | |
250 | istrip<(iPosCircuit-1)*16+24; istrip++) { | |
251 | fXcode[2][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
252 | fXcode[3][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
253 | iStripCircMT2++; | |
254 | } | |
255 | } | |
256 | } | |
257 | ||
258 | //---------------------------------------------------------------------- | |
259 | void AliMUONTriggerCircuit::LoadYCode(){ | |
260 | /// assign a Id. number to each Y strip of current circuit | |
261 | /// Id.=(corresponding module Id.)*100+(Id. strip of module) | |
262 | /// note : for Y plane fill only "central part" of circuit | |
263 | /// (upper and lower parts are filled in PreHandlingY of AliMUONTriggerDecision) | |
264 | ||
265 | Int_t idModule=Module(fIdCircuit); // corresponding module Id. | |
266 | // and its number of Y strips | |
267 | Int_t nStrY=AliMUONTriggerConstants::NstripY(ModuleNumber(idModule)); | |
268 | Int_t sign=TMath::Abs(idModule)/idModule; // left or right | |
269 | ||
270 | for (Int_t istrip=0; istrip<nStrY; istrip++) { | |
271 | fYcode[0][istrip]=sign*(TMath::Abs(idModule)*100+istrip); | |
272 | fYcode[1][istrip]=sign*(TMath::Abs(idModule)*100+istrip); | |
273 | fYcode[2][istrip]=sign*(TMath::Abs(idModule)*100+istrip); | |
274 | fYcode[3][istrip]=sign*(TMath::Abs(idModule)*100+istrip); | |
275 | } | |
276 | } | |
277 | ||
278 | //---------------------------------------------------------------------- | |
279 | Float_t AliMUONTriggerCircuit::PtCal(Int_t istripX, Int_t idev, Int_t istripY){ | |
280 | /// returns calculated pt for circuit/istripX/idev/istripY according | |
281 | /// to the formula of the TRD. Note : idev (input) is in [0+30] | |
282 | ||
283 | // Int_t jdev = idev - 15; // jdev in [-15+15] | |
284 | Int_t istripX2=istripX+idev+1; // find istripX2 using istripX and idev | |
285 | ||
286 | Float_t yPosX1=fYpos11[istripX]; | |
287 | Float_t yPosX2=fYpos21[istripX2]; | |
288 | Float_t xPosY1=fXpos11[istripY]; | |
289 | ||
290 | Float_t zf=975.; | |
291 | Float_t z1=AliMUONConstants::DefaultChamberZ(10); | |
292 | Float_t z2=AliMUONConstants::DefaultChamberZ(12); | |
293 | Float_t thetaDev=(1./zf)*(yPosX1*z2-yPosX2*z1)/(z2-z1); | |
294 | Float_t xf=xPosY1*zf/z1; | |
295 | Float_t yf=yPosX2-((yPosX2-yPosX1)*(z2-zf))/(z2-z1); | |
296 | return (3.*0.3/TMath::Abs(thetaDev)) * TMath::Sqrt(xf*xf+yf*yf)/zf; | |
297 | } | |
298 | //--------------------------------------------------------------------- | |
299 | //----------------------- New Segmentation ---------------------------- | |
300 | //--------------------------------------------------------------------- | |
301 | ||
302 | //--------------------------------------------------------------------- | |
303 | void AliMUONTriggerCircuit::LoadYPos2(){ | |
304 | /// fill fYpos11 and fYpos21 -> y position of X declusterized strips | |
305 | ||
306 | Int_t chamber, cathode; | |
307 | Int_t code, idModule, idStrip, idSector; | |
308 | Float_t x, y, z, width; | |
309 | Int_t istrip, idDE; | |
310 | ||
311 | AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); | |
312 | AliMUONGeometrySegmentation* segmentation; | |
313 | ||
314 | // first plane (11) | |
315 | chamber=11; | |
316 | cathode=1; | |
317 | segmentation | |
318 | = pMUON->GetSegmentation()->GetModuleSegmentation(chamber-1, cathode-1); | |
319 | ||
320 | if (!segmentation) { | |
321 | AliWarning("Segmentation not defined."); | |
322 | return; | |
323 | } | |
324 | ||
325 | for (istrip=0; istrip<16; istrip++) { | |
326 | code=fXcode[0][istrip]; // decode current strip | |
327 | idModule=Int_t(code/100); // corresponding module Id. | |
328 | idDE = DetElemId(chamber, idModule); | |
329 | idStrip=TMath::Abs(code-idModule*100); // corresp. strip number in module | |
330 | idSector=segmentation->Sector(idDE, idModule, idStrip); // corresponding sector | |
331 | width=segmentation->Dpy(idDE, idSector); // corresponding strip width | |
332 | segmentation->GetPadC(idDE, idModule,idStrip,x,y,z); // get strip real position | |
333 | ||
334 | fYpos11[2*istrip]=y; | |
335 | if (istrip!=15) fYpos11[2*istrip+1]=y+width/2.; | |
336 | } | |
337 | ||
338 | // second plane (21) | |
339 | chamber=13; | |
340 | cathode=1; | |
341 | segmentation | |
342 | = pMUON->GetSegmentation()->GetModuleSegmentation(chamber-1, cathode-1); | |
343 | ||
344 | for (istrip=0; istrip<32; istrip++) { | |
345 | code=fXcode[2][istrip]; // decode current strip | |
346 | idModule=Int_t(code/100); // corresponding module Id. | |
347 | idDE = DetElemId(chamber, idModule); | |
348 | if (idModule == 0) continue; | |
349 | idStrip=TMath::Abs(code-idModule*100); // corresp. strip number in module | |
350 | idSector=segmentation->Sector(idDE, idModule, idStrip); // corresponding sector | |
351 | width=segmentation->Dpy(idDE, idSector); // corresponding strip width | |
352 | segmentation->GetPadC(idDE, idModule,idStrip,x,y,z); // get strip real position | |
353 | ||
354 | // using idModule!=0 prevents to fill garbage in case of circuits | |
355 | // in the first and last rows | |
356 | if (idModule!=0) { | |
357 | fYpos21[2*istrip]=y; | |
358 | if (istrip!=31) fYpos21[2*istrip+1]=y+width/2.; | |
359 | } | |
360 | } | |
361 | } | |
362 | ||
363 | //---------------------------------------------------------------------- | |
364 | void AliMUONTriggerCircuit::LoadXPos2(){ | |
365 | /// fill fXpos11 -> x position of Y strips for the first plane only | |
366 | /// fXpos11 contains the x position of Y strip for the current circuit | |
367 | /// taking into account whether or nor not part(s) of the circuit | |
368 | /// (middle, up or down) has(have) 16 strips | |
369 | ||
370 | Float_t x, y, z; | |
371 | Int_t istrip, idDE; | |
372 | ||
373 | Int_t chamber=11; | |
374 | Int_t cathode=2; | |
375 | AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); | |
376 | AliMUONGeometrySegmentation* segmentation; | |
377 | segmentation | |
378 | = pMUON->GetSegmentation()->GetModuleSegmentation(chamber-1, cathode-1); | |
379 | ||
380 | if (!segmentation) { | |
381 | AliWarning("Segmentation not defined."); | |
382 | return; | |
383 | } | |
384 | ||
385 | Int_t idModule=Module(fIdCircuit); // corresponding module Id. | |
386 | // number of Y strips | |
387 | idDE = DetElemId(chamber, idModule); | |
388 | ||
389 | Int_t nStrY=AliMUONTriggerConstants::NstripY(ModuleNumber(idModule)); | |
390 | Int_t idSector=segmentation->Sector(idDE, idModule,0); // corresp. sector | |
391 | Float_t width=segmentation->Dpx(idDE, idSector); // corresponding strip width | |
392 | ||
393 | // first case : up middle and down parts have all 8 or 16 strip | |
394 | if ((nStrY==16)||(nStrY==8&&fX2m==0&&fX2ud==0)) { | |
395 | for (istrip=0; istrip<nStrY; istrip++) { | |
396 | segmentation->GetPadC(idDE, idModule,istrip,x,y,z); | |
397 | AliDebug(1,Form("idDE %d idModule %d istrip %d x,y,z=%e,%e,%e\n", | |
398 | idDE,idModule,istrip,x,y,z)); | |
399 | fXpos11[istrip]=x; | |
400 | } | |
401 | // second case : mixing 8 and 16 strips within same circuit | |
402 | } else { | |
403 | for (istrip=0; istrip<nStrY; istrip++) { | |
404 | if (nStrY!=8) { printf(" bug in LoadXpos \n");} | |
405 | segmentation->GetPadC(idDE, idModule, istrip, x, y, z); | |
406 | fXpos11[2*istrip]=x-width/4.; | |
407 | fXpos11[2*istrip+1]=fXpos11[2*istrip]+width/2.; | |
408 | } | |
409 | } | |
410 | } | |
411 | ||
412 | //---------------------------------------------------------------------- | |
413 | //--- methods which return member data related info | |
414 | //---------------------------------------------------------------------- | |
415 | Int_t AliMUONTriggerCircuit::GetIdCircuit() const { | |
416 | /// returns circuit Id | |
417 | return fIdCircuit; | |
418 | } | |
419 | //---------------------------------------------------------------------- | |
420 | Int_t AliMUONTriggerCircuit::GetIdModule() const { | |
421 | /// returns module Id | |
422 | return Module(fIdCircuit); | |
423 | } | |
424 | //---------------------------------------------------------------------- | |
425 | Int_t AliMUONTriggerCircuit::GetNstripX() const { | |
426 | /// returns the number of X strips in the module where the circuit is sitting | |
427 | return AliMUONTriggerConstants::NstripX(ModuleNumber(Module(fIdCircuit))); | |
428 | } | |
429 | //---------------------------------------------------------------------- | |
430 | Int_t AliMUONTriggerCircuit::GetNstripY() const { | |
431 | /// returns the number of Y strips in the module where the circuit is sitting | |
432 | return AliMUONTriggerConstants::NstripY(ModuleNumber(Module(fIdCircuit))); | |
433 | } | |
434 | //---------------------------------------------------------------------- | |
435 | Int_t AliMUONTriggerCircuit::GetPosCircuit() const { | |
436 | /// returns the position of the circuit in its module | |
437 | return Position(fIdCircuit); | |
438 | } | |
439 | //---------------------------------------------------------------------- | |
440 | Int_t AliMUONTriggerCircuit::GetIdCircuitD() const { | |
441 | /// returns the Id of the circuit down | |
442 | Int_t idModule=Module(fIdCircuit); | |
443 | Int_t idModuleD=(TMath::Abs(idModule)+10)*(TMath::Abs(idModule)/idModule); | |
444 | return (TMath::Abs(idModuleD)*10+1)*(TMath::Abs(idModule)/idModule); | |
445 | } | |
446 | //---------------------------------------------------------------------- | |
447 | Int_t AliMUONTriggerCircuit::GetICircuitD() const { | |
448 | /// returns the number of the circuit down | |
449 | Int_t idModule=Module(fIdCircuit); | |
450 | Int_t idModuleD=(TMath::Abs(idModule)+10)*(TMath::Abs(idModule)/idModule); | |
451 | Int_t idCircuitD= | |
452 | (TMath::Abs(idModuleD)*10+1)*(TMath::Abs(idModule)/idModule); | |
453 | return CircuitNumber(idCircuitD); | |
454 | } | |
455 | //---------------------------------------------------------------------- | |
456 | Int_t AliMUONTriggerCircuit::GetIdCircuitU() const { | |
457 | /// returns the Id of the circuit up | |
458 | Int_t idModule=Module(fIdCircuit); | |
459 | Int_t idModuleU=(TMath::Abs(idModule)-10)*(TMath::Abs(idModule)/idModule); | |
460 | return (TMath::Abs(idModuleU)*10+1)*(TMath::Abs(idModule)/idModule); | |
461 | } | |
462 | //---------------------------------------------------------------------- | |
463 | Int_t AliMUONTriggerCircuit::GetICircuitU() const { | |
464 | /// returns the number of the circuit up | |
465 | Int_t idModule=Module(fIdCircuit); | |
466 | Int_t idModuleU=(TMath::Abs(idModule)-10)*(TMath::Abs(idModule)/idModule); | |
467 | Int_t idCircuitU= | |
468 | (TMath::Abs(idModuleU)*10+1)*(TMath::Abs(idModule)/idModule); | |
469 | return CircuitNumber(idCircuitU); | |
470 | } | |
471 | //---------------------------------------------------------------------- | |
472 | Int_t AliMUONTriggerCircuit::GetX2m() const { | |
473 | /// returns fX2m | |
474 | return fX2m; | |
475 | } | |
476 | //---------------------------------------------------------------------- | |
477 | Int_t AliMUONTriggerCircuit::GetX2ud() const { | |
478 | /// returns fX2ud | |
479 | return fX2ud; | |
480 | } | |
481 | //---------------------------------------------------------------------- | |
482 | void AliMUONTriggerCircuit::GetOrMud(Int_t orMud[2]) const { | |
483 | /// returns fOrMud | |
484 | orMud[0]=fOrMud[0]; | |
485 | orMud[1]=fOrMud[1]; | |
486 | } | |
487 | //---------------------------------------------------------------------- | |
488 | Int_t AliMUONTriggerCircuit::GetXcode(Int_t chamber, Int_t istrip) const { | |
489 | /// returns X code of circuit/chamber/istrip (warning : chamber in [0,3]) | |
490 | return fXcode[chamber][istrip]; | |
491 | } | |
492 | //---------------------------------------------------------------------- | |
493 | Int_t AliMUONTriggerCircuit::GetYcode(Int_t chamber, Int_t istrip) const { | |
494 | /// returns Y code of circuit/chamber/istrip (warning : chamber in [0,3]) | |
495 | return fYcode[chamber][istrip]; | |
496 | } | |
497 | //---------------------------------------------------------------------- | |
498 | Float_t AliMUONTriggerCircuit::GetY11Pos(Int_t istrip) const { | |
499 | /// returns Y position of X strip istrip in MC11 | |
500 | return fYpos11[istrip]; | |
501 | } | |
502 | //---------------------------------------------------------------------- | |
503 | Float_t AliMUONTriggerCircuit::GetY21Pos(Int_t istrip) const { | |
504 | /// returns Y position of X strip istrip in MC21 | |
505 | return fYpos21[istrip]; | |
506 | } | |
507 | //---------------------------------------------------------------------- | |
508 | Float_t AliMUONTriggerCircuit::GetX11Pos(Int_t istrip) const { | |
509 | // returns X position of Y strip istrip in MC11 | |
510 | return fXpos11[istrip]; | |
511 | } | |
512 | //---------------------------------------------------------------------- | |
513 | //--- end of methods which return member data related info | |
514 | //---------------------------------------------------------------------- | |
515 | ||
516 | void dump(const char* what, const Float_t* array, Int_t size) | |
517 | { | |
518 | cout << what << " " << endl; | |
519 | for ( Int_t i = 0; i < size; ++i ) | |
520 | { | |
521 | cout << array[i] << " , "; | |
522 | } | |
523 | cout << endl; | |
524 | } | |
525 | ||
526 | void dump(const char* what, const Int_t* array, Int_t size) | |
527 | { | |
528 | cout << what << " " << endl; | |
529 | for ( Int_t i = 0; i < size; ++i ) | |
530 | { | |
531 | cout << array[i] << " , "; | |
532 | } | |
533 | cout << endl; | |
534 | } | |
535 | ||
536 | //_____________________________________________________________________________ | |
537 | void | |
538 | AliMUONTriggerCircuit::Print(Option_t* ) const | |
539 | { | |
540 | /// prints-out data member | |
541 | cout << "IdCircuit " << fIdCircuit << " X2m,X2ud=" << fX2m << "," | |
542 | << fX2ud; | |
543 | for ( Int_t i = 0; i < 2; ++i ) | |
544 | { | |
545 | cout << " OrMud[" << i << "]=" << fOrMud[i]; | |
546 | } | |
547 | cout << endl; | |
548 | dump("Xpos11",fXpos11,16); | |
549 | dump("Ypos11",fYpos11,31); | |
550 | dump("Ypos21",fYpos21,63); | |
551 | for ( Int_t i = 0; i < 4; ++i ) | |
552 | { | |
553 | char s[80]; | |
554 | sprintf(s,"Xcode[%d]",i); | |
555 | dump(s,fXcode[i],32); | |
556 | sprintf(s,"Ycode[%d]",i); | |
557 | dump(s,fYcode[i],32); | |
558 | } | |
559 | // Int_t fIdCircuit; // circuit Id number | |
560 | // Int_t fX2m; // internal info needed by TriggerDecision | |
561 | // Int_t fX2ud; // internal info needed by TriggerDecision | |
562 | // Int_t fOrMud[2]; // internal info needed by TriggerDecision | |
563 | // Int_t fXcode[4][32]; // code of X strips | |
564 | // Int_t fYcode[4][32]; // code of Y strips | |
565 | // Float_t fXpos11[16]; // X position of Y strips in MC11 | |
566 | // Float_t fYpos11[31]; // Y position of X strips in MC11 | |
567 | // Float_t fYpos21[63]; // Y position of X strips in MC21 | |
568 | ||
569 | } | |
570 | ||
571 | Int_t AliMUONTriggerCircuit::DetElemId(Int_t ichamber, Int_t idModule) | |
572 | { | |
573 | /// adpated to official numbering (09/20/05) | |
574 | /// returns the detection element Id for given chamber and module | |
575 | /// ichamber (from 11 to 14), idModule (from -97 to 97) | |
576 | // | |
577 | Int_t itmp=0; | |
578 | Int_t linenumber=Int_t(idModule/10); | |
579 | switch (linenumber) // (from 1 to 9, from top to bottom) | |
580 | { | |
581 | case 1: | |
582 | itmp = 4; | |
583 | break; | |
584 | case 2: | |
585 | itmp = 3; | |
586 | break; | |
587 | case 3: | |
588 | itmp = 2; | |
589 | break; | |
590 | case 4: | |
591 | itmp = 1; | |
592 | break; | |
593 | case 5: | |
594 | itmp = 0; | |
595 | break; | |
596 | case 6: | |
597 | itmp = 17; | |
598 | break; | |
599 | case 7: | |
600 | itmp = 16; | |
601 | break; | |
602 | case 8: | |
603 | itmp = 15; | |
604 | break; | |
605 | case 9: | |
606 | itmp = 14; | |
607 | break; | |
608 | // left | |
609 | case -1: | |
610 | itmp = 5; | |
611 | break; | |
612 | case -2: | |
613 | itmp = 6; | |
614 | break; | |
615 | case -3: | |
616 | itmp = 7; | |
617 | break; | |
618 | case -4: | |
619 | itmp = 8; | |
620 | break; | |
621 | case -5: | |
622 | itmp = 9; | |
623 | break; | |
624 | case -6: | |
625 | itmp = 10; | |
626 | break; | |
627 | case -7: | |
628 | itmp = 11; | |
629 | break; | |
630 | case -8: | |
631 | itmp = 12; | |
632 | break; | |
633 | case -9: | |
634 | itmp = 13; | |
635 | break; | |
636 | } | |
637 | return (ichamber*100)+itmp; | |
638 | } | |
639 | ||
640 | ||
641 | ||
642 |