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