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