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