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