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