]>
Commit | Line | Data |
---|---|---|
0a11496e | 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 | ||
5398f946 | 18 | /// \class AliMUONTriggerSegmentation |
19 | /// \brief Segmentation classe for trigger chambers. | |
20 | /// In the present version the method use global strip coordinates except | |
21 | /// HasPad. The conversion is made via GetPadLoc2Glo. | |
22 | /// To be improved in the future. | |
0a11496e | 23 | |
0a11496e | 24 | #include "AliMUONTriggerSegmentation.h" |
25 | #include "AliLog.h" | |
70ef378c | 26 | #include "Riostream.h" |
0a11496e | 27 | |
5398f946 | 28 | /// \cond CLASSIMP |
0a11496e | 29 | ClassImp(AliMUONTriggerSegmentation) |
5398f946 | 30 | /// \endcond |
0a11496e | 31 | |
5398f946 | 32 | //___________________________________________ |
a713db22 | 33 | AliMUONTriggerSegmentation::AliMUONTriggerSegmentation() |
34 | : AliMUONVGeometryDESegmentation(), | |
35 | fBending(0), | |
79b4ba23 | 36 | fId(0), |
38aedc99 | 37 | fNsec(7), |
79b4ba23 | 38 | fNpx(999999), |
39 | fNpy(999999), | |
79b4ba23 | 40 | fXhit(0.), |
41 | fYhit(0.), | |
42 | fIx(0), | |
43 | fIy(0), | |
44 | fX(0.), | |
45 | fY(0.), | |
79b4ba23 | 46 | // add to St345SlatSegmentation |
47 | fLineNumber(0), | |
48 | fRpcHalfXsize(0), | |
49 | fRpcHalfYsize(0) | |
a713db22 | 50 | { |
5398f946 | 51 | /// Default constructor |
d19b6003 | 52 | |
79b4ba23 | 53 | // add to St345SlatSegmentation |
54 | for (Int_t i=0; i<7; i++) { | |
55 | fNstrip[i]=0; | |
56 | fStripYsize[i]=0.; | |
57 | fStripXsize[i]=0.; | |
58 | fModuleXmin[i]=0.; | |
59 | fModuleXmax[i]=0.; | |
60 | fModuleYmin[i]=0.; | |
61 | } | |
65969290 | 62 | |
63 | AliDebug(1, Form("default (empty) ctor this = %p", this)); | |
a713db22 | 64 | } |
79b4ba23 | 65 | |
66 | ||
a713db22 | 67 | //___________________________________________ |
0a11496e | 68 | AliMUONTriggerSegmentation::AliMUONTriggerSegmentation(Bool_t bending) |
69 | : AliMUONVGeometryDESegmentation(), | |
79b4ba23 | 70 | fBending(bending), |
71 | fId(0), | |
79b4ba23 | 72 | fNpx(999999), |
73 | fNpy(999999), | |
79b4ba23 | 74 | fXhit(0.), |
75 | fYhit(0.), | |
76 | fIx(0), | |
77 | fIy(0), | |
78 | fX(0.), | |
79 | fY(0.), | |
79b4ba23 | 80 | // add to St345SlatSegmentation |
81 | fLineNumber(0), | |
82 | fRpcHalfXsize(0), | |
83 | fRpcHalfYsize(0) | |
0a11496e | 84 | { |
5398f946 | 85 | /// Standard constructor |
86 | ||
d173a061 | 87 | fNsec = 7; |
79b4ba23 | 88 | // add to St345SlatSegmentation |
89 | for (Int_t i=0; i<7; i++) { | |
90 | fNstrip[i]=0; | |
91 | fStripYsize[i]=0.; | |
92 | fStripXsize[i]=0.; | |
93 | fModuleXmin[i]=0.; | |
94 | fModuleXmax[i]=0.; | |
95 | fModuleYmin[i]=0.; | |
96 | } | |
65969290 | 97 | |
98 | AliDebug(1, Form("ctor this = %p", this) ); | |
0a11496e | 99 | } |
79b4ba23 | 100 | |
0a11496e | 101 | //---------------------------------------------------------------------- |
102 | AliMUONTriggerSegmentation::~AliMUONTriggerSegmentation() | |
103 | { | |
5398f946 | 104 | /// Destructor |
65969290 | 105 | |
106 | AliDebug(1, Form("dtor this = %p", this) ); | |
0a11496e | 107 | } |
108 | //---------------------------------------------------------------------- | |
d173a061 | 109 | Int_t AliMUONTriggerSegmentation::ModuleColNum(Int_t ix) |
38aedc99 | 110 | { |
5398f946 | 111 | /// returns column number (from 0 to 6) in which the (global) module |
112 | /// ix is sitting (could return 7 if ix=isec) | |
113 | ||
d173a061 | 114 | return TMath::Abs(ix)-Int_t(TMath::Abs(ix)/10)*10-1; |
38aedc99 | 115 | } |
116 | //---------------------------------------------------------------------- | |
79b4ba23 | 117 | Bool_t AliMUONTriggerSegmentation::HasPad(Int_t ix, Int_t iy) |
118 | { | |
5398f946 | 119 | /// check if steping outside the limits (iy=1,2... iy=0,1...) |
120 | ||
38aedc99 | 121 | Bool_t hasPad = true; |
79b4ba23 | 122 | Int_t ixGlo = 0; |
38aedc99 | 123 | Int_t iyGlo = 0; |
124 | GetPadLoc2Glo(ix, iy, ixGlo, iyGlo); | |
125 | if (iyGlo>=fNstrip[ModuleColNum(ixGlo)]) hasPad = false; | |
79b4ba23 | 126 | return hasPad; |
127 | } | |
0a11496e | 128 | //____________________________________________________________________________ |
129 | Float_t AliMUONTriggerSegmentation::Dpx(Int_t isec) const | |
130 | { | |
5398f946 | 131 | /// return x-strip width in sector isec |
132 | ||
38aedc99 | 133 | Float_t size = (isec<8) ? fStripXsize[isec-1] : fStripXsize[isec-2]/2.; |
134 | return size; | |
0a11496e | 135 | } |
136 | //____________________________________________________________________________ | |
137 | Float_t AliMUONTriggerSegmentation::Dpy(Int_t isec) const | |
138 | { | |
5398f946 | 139 | /// return y-strip width in sector isec |
140 | ||
38aedc99 | 141 | Float_t size = (isec<8) ? fStripYsize[isec-1] : fStripYsize[isec-2]; |
142 | return size; | |
0a11496e | 143 | } |
144 | //---------------------------------------------------------------------------- | |
145 | void AliMUONTriggerSegmentation::GetPadLoc2Glo(Int_t ixLoc, Int_t iyLoc, | |
146 | Int_t &ixGlo, Int_t &iyGlo) | |
147 | { | |
5398f946 | 148 | /// converts ixLoc & iyLoc into ixGlo & iyGLo (module,strip number) |
149 | ||
38aedc99 | 150 | ixGlo = 0; // see AliMUONTriggerConstants::fgkModuleI |
151 | iyGlo = 0; // from 0 to (fNtrip-1) in module | |
0a11496e | 152 | if (fBending) { |
38aedc99 | 153 | ixGlo = 10*fLineNumber + ixLoc; |
0a11496e | 154 | iyGlo = iyLoc - 1; |
155 | } else if (!fBending) { | |
156 | Int_t iCountStrip = 0; | |
38aedc99 | 157 | for (Int_t iModule=0; iModule<fNsec; iModule++) { |
0a11496e | 158 | for (Int_t iStrip=0; iStrip<fNstrip[iModule]; iStrip++) { |
159 | if ((ixLoc-1)==iCountStrip) { | |
38aedc99 | 160 | ixGlo = 10*fLineNumber + iModule + 1; |
0a11496e | 161 | iyGlo = iStrip; |
162 | } | |
163 | iCountStrip++; | |
164 | } | |
165 | } | |
166 | } | |
d173a061 | 167 | // printf(" in GetPadLoc2Glo fbending ixLoc iyLoc ixGlo iyGlo %i %i %i %i \n",fBending,ixLoc,iyLoc,ixGlo,iyGlo); |
0a11496e | 168 | } |
d173a061 | 169 | |
170 | //---------------------------------------------------------------------------- | |
171 | void AliMUONTriggerSegmentation::GetPadGlo2Loc(Int_t ixGlo, Int_t iyGlo, | |
172 | Int_t &ixLoc, Int_t &iyLoc) | |
173 | { | |
5398f946 | 174 | /// converts ixGlo & iyGlo into ixLoc & iyLoc |
175 | ||
d173a061 | 176 | ixLoc = 0; |
177 | iyLoc = 0; | |
178 | if (fBending) { | |
179 | ixLoc = ModuleColNum(ixGlo) + 1; | |
180 | iyLoc = iyGlo + 1; | |
181 | } else if (!fBending) { | |
182 | Int_t iCountStrip = 1; | |
183 | for (Int_t iModule=0; iModule<fNsec; iModule++) { | |
184 | for (Int_t iStrip=0; iStrip<fNstrip[iModule]; iStrip++) { | |
185 | if ((iModule==ModuleColNum(ixGlo))&&(iStrip==iyGlo)) { | |
70ef378c | 186 | iyLoc = 1; |
187 | ixLoc = iCountStrip; | |
d173a061 | 188 | } |
189 | iCountStrip++; | |
190 | } | |
191 | } | |
192 | } | |
193 | // printf(" in GetPadGlo2Loc fBending ixGlo iyGlo ixLoc iyLoc %i %i %i %i %i \n",fBending,ixGlo,iyGlo,ixLoc,iyLoc); | |
194 | } | |
195 | ||
0a11496e | 196 | //---------------------------------------------------------------------------- |
197 | void AliMUONTriggerSegmentation::GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) | |
198 | { | |
5398f946 | 199 | /// Returns local real coordinates (x,y) for local pad coordinates (ix,iy) |
d173a061 | 200 | |
0a11496e | 201 | x = 0.; |
202 | y = 0.; | |
d173a061 | 203 | Int_t iModule = ModuleColNum(ix); // find column number (0-6) |
0a11496e | 204 | if (fBending) { |
205 | if (iModule==0) { | |
38aedc99 | 206 | x = fStripXsize[iModule]/ 2.; |
0a11496e | 207 | } else { |
38aedc99 | 208 | x = fModuleXmax[iModule-1] + fStripXsize[iModule]/2.; |
209 | } | |
79b4ba23 | 210 | y = fModuleYmin[iModule] + |
d173a061 | 211 | iy*fStripYsize[iModule] + fStripYsize[iModule]/2.; |
0a11496e | 212 | } else if (!fBending) { |
d173a061 | 213 | if (ModuleColNum(ix)==6 && iy>7) { |
38aedc99 | 214 | x = fModuleXmin[iModule] + 8*fStripXsize[iModule] + |
d173a061 | 215 | (iy-8)*fStripXsize[iModule]/2. + fStripXsize[iModule]/4.; |
79b4ba23 | 216 | } else { |
217 | x = fModuleXmin[iModule] + | |
d173a061 | 218 | iy*fStripXsize[iModule] + fStripXsize[iModule]/2.; |
79b4ba23 | 219 | } |
38aedc99 | 220 | y = fModuleYmin[iModule] + fStripYsize[iModule] / 2.; |
0a11496e | 221 | } |
222 | x = x - fRpcHalfXsize; | |
223 | y = y - fRpcHalfYsize; | |
224 | ||
d173a061 | 225 | // printf(" in GetPadC fBending ix iy x y %i %i %i %f %f \n",fBending,ix,iy,x,y); |
0a11496e | 226 | } |
227 | ||
228 | //_____________________________________________________________________________ | |
229 | void AliMUONTriggerSegmentation::GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy) | |
230 | { | |
5398f946 | 231 | /// Returns global pad coordinates (ix,iy) for local real coordinates (x,y) |
232 | ||
70ef378c | 233 | ix = -1; |
234 | iy = -1; | |
67e7e5a7 | 235 | |
0a11496e | 236 | x = x + fRpcHalfXsize; |
237 | y = y + fRpcHalfYsize; | |
238 | // find module number | |
239 | Int_t modNum=0; | |
38aedc99 | 240 | for (Int_t iModule=0; iModule<fNsec; iModule++) { // modules |
0a11496e | 241 | if ( x > fModuleXmin[iModule] && x < fModuleXmax[iModule] ) { |
8ceced0c | 242 | ix = 10*fLineNumber + iModule + 1; |
0a11496e | 243 | modNum = iModule; |
244 | } | |
245 | } | |
246 | ||
247 | // find strip number | |
248 | Float_t yMin = 0.; | |
249 | Float_t yMax = fModuleYmin[modNum]; | |
250 | Float_t xMin = 0.; | |
251 | Float_t xMax = fModuleXmin[modNum]; | |
252 | if (ix!=0) { | |
253 | for (Int_t iStrip=0; iStrip<fNstrip[modNum]; iStrip++) { | |
254 | if (fBending) { | |
255 | yMin = yMax; | |
256 | yMax = yMin + fStripYsize[modNum]; | |
257 | if (y > yMin && y < yMax) iy = iStrip; | |
38aedc99 | 258 | } else if (!fBending) { |
0a11496e | 259 | xMin = xMax; |
7743b3a9 | 260 | if (modNum==6 && iStrip>7) { |
261 | xMax = xMin + fStripXsize[modNum]/2.; | |
262 | } else { | |
263 | xMax = xMin + fStripXsize[modNum]; | |
264 | } | |
0a11496e | 265 | if (x > xMin && x < xMax) iy = iStrip; |
7743b3a9 | 266 | } // |
0a11496e | 267 | } // loop on strips |
268 | } // if ix!=0 | |
d173a061 | 269 | // printf("in GetPadI fBending x y ix iy %i %f %f %i %i \n",fBending,x,y,ix,iy); |
0a11496e | 270 | } |
271 | //------------------------------------------------------------------------- | |
272 | void AliMUONTriggerSegmentation::GetPadI(Float_t x, Float_t y , Float_t /*z*/, Int_t &ix, Int_t &iy) | |
273 | { | |
5398f946 | 274 | /// Returns global pad coordinates (ix,iy) for local real coordinates (x,y) |
275 | ||
0a11496e | 276 | GetPadI(x, y, ix, iy); |
277 | } | |
d173a061 | 278 | |
0a11496e | 279 | //------------------------------------------------------------------------- |
280 | void AliMUONTriggerSegmentation::SetLineNumber(Int_t iLineNumber){ | |
5398f946 | 281 | /// Set line number |
282 | ||
0a11496e | 283 | fLineNumber = iLineNumber; |
284 | } | |
285 | //------------------------------------------------------------------------- | |
0a11496e | 286 | void AliMUONTriggerSegmentation::SetPad(Int_t ix, Int_t iy) |
287 | { | |
5398f946 | 288 | /// Sets virtual pad coordinates, needed for evaluating pad response |
289 | /// outside the tracking program | |
290 | ||
0a11496e | 291 | GetPadC(ix,iy,fX,fY); |
d173a061 | 292 | fIx = ix; // used in IntegrationLimits |
293 | fIy = iy; | |
0a11496e | 294 | fSector=Sector(ix,iy); |
295 | } | |
296 | //--------------------------------------------------------------------------- | |
297 | void AliMUONTriggerSegmentation::SetHit(Float_t x, Float_t y) | |
298 | { | |
5398f946 | 299 | /// Set current hit |
300 | ||
0a11496e | 301 | fXhit = x; |
302 | fYhit = y; | |
0a11496e | 303 | } |
304 | //---------------------------------------------------------------------------- | |
305 | void AliMUONTriggerSegmentation::SetHit(Float_t xhit, Float_t yhit, Float_t /*zhit*/) | |
306 | { | |
5398f946 | 307 | /// Set current hit |
308 | ||
0a11496e | 309 | SetHit(xhit, yhit); |
310 | } | |
311 | ||
312 | //-------------------------------------------------------------------------- | |
79b4ba23 | 313 | Int_t AliMUONTriggerSegmentation::Sector(Int_t ix, Int_t iy) |
0a11496e | 314 | { |
5398f946 | 315 | /// determine segmentation zone from pad coordinates (from 1 to 8) |
316 | ||
d173a061 | 317 | if (!fBending && ModuleColNum(ix)==6 && iy>7) { |
38aedc99 | 318 | return 8; // sector 8: diff. strip width within same module |
79b4ba23 | 319 | } else { |
d173a061 | 320 | return ModuleColNum(ix)+1; |
38aedc99 | 321 | } |
0a11496e | 322 | } |
79b4ba23 | 323 | |
0a11496e | 324 | //----------------------------------------------------------------------------- |
70ef378c | 325 | void AliMUONTriggerSegmentation::IntegrationLimits(Float_t& x1,Float_t& x2, |
326 | Float_t& x3, Float_t& x4) | |
0a11496e | 327 | { |
5398f946 | 328 | /// need to return (only) x4 = dist. betwwen the hit and the closest border of |
329 | /// the current strip | |
d173a061 | 330 | |
38aedc99 | 331 | Int_t ix,iy; |
332 | Float_t xstrip,ystrip; | |
d173a061 | 333 | GetPadI(fXhit,fYhit,ix,iy); |
334 | GetPadC(ix,iy,xstrip,ystrip); | |
70ef378c | 335 | AliDebug(1,Form("fXhit,Yhit=%e,%e xstrip,ystrip=%e,%e\n", |
336 | fXhit,fYhit,xstrip,ystrip)); | |
d173a061 | 337 | x1= (fBending) ? fYhit : fXhit; // hit y (bending) / x (!bending) position |
338 | x2= (fBending) ? ystrip : xstrip; // y or x coord. of the main strip | |
339 | x3= (fBending) ? fY : fX; // current strip real y or x coord. | |
340 | Int_t modNum = ModuleColNum(fIx); | |
38aedc99 | 341 | |
d173a061 | 342 | // find the position of the 2 borders of the current strip |
343 | Float_t min = 0.; | |
344 | Float_t max = 0.; | |
345 | if (fBending) { | |
346 | min = x3 - fStripYsize[modNum]/2.; | |
347 | max = x3 + fStripYsize[modNum]/2.; | |
348 | } else { | |
349 | if (modNum==6 && fIy>7) { // equivalent to fSector == 8 | |
350 | min = x3 - fStripXsize[modNum]/4.; | |
351 | max = x3 + fStripXsize[modNum]/4.; | |
352 | } else | |
353 | min = x3 - fStripXsize[modNum]/2.; | |
354 | max = x3 + fStripXsize[modNum]/2.; | |
355 | } | |
38aedc99 | 356 | // dist. between the hit and the closest border of the current strip |
d173a061 | 357 | x4 = (TMath::Abs(max-x1) > TMath::Abs(min-x1)) ? |
70ef378c | 358 | TMath::Abs(min-x1):TMath::Abs(max-x1); |
359 | ||
360 | AliDebug(1,Form("Bending %d x1=%e x2=%e x3=%e x4=%e xmin,max=%e,%e\n", | |
361 | fBending,x1,x2,x3,x4,min,max)); | |
0a11496e | 362 | } |
38aedc99 | 363 | |
364 | ||
0a11496e | 365 | //----------------------------------------------------------------------------- |
366 | void AliMUONTriggerSegmentation:: | |
367 | Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) | |
368 | { | |
5398f946 | 369 | /// <pre> |
370 | ///-----------------BENDING----------------------------------------- | |
371 | /// Returns list of 10 next neighbours for given X strip (ix, iy) | |
372 | /// neighbour number 4 in the list - | |
373 | /// neighbour number 3 in the list | | |
374 | /// neighbour number 2 in the list |_ Upper part | |
375 | /// neighbour number 1 in the list | | |
376 | /// neighbour number 0 in the list - | |
377 | /// X strip (ix, iy) | |
378 | /// neighbour number 5 in the list - | |
379 | /// neighbour number 6 in the list | _ Lower part | |
380 | /// neighbour number 7 in the list | | |
381 | /// neighbour number 8 in the list | | |
382 | /// neighbour number 9 in the list - | |
383 | /// | |
384 | ///-----------------NON-BENDING------------------------------------- | |
385 | /// Returns list of 10 next neighbours for given Y strip (ix, iy) | |
386 | /// neighbour number 9 8 7 6 5 (Y strip (ix, iy)) 0 1 2 3 4 in the list | |
387 | /// \\_______/ \\_______/ | |
388 | /// left right | |
d173a061 | 389 | |
390 | Int_t absiX = TMath::Abs(iX); | |
391 | Int_t modNum = ModuleColNum(absiX); // from 0 to 6 | |
392 | Int_t nStrip = fNstrip[modNum]; | |
393 | ||
394 | if (fBending) { | |
395 | Int_t iCandidateUp, iCandidateDo; | |
396 | Int_t j; | |
397 | ||
398 | *Nlist = 10; | |
399 | for (Int_t i=0; i<10; i++) Xlist[i]=Ylist[i]=0; | |
400 | ||
401 | if (iY < nStrip) { | |
402 | for (Int_t i=0; i<5; i++) { | |
403 | j = i + 5; | |
404 | iCandidateUp = iY + (i + 1); | |
405 | iCandidateDo = iY - (i + 1); | |
406 | if (iCandidateUp < nStrip) { | |
407 | Xlist[i] = iX; | |
408 | Ylist[i] = iCandidateUp; | |
409 | } | |
410 | if (iCandidateDo >= 0) { | |
411 | Xlist[j] = iX; | |
412 | Ylist[j] = iCandidateDo; | |
413 | } | |
414 | } | |
415 | } // iY < nStrip | |
416 | ||
417 | } else { // non-bending | |
418 | ||
419 | Int_t iCandidateLeft, iCandidateRight; | |
420 | Int_t iNewCandidateRight=0; | |
421 | Int_t iNewCandidateLeft=0; | |
422 | // first strip number on the right of the left module | |
423 | if ( modNum!=0 && absiX!=52 ) | |
424 | iNewCandidateLeft = fNstrip[modNum-1]-1; | |
425 | Int_t j; | |
426 | ||
427 | *Nlist = 10; | |
428 | for (Int_t i=0; i<10; i++) Xlist[i]=Ylist[i]=0; | |
429 | ||
430 | if (iY < nStrip) { | |
431 | ||
432 | for (Int_t i=0; i<5; i++) { | |
433 | j = i + 5; | |
434 | iCandidateRight = iY + (i + 1); | |
435 | iCandidateLeft = iY - (i + 1); | |
436 | if (iCandidateRight < nStrip) { // strip in same module | |
437 | Xlist[i] = absiX; | |
438 | Ylist[i] = iCandidateRight; | |
439 | } else if (modNum!=6) { // need to scan the module on the right | |
440 | Xlist[i] = absiX+1; | |
441 | Ylist[i] = iNewCandidateRight; | |
442 | iNewCandidateRight++; | |
443 | } | |
444 | ||
445 | if (iCandidateLeft >=0 ) { // strip in same module | |
446 | Xlist[j] = absiX; | |
447 | Ylist[j] = iCandidateLeft; | |
448 | } else if ( iNewCandidateLeft !=0) { | |
449 | Xlist[j] = absiX-1; | |
450 | Ylist[j] = iNewCandidateLeft; | |
451 | iNewCandidateLeft--; | |
452 | } | |
453 | } | |
454 | ||
455 | if (iX<0) { // left side of chamber | |
456 | for (Int_t i=0; i<10; i++) { | |
457 | if (Xlist[i]!=0) Xlist[i]=-Xlist[i]; | |
458 | } | |
459 | } | |
460 | ||
461 | } // iY < nStrip | |
462 | } // non-bending | |
463 | ||
464 | // for (Int_t i=0; i<10; i++) { | |
465 | // printf("AliMUONTriggerSegmentation LOC fBending i ix iy = %i %i %i %i \n",fBending,i,Xlist[i],Ylist[i]); | |
466 | // } | |
0a11496e | 467 | } |
468 | ||
469 | //-------------------------------------------------------------------------- | |
470 | void AliMUONTriggerSegmentation::Init(Int_t detectionElementId, | |
0a11496e | 471 | Int_t nStrip[7], |
472 | Float_t stripYsize[7], | |
473 | Float_t stripXsize[7], | |
474 | Float_t offset) | |
475 | { | |
5398f946 | 476 | /// Initialize |
477 | ||
79b4ba23 | 478 | // printf(" fBending: %d \n",fBending); |
479 | ||
480 | Int_t nStripMax = 0; | |
481 | if (fBending) nStripMax = nStrip[0]; | |
482 | ||
483 | for (Int_t i=0; i<7; i++) { | |
484 | fNstrip[i]=nStrip[i]; | |
485 | fStripYsize[i]=stripYsize[i]; | |
486 | fStripXsize[i]=stripXsize[i]; | |
487 | fModuleYmin[0]=0.; | |
488 | } | |
0a11496e | 489 | // take care of offset in Y in chamber 5, first module |
79b4ba23 | 490 | fModuleYmin[0] = offset; |
491 | ||
492 | Float_t tmp = 0.; | |
493 | Int_t npad = 0; // number of pad in x and y | |
38aedc99 | 494 | for (Int_t iModule=0; iModule<fNsec; iModule++) { // modules |
79b4ba23 | 495 | fModuleXmin[iModule] = tmp; |
496 | npad = npad + fNstrip[iModule]; | |
497 | if (fBending) { | |
498 | fModuleXmax[iModule] = | |
499 | fModuleXmin[iModule] + fStripXsize[iModule]; | |
500 | } else if (!fBending) { | |
501 | if (iModule<6) { | |
502 | fModuleXmax[iModule] = | |
38aedc99 | 503 | fModuleXmin[iModule] + |
504 | fStripXsize[iModule]*fNstrip[iModule]; | |
79b4ba23 | 505 | } else if (iModule==6) { |
506 | fModuleXmax[iModule] = | |
507 | fModuleXmin[iModule] + | |
508 | (fStripXsize[iModule]*fNstrip[iModule]/2) + | |
509 | (fStripXsize[iModule]/2.*fNstrip[iModule]/2); | |
510 | } | |
511 | } | |
512 | tmp = fModuleXmax[iModule]; | |
513 | ||
514 | // calculate nStripMax in x & y | |
515 | if (fBending) { | |
516 | if (fNstrip[iModule] > nStripMax) nStripMax = fNstrip[iModule]; | |
517 | } else if (!fBending) { | |
518 | for (Int_t iStrip=0; iStrip<fNstrip[iModule]; iStrip++) nStripMax++; | |
519 | } | |
520 | } // loop on modules | |
0a11496e | 521 | |
522 | // associate nStripMax | |
7743b3a9 | 523 | // fNpx = (fBending) ? fNsec : nStripMax; |
524 | // fNpy = (fBending) ? nStripMax : 1; | |
8ceced0c | 525 | fNpx = 124; // tot num of modules (like with old segmentation) |
526 | fNpy = 64; // max number of y strips within one module | |
527 | ||
38aedc99 | 528 | // calculate half size in x & y (to shift local coordinate ref. system) |
0a11496e | 529 | fRpcHalfXsize = 0; |
530 | fRpcHalfYsize = 0; | |
531 | if (fBending) { | |
38aedc99 | 532 | for (Int_t iModule=0; iModule<fNsec; iModule++) |
0a11496e | 533 | fRpcHalfXsize = fRpcHalfXsize + fStripXsize[iModule]; |
534 | fRpcHalfYsize = fNstrip[1] * fStripYsize[1]; | |
535 | } else if (!fBending) { | |
536 | fRpcHalfXsize = fModuleXmax[6]; | |
537 | fRpcHalfYsize = fStripYsize[1]; | |
538 | } | |
539 | fRpcHalfXsize = fRpcHalfXsize / 2.; | |
540 | fRpcHalfYsize = fRpcHalfYsize / 2.; | |
541 | ||
542 | /* | |
543 | printf(" fNpx fNpy fRpcHalfXsize fRpcHalfYsize = %i %i %f %f \n", | |
544 | fNpx,fNpy,fRpcHalfXsize,fRpcHalfYsize); | |
545 | ||
38aedc99 | 546 | for (Int_t iModule=0; iModule<fNsec; iModule++) { |
79b4ba23 | 547 | printf(" iModule fModuleXmin fModuleXmax fModuleYmin fStripXsize fStripYsize %i %f %f %f %f %f\n", |
0a11496e | 548 | iModule,fModuleXmin[iModule],fModuleXmax[iModule], |
79b4ba23 | 549 | fModuleYmin[iModule], |
0a11496e | 550 | fStripXsize[iModule],fStripYsize[iModule]); |
551 | } | |
79b4ba23 | 552 | |
38aedc99 | 553 | for (Int_t iModule=0; iModule<fNsec; iModule++) { |
79b4ba23 | 554 | printf(" iModule fNstrip fStripXsize fStripYsize %i %i %f %f \n", |
555 | iModule,fNstrip[iModule], | |
556 | fStripXsize[iModule],fStripYsize[iModule]); | |
557 | } | |
558 | */ | |
559 | ||
0a11496e | 560 | fId = detectionElementId; |
561 | } | |
562 | ||
70ef378c | 563 | //_____________________________________________________________________________ |
564 | void | |
565 | AliMUONTriggerSegmentation::Print(Option_t*) const | |
566 | { | |
5398f946 | 567 | /// Printing |
d19b6003 | 568 | |
70ef378c | 569 | cout << "fId=" << fId << " fBending=" << fBending << " fNsec=" |
570 | << fNsec << " Nx,Ny=" << fNpx << "," << fNpy | |
571 | << " LineNumber=" << fLineNumber | |
572 | << " fRpcHalfSize(X,Y)=" << fRpcHalfXsize << "," << fRpcHalfYsize | |
573 | << endl; | |
574 | ||
575 | for (Int_t iModule=0; iModule<fNsec; iModule++) | |
576 | { | |
577 | cout << "Module " << iModule | |
578 | << " xmin,xmax=" << fModuleXmin[iModule] | |
579 | << "," << fModuleXmax[iModule] | |
580 | << " ymin=" << fModuleYmin[iModule] | |
581 | << " StripSize(X,Y)=(" << fStripXsize[iModule] << "," | |
582 | << fStripYsize[iModule] << ")" | |
583 | << endl; | |
584 | } | |
585 | } | |
0a11496e | 586 | |
587 | ||
588 | ||
589 | ||
590 |