]>
Commit | Line | Data |
---|---|---|
a9e2aefa | 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 | ||
88cb7938 | 16 | /* $Id$ */ |
a9e2aefa | 17 | |
18 | ///////////////////////////////////////////////////// | |
19 | // Segmentation and Response classes version 01 // | |
20 | ///////////////////////////////////////////////////// | |
21 | ||
22 | #include <TBox.h> | |
aaf4addd | 23 | #include <TTUBE.h> |
24 | #include <TBRIK.h> | |
25 | #include <TNode.h> | |
26 | #include <TGeometry.h> | |
a9e2aefa | 27 | #include <TF1.h> |
3afc6e30 | 28 | #include <TVector3.h> |
a9e2aefa | 29 | #include <TObjArray.h> |
a9e2aefa | 30 | |
31 | #include "AliMUONSegmentationV01.h" | |
32 | #include "AliMUON.h" | |
3e1872ed | 33 | #include "AliMUONChamber.h" |
34 | #include "AliRun.h" | |
8c343c7c | 35 | #include "AliLog.h" |
a9e2aefa | 36 | |
37 | ||
30178c30 | 38 | |
a9e2aefa | 39 | //___________________________________________ |
40 | ClassImp(AliMUONSegmentationV01) | |
41 | ||
30178c30 | 42 | AliMUONSegmentationV01::AliMUONSegmentationV01(const AliMUONSegmentationV01& segmentation) |
43 | : AliMUONSegmentationV0(segmentation) | |
a9e2aefa | 44 | { |
30178c30 | 45 | // Protected copy constructor |
46 | ||
8c343c7c | 47 | AliFatal("Not implemented."); |
a9e2aefa | 48 | } |
e9e4cdf2 | 49 | |
a9e2aefa | 50 | AliMUONSegmentationV01::AliMUONSegmentationV01() |
30178c30 | 51 | : AliMUONSegmentationV0() |
a9e2aefa | 52 | { |
53 | // Default constructor | |
e9e4cdf2 | 54 | fRSec = 0; |
55 | fNDiv = 0; | |
a8a6107b | 56 | fDpxD = 0; |
57 | fCorrA = 0; | |
0951fe3d | 58 | fSector = -1; |
e9e4cdf2 | 59 | } |
60 | ||
61 | AliMUONSegmentationV01::AliMUONSegmentationV01(Int_t nsec) | |
30178c30 | 62 | : AliMUONSegmentationV0() |
e9e4cdf2 | 63 | { |
64 | // Non default constructor | |
65 | ||
66 | fNsec = nsec; | |
c3eff6ad | 67 | fRSec = new TArrayF(fNsec); |
68 | fNDiv = new TArrayI(fNsec); | |
69 | fDpxD = new TArrayF(fNsec); | |
e9e4cdf2 | 70 | |
71 | ||
c3eff6ad | 72 | (*fRSec)[0]=(*fRSec)[1]=(*fRSec)[2]=(*fRSec)[3]=0; |
73 | (*fNDiv)[0]=(*fNDiv)[1]=(*fNDiv)[2]=(*fNDiv)[3]=0; | |
74 | (*fDpxD)[0]=(*fDpxD)[1]=(*fDpxD)[2]=(*fDpxD)[3]=0; | |
bac96a1c | 75 | fCorrA = new TObjArray(3); |
cd4df77b | 76 | fCorrA->AddAt(0,0); |
77 | fCorrA->AddAt(0,1); | |
78 | fCorrA->AddAt(0,2); | |
e80ad807 | 79 | fOffsetY=0; |
0951fe3d | 80 | fSector = -1; |
a9e2aefa | 81 | } |
82 | ||
e9e4cdf2 | 83 | AliMUONSegmentationV01::~AliMUONSegmentationV01() |
84 | { | |
85 | // Destructor | |
86 | if (fRSec) delete fRSec; | |
87 | if (fNDiv) delete fNDiv; | |
88 | if (fDpxD) delete fDpxD; | |
89 | if (fCorrA) { | |
90 | fCorrA->Delete(); | |
91 | delete fCorrA; | |
92 | } | |
93 | } | |
94 | ||
95 | ||
94de3818 | 96 | Float_t AliMUONSegmentationV01::Dpx(Int_t isec) const |
a9e2aefa | 97 | { |
98 | // | |
99 | // Returns x-pad size for given sector isec | |
c3eff6ad | 100 | Float_t dpx = (*fDpxD)[isec]; |
101 | return dpx; | |
a9e2aefa | 102 | } |
103 | ||
b1ad38fa | 104 | Float_t AliMUONSegmentationV01::Dpy(Int_t /*isec*/) const |
a9e2aefa | 105 | { |
106 | // | |
107 | // Returns y-pad size for given sector isec | |
108 | return fDpy; | |
109 | } | |
110 | ||
111 | void AliMUONSegmentationV01::SetSegRadii(Float_t r[4]) | |
112 | { | |
113 | // | |
114 | // Set the radii of the segmentation zones | |
115 | for (Int_t i=0; i<4; i++) { | |
c3eff6ad | 116 | (*fRSec)[i]=r[i]; |
a9e2aefa | 117 | } |
118 | } | |
119 | ||
120 | ||
121 | void AliMUONSegmentationV01::SetPadDivision(Int_t ndiv[4]) | |
122 | { | |
123 | // | |
124 | // Defines the pad size perp. to the anode wire (y) for different sectors. | |
125 | // Pad sizes are defined as integral fractions ndiv of a basis pad size | |
126 | // fDpx | |
127 | // | |
128 | for (Int_t i=0; i<4; i++) { | |
c3eff6ad | 129 | (*fNDiv)[i]=ndiv[i]; |
a9e2aefa | 130 | } |
131 | ndiv[0]=ndiv[1]; | |
132 | } | |
133 | ||
134 | ||
d81db581 | 135 | void AliMUONSegmentationV01::Init(Int_t chamber) |
a9e2aefa | 136 | { |
137 | // | |
138 | // Fill the arrays fCx (x-contour) and fNpxS (ix-contour) for each sector | |
139 | // These arrays help in converting from real to pad co-ordinates and | |
140 | // vice versa. | |
141 | // This version approximates concentric segmentation zones | |
142 | // | |
c9d10ab5 | 143 | |
a9e2aefa | 144 | Int_t isec; |
9e1a0ddb | 145 | //printf("\n Initialise Segmentation V01\n"); |
e9e4cdf2 | 146 | |
147 | ||
c3eff6ad | 148 | fNpy=Int_t((*fRSec)[fNsec-1]/fDpy)+1; |
a9e2aefa | 149 | |
c3eff6ad | 150 | (*fDpxD)[fNsec-1]=fDpx; |
a9e2aefa | 151 | if (fNsec > 1) { |
152 | for (Int_t i=fNsec-2; i>=0; i--){ | |
c3eff6ad | 153 | (*fDpxD)[i]=(*fDpxD)[fNsec-1]/(*fNDiv)[i]; |
a9e2aefa | 154 | } |
155 | } | |
156 | // | |
157 | // fill the arrays defining the pad segmentation boundaries | |
158 | Float_t ry; | |
159 | Int_t dnx; | |
160 | Int_t add; | |
161 | // | |
162 | // loop over sections | |
163 | for(isec=0; isec<fNsec; isec++) { | |
164 | // | |
165 | // loop over pads along the aode wires | |
166 | for (Int_t iy=1; iy<=fNpy; iy++) { | |
167 | // | |
168 | Float_t x=iy*fDpy-fDpy/2; | |
c3eff6ad | 169 | if (x > (*fRSec)[isec]) { |
a9e2aefa | 170 | fNpxS[isec][iy]=0; |
171 | fCx[isec][iy]=0; | |
172 | } else { | |
c3eff6ad | 173 | ry=TMath::Sqrt((*fRSec)[isec]*(*fRSec)[isec]-x*x); |
a9e2aefa | 174 | if (isec > 1) { |
c3eff6ad | 175 | dnx= Int_t((ry-fCx[isec-1][iy])/(*fDpxD)[isec]); |
a9e2aefa | 176 | if (isec < fNsec-1) { |
177 | if (TMath::Odd((Long_t)dnx)) dnx++; | |
178 | } | |
179 | fNpxS[isec][iy]=fNpxS[isec-1][iy]+dnx; | |
c3eff6ad | 180 | fCx[isec][iy]=fCx[isec-1][iy]+dnx*(*fDpxD)[isec]; |
a9e2aefa | 181 | } else if (isec == 1) { |
c3eff6ad | 182 | dnx= Int_t((ry-fCx[isec-1][iy])/(*fDpxD)[isec]); |
a9e2aefa | 183 | fNpxS[isec][iy]=fNpxS[isec-1][iy]+dnx; |
184 | add=4 - (fNpxS[isec][iy])%4; | |
185 | if (add < 4) fNpxS[isec][iy]+=add; | |
186 | dnx=fNpxS[isec][iy]-fNpxS[isec-1][iy]; | |
c3eff6ad | 187 | fCx[isec][iy]=fCx[isec-1][iy]+dnx*(*fDpxD)[isec]; |
a9e2aefa | 188 | } else { |
c3eff6ad | 189 | dnx=Int_t(ry/(*fDpxD)[isec]); |
a9e2aefa | 190 | fNpxS[isec][iy]=dnx; |
c3eff6ad | 191 | fCx[isec][iy]=dnx*(*fDpxD)[isec]; |
a9e2aefa | 192 | } |
193 | } | |
194 | } // y-pad loop | |
195 | } // sector loop | |
c9d10ab5 | 196 | |
3e1872ed | 197 | // reference to chamber |
198 | AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); | |
199 | fChamber=&(pMUON->Chamber(chamber)); | |
c9d10ab5 | 200 | fRmin=fChamber->RInner(); |
201 | fRmax=fChamber->ROuter(); | |
202 | fCorr=0; | |
3e1872ed | 203 | fZ = fChamber->Z(); |
aaf4addd | 204 | fId=chamber; |
a9e2aefa | 205 | } |
206 | ||
30178c30 | 207 | //______________________________________________________________________ |
a9e2aefa | 208 | Int_t AliMUONSegmentationV01::Sector(Int_t ix, Int_t iy) |
209 | { | |
210 | // Returns sector number for given pad position | |
211 | // | |
212 | Int_t absix=TMath::Abs(ix); | |
213 | Int_t absiy=TMath::Abs(iy); | |
214 | Int_t isec=0; | |
215 | for (Int_t i=0; i<fNsec; i++) { | |
216 | if (absix<=fNpxS[i][absiy]){ | |
217 | isec=i; | |
218 | break; | |
219 | } | |
220 | } | |
221 | return isec; | |
222 | } | |
30178c30 | 223 | |
b1ad38fa | 224 | //______________________________________________________________________ |
225 | void AliMUONSegmentationV01::GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy) | |
a9e2aefa | 226 | { |
227 | // Returns pad coordinates (ix,iy) for given real coordinates (x,y) | |
228 | // | |
e80ad807 | 229 | iy = (y-fOffsetY >0)? |
230 | Int_t((y-fOffsetY)/fDpy)+1 | |
231 | : | |
232 | Int_t((y-fOffsetY)/fDpy)-1; | |
233 | ||
a9e2aefa | 234 | if (iy > fNpy) iy= fNpy; |
235 | if (iy < -fNpy) iy=-fNpy; | |
236 | // | |
237 | // Find sector isec | |
238 | Int_t isec=-1; | |
239 | Float_t absx=TMath::Abs(x); | |
240 | Int_t absiy=TMath::Abs(iy); | |
241 | for (Int_t i=0; i < fNsec; i++) { | |
242 | if (absx <= fCx[i][absiy]) { | |
243 | isec=i; | |
244 | break; | |
245 | } | |
246 | } | |
247 | if (isec>0) { | |
c3eff6ad | 248 | ix= Int_t((absx-fCx[isec-1][absiy])/(*fDpxD)[isec]) |
a9e2aefa | 249 | +fNpxS[isec-1][absiy]+1; |
250 | } else if (isec == 0) { | |
c3eff6ad | 251 | ix= Int_t(absx/(*fDpxD)[isec])+1; |
a9e2aefa | 252 | } else { |
253 | ix=fNpxS[fNsec-1][absiy]+1; | |
254 | } | |
255 | ix = (x>0) ? ix:-ix; | |
256 | } | |
b1ad38fa | 257 | //________________________________________________________________ |
258 | void AliMUONSegmentationV01::GetPadI(Float_t x, Float_t y , Float_t /*z*/, Int_t &ix, Int_t &iy) | |
259 | { | |
260 | GetPadI(x, y, ix, iy); | |
261 | } | |
262 | //________________________________________________________________ | |
a9e2aefa | 263 | |
264 | void AliMUONSegmentationV01:: | |
a30a000f | 265 | GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) |
a9e2aefa | 266 | { |
267 | // Returns real coordinates (x,y) for given pad coordinates (ix,iy) | |
268 | // | |
bdf39337 | 269 | y = (iy>0) ? |
270 | Float_t(iy*fDpy)-fDpy/2.+fOffsetY | |
271 | : | |
272 | Float_t(iy*fDpy)+fDpy/2.+fOffsetY; | |
273 | ||
a9e2aefa | 274 | // |
275 | // Find sector isec | |
276 | Int_t isec=AliMUONSegmentationV01::Sector(ix,iy); | |
277 | // | |
278 | Int_t absix=TMath::Abs(ix); | |
279 | Int_t absiy=TMath::Abs(iy); | |
280 | if (isec) { | |
c3eff6ad | 281 | x=fCx[isec-1][absiy]+(absix-fNpxS[isec-1][absiy])*(*fDpxD)[isec]; |
282 | x=(ix>0) ? x-(*fDpxD)[isec]/2 : -x+(*fDpxD)[isec]/2; | |
a9e2aefa | 283 | } else { |
284 | x=y=0; | |
285 | } | |
3afc6e30 | 286 | |
287 | } | |
288 | //________________________________________________________________ | |
289 | ||
290 | void AliMUONSegmentationV01:: | |
291 | GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z) | |
292 | { | |
293 | // Returns real coordinates (x,y,z) for given pad coordinates (ix,iy) | |
294 | // | |
295 | GetPadC(ix,iy,x,y); | |
296 | ||
297 | // To be properly interfaced with chamber geometry (AliMUONSt1GeometryBuilderV2) ??? | |
298 | TVector3 scale[4]; | |
299 | scale[0] = TVector3( 1, 1, 1); // quadrant I | |
300 | scale[1] = TVector3(-1, 1, -1); // quadrant II | |
301 | scale[2] = TVector3(-1, -1, 1); // quadrant III | |
302 | scale[3] = TVector3( 1, -1, -1); // quadrant IV | |
303 | ||
304 | Int_t iQuadrant; | |
305 | ||
306 | if (ix > 0) { | |
307 | if (iy > 0) { | |
308 | iQuadrant = 0; | |
309 | } else { | |
310 | iQuadrant = 3; | |
311 | } | |
312 | } else { | |
313 | if (iy > 0) { | |
314 | iQuadrant = 1; | |
315 | } else { | |
316 | iQuadrant = 2; | |
317 | } | |
318 | } | |
319 | if (TMath::Abs(fZ) < 600) { | |
320 | z = fZ + scale[iQuadrant].Z()*6.5/2.; // Station 1 | |
321 | } else { | |
322 | z = fZ; // Station 2 | |
323 | } | |
a9e2aefa | 324 | } |
325 | ||
326 | void AliMUONSegmentationV01:: | |
327 | SetPad(Int_t ix, Int_t iy) | |
328 | { | |
329 | // | |
330 | // Sets virtual pad coordinates, needed for evaluating pad response | |
331 | // outside the tracking program | |
ecfa008b | 332 | GetPadC(ix,iy,fX,fY); |
a9e2aefa | 333 | fSector=Sector(ix,iy); |
334 | } | |
335 | ||
b1ad38fa | 336 | //______________________________________________________________________ |
337 | void AliMUONSegmentationV01::FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy) | |
a9e2aefa | 338 | { |
339 | // Initialises iteration over pads for charge distribution algorithm | |
340 | // | |
341 | // | |
342 | // Find the wire position (center of charge distribution) | |
343 | Float_t x0a=GetAnod(xhit); | |
ecfa008b | 344 | fXhit=x0a; |
345 | fYhit=yhit; | |
a9e2aefa | 346 | |
347 | // | |
348 | // and take fNsigma*sigma around this center | |
349 | Float_t x01=x0a - dx; | |
350 | Float_t x02=x0a + dx; | |
351 | Float_t y01=yhit - dy; | |
352 | Float_t y02=yhit + dy; | |
353 | // | |
354 | // find the pads over which the charge distributes | |
c3eff6ad | 355 | |
ecfa008b | 356 | GetPadI(x01,y01,fIxmin,fIymin); |
357 | GetPadI(x02,y02,fIxmax,fIymax); | |
358 | fXmin=x01; | |
359 | fXmax=x02; | |
360 | fYmin=y01; | |
361 | fYmax=y02; | |
a9e2aefa | 362 | |
363 | // | |
364 | // Set current pad to lower left corner | |
ecfa008b | 365 | if (fIxmax < fIxmin) fIxmax=fIxmin; |
366 | if (fIymax < fIymin) fIymax=fIymin; | |
367 | fIx=fIxmin; | |
368 | fIy=fIymin; | |
369 | GetPadC(fIx,fIy,fX,fY); | |
30178c30 | 370 | |
0951fe3d | 371 | // added |
372 | if (fSector == -1) { | |
373 | fSector=Sector(fIx,fIy); | |
374 | } | |
a9e2aefa | 375 | } |
376 | ||
377 | ||
378 | void AliMUONSegmentationV01::NextPad() | |
379 | { | |
380 | // Stepper for the iteration over pads | |
381 | // | |
382 | // Step to next pad in the integration region | |
383 | // | |
384 | // Step to next pad in integration region | |
385 | Float_t xc,yc; | |
386 | Int_t iyc; | |
387 | ||
388 | // step from left to right | |
c3eff6ad | 389 | |
ecfa008b | 390 | if (fX < fXmax && fX != 0) { |
391 | if (fIx==-1) fIx++; | |
392 | fIx++; | |
a9e2aefa | 393 | // step up |
ecfa008b | 394 | } else if (fIy != fIymax) { |
395 | if (fIy==-1) fIy++; | |
396 | fIy++; | |
a9e2aefa | 397 | // get y-position of next row (yc), xc not used here |
ecfa008b | 398 | GetPadC(fIx,fIy,xc,yc); |
399 | // get x-pad coordiante for first pad in row (fIx) | |
400 | GetPadI(fXmin,yc,fIx,iyc); | |
a9e2aefa | 401 | } else { |
d7d176c9 | 402 | fIx=-1; |
403 | fIy=-1; | |
a9e2aefa | 404 | } |
ecfa008b | 405 | GetPadC(fIx,fIy,fX,fY); |
406 | fSector=Sector(fIx,fIy); | |
a9e2aefa | 407 | if (MorePads() && |
408 | (fSector ==-1 || fSector==0)) | |
409 | NextPad(); | |
410 | } | |
411 | ||
412 | Int_t AliMUONSegmentationV01::MorePads() | |
de05461e | 413 | |
414 | { | |
a9e2aefa | 415 | // Stopping condition for the iterator over pads |
416 | // | |
417 | // Are there more pads in the integration region | |
d7d176c9 | 418 | return (fIx != -1 || fIy != -1); |
419 | /* | |
ecfa008b | 420 | if ((fX >= fXmax && fIy >= fIymax) || fY==0) { |
a9e2aefa | 421 | return 0; |
422 | } else { | |
423 | return 1; | |
424 | } | |
d7d176c9 | 425 | */ |
a9e2aefa | 426 | } |
b1ad38fa | 427 | //______________________________________________________________________ |
428 | void AliMUONSegmentationV01::FirstPad(Float_t xhit, Float_t yhit, Float_t /*zhit*/, Float_t dx, Float_t dy) | |
429 | { | |
430 | FirstPad(xhit, yhit, dx, dy); | |
431 | } | |
432 | ||
a9e2aefa | 433 | |
434 | void AliMUONSegmentationV01:: | |
435 | IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2) | |
436 | { | |
437 | // Returns integration limits for current pad | |
438 | // | |
ecfa008b | 439 | x1=fXhit-fX-Dpx(fSector)/2.; |
a9e2aefa | 440 | x2=x1+Dpx(fSector); |
ecfa008b | 441 | y1=fYhit-fY-Dpy(fSector)/2.; |
a9e2aefa | 442 | y2=y1+Dpy(fSector); |
443 | } | |
444 | ||
445 | void AliMUONSegmentationV01:: | |
446 | Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) | |
447 | { | |
448 | // Returns list of next neighbours for given Pad (iX, iY) | |
449 | // | |
450 | const Float_t kEpsilon=fDpy/1000; | |
451 | ||
452 | Float_t x,y; | |
453 | Int_t ixx, iyy, isec1; | |
454 | // | |
455 | Int_t isec0=AliMUONSegmentationV01::Sector(iX,iY); | |
456 | Int_t i=0; | |
457 | // | |
458 | // step right | |
459 | Xlist[i]=iX+1; | |
460 | if (Xlist[i]==0) Xlist[i]++; | |
461 | Ylist[i++]=iY; | |
462 | // | |
463 | // step left | |
464 | Xlist[i]=iX-1; | |
465 | if (Xlist[i]==0) Xlist[i]--; | |
466 | Ylist[i++]=iY; | |
467 | // | |
468 | // step up | |
a30a000f | 469 | AliMUONSegmentationV01::GetPadC(iX,iY,x,y); |
470 | AliMUONSegmentationV01::GetPadI(x+kEpsilon,y+fDpy,ixx,iyy); | |
a9e2aefa | 471 | Xlist[i]=ixx; |
472 | Ylist[i++]=iyy; | |
473 | isec1=AliMUONSegmentationV01::Sector(ixx,iyy); | |
474 | if (isec1==isec0) { | |
475 | // | |
476 | // no sector boundary crossing | |
477 | // Xlist[i]=ixx+1; | |
478 | // Ylist[i++]=iY+1; | |
479 | ||
480 | // Xlist[i]=ixx-1; | |
481 | // Ylist[i++]=iY+1; | |
482 | } else if (isec1 < isec0) { | |
483 | // finer segmentation | |
484 | // Xlist[i]=ixx+1; | |
485 | // Ylist[i++]=iY+1; | |
486 | ||
487 | Xlist[i]=ixx-1; | |
488 | Ylist[i++]=iyy; | |
489 | ||
490 | // Xlist[i]=ixx-2; | |
491 | // Ylist[i++]=iY+1; | |
492 | } else { | |
493 | // coarser segmenation | |
494 | /* | |
495 | if (TMath::Odd(iX-fNpxS[isec1-1][iY+1])) { | |
496 | Xlist[i]=ixx-1; | |
497 | Ylist[i++]=iY+1; | |
498 | } else { | |
499 | Xlist[i]=ixx+1; | |
500 | Ylist[i++]=iY+1; | |
501 | } | |
502 | */ | |
503 | } | |
504 | ||
505 | // | |
506 | // step down | |
a30a000f | 507 | AliMUONSegmentationV01::GetPadC(iX,iY,x,y); |
508 | AliMUONSegmentationV01::GetPadI(x+kEpsilon,y-fDpy,ixx,iyy); | |
a9e2aefa | 509 | Xlist[i]=ixx; |
510 | Ylist[i++]=iyy; | |
511 | isec1=AliMUONSegmentationV01::Sector(ixx,iyy); | |
512 | if (isec1==isec0) { | |
513 | // | |
514 | // no sector boundary crossing | |
515 | /* | |
516 | Xlist[i]=ixx+1; | |
517 | Ylist[i++]=iY-1; | |
518 | ||
519 | Xlist[i]=ixx-1; | |
520 | Ylist[i++]=iY-1; | |
521 | */ | |
522 | } else if (isec1 < isec0) { | |
523 | // finer segmentation | |
524 | // Xlist[i]=ixx+1; | |
525 | // Ylist[i++]=iY-1; | |
526 | ||
527 | Xlist[i]=ixx-1; | |
528 | Ylist[i++]=iyy; | |
529 | ||
530 | // Xlist[i]=ixx-2; | |
531 | // Ylist[i++]=iY-1; | |
532 | } else { | |
533 | // coarser segmentation | |
534 | /* | |
535 | if (TMath::Odd(iX-fNpxS[isec1-1][iY-1])) { | |
536 | Xlist[i]=ixx-1; | |
537 | Ylist[i++]=iY-1; | |
538 | } else { | |
539 | Xlist[i]=ixx+1; | |
540 | Ylist[i++]=iY-1; | |
541 | } | |
542 | */ | |
543 | } | |
544 | *Nlist=i; | |
545 | } | |
546 | ||
c3eff6ad | 547 | void AliMUONSegmentationV01::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) const |
a9e2aefa | 548 | { |
549 | // Returns test point on the pad plane. | |
550 | // Used during determination of the segmoid correction of the COG-method | |
551 | ||
552 | n=3; | |
c3eff6ad | 553 | x[0]=((*fRSec)[0]+(*fRSec)[1])/2/TMath::Sqrt(2.); |
a9e2aefa | 554 | y[0]=x[0]; |
c3eff6ad | 555 | x[1]=((*fRSec)[1]+(*fRSec)[2])/2/TMath::Sqrt(2.); |
a9e2aefa | 556 | y[1]=x[1]; |
c3eff6ad | 557 | x[2]=((*fRSec)[2]+(*fRSec)[3])/2/TMath::Sqrt(2.); |
a9e2aefa | 558 | y[2]=x[2]; |
559 | } | |
560 | ||
c9d10ab5 | 561 | void AliMUONSegmentationV01::Draw(const char* opt) |
a9e2aefa | 562 | { |
aaf4addd | 563 | |
a9e2aefa | 564 | // Draws the segmentation zones |
565 | // | |
aaf4addd | 566 | if (!strcmp(opt,"eventdisplay")) { |
567 | const int kColorMUON = kBlue; | |
568 | ||
569 | TRotMatrix* rot000 = new TRotMatrix("Rot000"," ", 90, 0, 90, 90, 0, 0); | |
570 | TRotMatrix* rot090 = new TRotMatrix("Rot090"," ", 90, 90, 90,180, 0, 0); | |
571 | TRotMatrix* rot180 = new TRotMatrix("Rot180"," ", 90,180, 90,270, 0, 0); | |
572 | TRotMatrix* rot270 = new TRotMatrix("Rot270"," ", 90,270, 90, 0, 0, 0); | |
573 | ||
574 | char nameChamber[9], nameSense[9], nameFrame[9], nameNode[9]; | |
575 | char nameSense1[9], nameSense2[9]; | |
576 | TNode *node, *nodeF; | |
577 | ||
578 | sprintf(nameChamber,"C_MUON%d",fId+1); | |
579 | sprintf(nameSense,"S_MUON%d",fId+1); | |
580 | sprintf(nameSense1,"S1_MUON%d",fId+1); | |
581 | sprintf(nameSense2,"S2_MUON%d",fId+1); | |
582 | sprintf(nameFrame,"F_MUON%d",fId+1); | |
583 | ||
584 | TNode* top=gAlice->GetGeometry()->GetNode("alice"); | |
585 | ||
586 | Float_t rmin = (*fRSec)[0]-3; | |
587 | Float_t rmax = (*fRSec)[3]+3; | |
588 | new TTUBE(nameChamber,"Mother","void",rmin,rmax,0.25,1.); | |
589 | rmin = (*fRSec)[0]; | |
590 | rmax = (*fRSec)[3]; | |
591 | new TTUBE(nameSense,"Sens. region","void",rmin,rmax,0.25, 1.); | |
592 | Float_t dx=(rmax-rmin)/2; | |
593 | Float_t dy=3.; | |
594 | Float_t dz=0.25; | |
595 | TBRIK* frMUON = new TBRIK(nameFrame,"Frame","void",dx,dy,dz); | |
596 | top->cd(); | |
597 | sprintf(nameNode,"MUON%d",100+fId+1); | |
598 | node = new TNode(nameNode,"ChamberNode",nameChamber,0,0,fChamber->Z(),""); | |
599 | node->SetLineColor(kColorMUON); | |
600 | AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); | |
601 | (pMUON->Nodes())->Add(node); | |
602 | node->cd(); | |
603 | sprintf(nameNode,"MUON%d",200+fId+1); | |
604 | node = new TNode(nameNode,"Sens. Region Node",nameSense,0,0,0,""); | |
605 | node->SetLineColor(kColorMUON); | |
606 | node->cd(); | |
607 | Float_t dr=dx+rmin; | |
608 | sprintf(nameNode,"MUON%d",300+fId+1); | |
609 | nodeF = new TNode(nameNode,"Frame0",frMUON,dr, 0, 0,rot000,""); | |
610 | nodeF->SetLineColor(kColorMUON); | |
611 | node->cd(); | |
612 | sprintf(nameNode,"MUON%d",400+fId+1); | |
613 | nodeF = new TNode(nameNode,"Frame1",frMUON,0 ,dr,0,rot090,""); | |
614 | nodeF->SetLineColor(kColorMUON); | |
615 | node->cd(); | |
616 | sprintf(nameNode,"MUON%d",500+fId+1); | |
617 | nodeF = new TNode(nameNode,"Frame2",frMUON,-dr,0,0,rot180,""); | |
618 | nodeF->SetLineColor(kColorMUON); | |
619 | node ->cd(); | |
620 | sprintf(nameNode,"MUON%d",600+fId+1); | |
621 | nodeF = new TNode(nameNode,"Frame3",frMUON,0,-dr,0,rot270,""); | |
622 | nodeF->SetLineColor(kColorMUON); | |
623 | } else { | |
a9e2aefa | 624 | TBox *box; |
625 | ||
626 | Float_t dx=0.95/fCx[3][1]/2; | |
627 | Float_t dy=0.95/(Float_t(Npy()))/2; | |
628 | Float_t x0,y0,x1,y1; | |
629 | Float_t xc=0.5; | |
630 | Float_t yc=0.5; | |
631 | ||
aaf4addd | 632 | for (Int_t iy=1; iy<Npy(); iy++) { |
633 | for (Int_t isec=0; isec<4; isec++) { | |
634 | if (isec==0) { | |
635 | x0=0; | |
636 | x1=fCx[isec][iy]*dx; | |
637 | } else { | |
638 | x0=fCx[isec-1][iy]*dx; | |
639 | x1=fCx[isec][iy]*dx; | |
a9e2aefa | 640 | } |
aaf4addd | 641 | y0=Float_t(iy-1)*dy; |
642 | y1=y0+dy; | |
643 | box=new TBox(x0+xc,y0+yc,x1+xc,y1+yc); | |
644 | box->SetFillColor(isec+1); | |
645 | box->Draw(); | |
646 | ||
647 | box=new TBox(-x1+xc,y0+yc,-x0+xc,y1+yc); | |
648 | box->SetFillColor(isec+1); | |
649 | box->Draw(); | |
650 | ||
651 | box=new TBox(x0+xc,-y1+yc,x1+xc,-y0+yc); | |
652 | box->SetFillColor(isec+1); | |
653 | box->Draw(); | |
654 | ||
655 | box=new TBox(-x1+xc,-y1+yc,-x0+xc,-y0+yc); | |
656 | box->SetFillColor(isec+1); | |
657 | box->Draw(); | |
658 | } | |
a9e2aefa | 659 | } |
aaf4addd | 660 | } |
a9e2aefa | 661 | } |
662 | void AliMUONSegmentationV01::SetCorrFunc(Int_t isec, TF1* func) | |
663 | { | |
de05461e | 664 | // Set the correction function |
cd4df77b | 665 | fCorrA->AddAt(func,isec); |
a9e2aefa | 666 | } |
667 | ||
c3eff6ad | 668 | TF1* AliMUONSegmentationV01::CorrFunc(Int_t isec) const |
a9e2aefa | 669 | { |
de05461e | 670 | // Get correction function |
2682e810 | 671 | //PH return (TF1*) (*fCorrA)[isec]; |
672 | return (TF1*) fCorrA->At(isec); | |
a9e2aefa | 673 | } |
674 | ||
30178c30 | 675 | AliMUONSegmentationV01& |
676 | AliMUONSegmentationV01::operator =(const AliMUONSegmentationV01 & rhs) | |
a9e2aefa | 677 | { |
30178c30 | 678 | // Protected assignement operator |
679 | ||
680 | if (this == &rhs) return *this; | |
681 | ||
8c343c7c | 682 | AliFatal("Not implemented."); |
30178c30 | 683 | |
684 | return *this; | |
a9e2aefa | 685 | } |
de05461e | 686 |