]>
Commit | Line | Data |
---|---|---|
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$ | |
18 | Revision 1.17 2001/01/30 12:17:04 morsch | |
19 | Remove obolete print-statement. | |
20 | ||
21 | Revision 1.16 2001/01/30 09:23:14 hristov | |
22 | Streamers removed (R.Brun) | |
23 | ||
24 | Revision 1.15 2001/01/26 21:25:48 morsch | |
25 | Empty default constructors and. | |
26 | ||
27 | Revision 1.14 2000/12/21 22:12:41 morsch | |
28 | Clean-up of coding rule violations, | |
29 | ||
30 | Revision 1.13 2000/12/07 10:41:51 hristov | |
31 | fCorr replaced by fCorrA | |
32 | ||
33 | Revision 1.12 2000/12/06 11:55:41 morsch | |
34 | Introduce SetOffsetY(Float_t off) method as simplified simulation of pad staggering. | |
35 | fOffset is the staggering offset in y. | |
36 | ||
37 | Revision 1.11 2000/11/06 09:20:43 morsch | |
38 | AliMUON delegates part of BuildGeometry() to AliMUONSegmentation using the | |
39 | Draw() method. This avoids code and parameter replication. | |
40 | ||
41 | Revision 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 | ||
45 | Revision 1.9 2000/10/18 08:41:32 morsch | |
46 | Make NextPad() and MorePads() to iterate until the end. | |
47 | ||
48 | Revision 1.8 2000/10/03 21:48:07 morsch | |
49 | Adopt to const declaration of some of the methods in AliSegmentation. | |
50 | ||
51 | Revision 1.7 2000/10/02 21:28:09 fca | |
52 | Removal of useless dependecies via forward declarations | |
53 | ||
54 | Revision 1.6 2000/10/02 16:58:29 egangler | |
55 | Cleaning of the code : | |
56 | -> coding conventions | |
57 | -> void Streamers | |
58 | -> some useless includes removed or replaced by "class" statement | |
59 | ||
60 | Revision 1.5 2000/07/13 16:19:44 fca | |
61 | Mainly coding conventions + some small bug fixes | |
62 | ||
63 | Revision 1.4 2000/07/03 11:54:57 morsch | |
64 | AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER | |
65 | The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC. | |
66 | ||
67 | Revision 1.3 2000/06/29 12:34:09 morsch | |
68 | AliMUONSegmentation class has been made independent of AliMUONChamber. This makes | |
69 | it usable with any other geometry class. The link to the object to which it belongs is | |
70 | established via an index. This assumes that there exists a global geometry manager | |
71 | from which the pointer to the parent object can be obtained (in our case gAlice). | |
72 | ||
73 | Revision 1.2 2000/06/15 07:58:48 morsch | |
74 | Code from MUON-dev joined | |
75 | ||
76 | Revision 1.1.2.1 2000/06/09 21:37:30 morsch | |
77 | AliMUONSegmentationV01 code from AliMUONSegResV01.cxx | |
78 | ||
79 | */ | |
80 | ||
81 | ||
82 | ///////////////////////////////////////////////////// | |
83 | // Segmentation and Response classes version 01 // | |
84 | ///////////////////////////////////////////////////// | |
85 | ||
86 | #include <TBox.h> | |
87 | #include <TTUBE.h> | |
88 | #include <TBRIK.h> | |
89 | #include <TNode.h> | |
90 | #include <TGeometry.h> | |
91 | #include <TF1.h> | |
92 | #include <TObjArray.h> | |
93 | #include <iostream.h> | |
94 | ||
95 | #include "AliMUONSegmentationV01.h" | |
96 | #include "AliMUON.h" | |
97 | #include "AliMUONChamber.h" | |
98 | #include "AliRun.h" | |
99 | ||
100 | ||
101 | ||
102 | //___________________________________________ | |
103 | ClassImp(AliMUONSegmentationV01) | |
104 | ||
105 | AliMUONSegmentationV01::AliMUONSegmentationV01(const AliMUONSegmentationV01& segmentation) | |
106 | { | |
107 | // Dummy copy constructor | |
108 | } | |
109 | ||
110 | AliMUONSegmentationV01::AliMUONSegmentationV01() | |
111 | { | |
112 | // Default constructor | |
113 | fRSec = 0; | |
114 | fNDiv = 0; | |
115 | fDpxD = 0; | |
116 | fCorrA = 0; | |
117 | } | |
118 | ||
119 | AliMUONSegmentationV01::AliMUONSegmentationV01(Int_t nsec) | |
120 | { | |
121 | // Non default constructor | |
122 | ||
123 | fNsec = nsec; | |
124 | fRSec = new TArrayF(fNsec); | |
125 | fNDiv = new TArrayI(fNsec); | |
126 | fDpxD = new TArrayF(fNsec); | |
127 | ||
128 | ||
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; | |
132 | fCorrA = new TObjArray(3); | |
133 | (*fCorrA)[0]=0; | |
134 | (*fCorrA)[1]=0; | |
135 | (*fCorrA)[2]=0; | |
136 | fOffsetY=0; | |
137 | } | |
138 | ||
139 | AliMUONSegmentationV01::~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 | ||
152 | Float_t AliMUONSegmentationV01::Dpx(Int_t isec) const | |
153 | { | |
154 | // | |
155 | // Returns x-pad size for given sector isec | |
156 | Float_t dpx = (*fDpxD)[isec]; | |
157 | return dpx; | |
158 | } | |
159 | ||
160 | Float_t AliMUONSegmentationV01::Dpy(Int_t isec) const | |
161 | { | |
162 | // | |
163 | // Returns y-pad size for given sector isec | |
164 | return fDpy; | |
165 | } | |
166 | ||
167 | void 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++) { | |
172 | (*fRSec)[i]=r[i]; | |
173 | } | |
174 | } | |
175 | ||
176 | ||
177 | void 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++) { | |
185 | (*fNDiv)[i]=ndiv[i]; | |
186 | } | |
187 | ndiv[0]=ndiv[1]; | |
188 | } | |
189 | ||
190 | ||
191 | void AliMUONSegmentationV01::Init(Int_t chamber) | |
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; | |
200 | printf("\n Initialise Segmentation V01\n"); | |
201 | ||
202 | ||
203 | fNpy=Int_t((*fRSec)[fNsec-1]/fDpy)+1; | |
204 | ||
205 | (*fDpxD)[fNsec-1]=fDpx; | |
206 | if (fNsec > 1) { | |
207 | for (Int_t i=fNsec-2; i>=0; i--){ | |
208 | (*fDpxD)[i]=(*fDpxD)[fNsec-1]/(*fNDiv)[i]; | |
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; | |
224 | if (x > (*fRSec)[isec]) { | |
225 | fNpxS[isec][iy]=0; | |
226 | fCx[isec][iy]=0; | |
227 | } else { | |
228 | ry=TMath::Sqrt((*fRSec)[isec]*(*fRSec)[isec]-x*x); | |
229 | if (isec > 1) { | |
230 | dnx= Int_t((ry-fCx[isec-1][iy])/(*fDpxD)[isec]); | |
231 | if (isec < fNsec-1) { | |
232 | if (TMath::Odd((Long_t)dnx)) dnx++; | |
233 | } | |
234 | fNpxS[isec][iy]=fNpxS[isec-1][iy]+dnx; | |
235 | fCx[isec][iy]=fCx[isec-1][iy]+dnx*(*fDpxD)[isec]; | |
236 | } else if (isec == 1) { | |
237 | dnx= Int_t((ry-fCx[isec-1][iy])/(*fDpxD)[isec]); | |
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]; | |
242 | fCx[isec][iy]=fCx[isec-1][iy]+dnx*(*fDpxD)[isec]; | |
243 | } else { | |
244 | dnx=Int_t(ry/(*fDpxD)[isec]); | |
245 | fNpxS[isec][iy]=dnx; | |
246 | fCx[isec][iy]=dnx*(*fDpxD)[isec]; | |
247 | } | |
248 | } | |
249 | } // y-pad loop | |
250 | } // sector loop | |
251 | // reference to chamber | |
252 | AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); | |
253 | fChamber=&(pMUON->Chamber(chamber)); | |
254 | fZ = fChamber->Z(); | |
255 | fId=chamber; | |
256 | } | |
257 | ||
258 | Int_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 | ||
274 | void AliMUONSegmentationV01:: | |
275 | GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy) | |
276 | { | |
277 | // Returns pad coordinates (ix,iy) for given real coordinates (x,y) | |
278 | // | |
279 | iy = (y-fOffsetY >0)? | |
280 | Int_t((y-fOffsetY)/fDpy)+1 | |
281 | : | |
282 | Int_t((y-fOffsetY)/fDpy)-1; | |
283 | ||
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) { | |
298 | ix= Int_t((absx-fCx[isec-1][absiy])/(*fDpxD)[isec]) | |
299 | +fNpxS[isec-1][absiy]+1; | |
300 | } else if (isec == 0) { | |
301 | ix= Int_t(absx/(*fDpxD)[isec])+1; | |
302 | } else { | |
303 | ix=fNpxS[fNsec-1][absiy]+1; | |
304 | } | |
305 | ix = (x>0) ? ix:-ix; | |
306 | } | |
307 | ||
308 | void AliMUONSegmentationV01:: | |
309 | GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) | |
310 | { | |
311 | // Returns real coordinates (x,y) for given pad coordinates (ix,iy) | |
312 | // | |
313 | y = (iy>0) ? | |
314 | Float_t(iy*fDpy)-fDpy/2.+fOffsetY | |
315 | : | |
316 | Float_t(iy*fDpy)+fDpy/2.+fOffsetY; | |
317 | ||
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) { | |
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; | |
327 | } else { | |
328 | x=y=0; | |
329 | } | |
330 | } | |
331 | ||
332 | void AliMUONSegmentationV01:: | |
333 | SetPad(Int_t ix, Int_t iy) | |
334 | { | |
335 | // | |
336 | // Sets virtual pad coordinates, needed for evaluating pad response | |
337 | // outside the tracking program | |
338 | GetPadC(ix,iy,fX,fY); | |
339 | fSector=Sector(ix,iy); | |
340 | } | |
341 | ||
342 | ||
343 | void AliMUONSegmentationV01:: | |
344 | FirstPad(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); | |
351 | fXhit=x0a; | |
352 | fYhit=yhit; | |
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 | |
362 | ||
363 | GetPadI(x01,y01,fIxmin,fIymin); | |
364 | GetPadI(x02,y02,fIxmax,fIymax); | |
365 | fXmin=x01; | |
366 | fXmax=x02; | |
367 | fYmin=y01; | |
368 | fYmax=y02; | |
369 | ||
370 | // | |
371 | // Set current pad to lower left corner | |
372 | if (fIxmax < fIxmin) fIxmax=fIxmin; | |
373 | if (fIymax < fIymin) fIymax=fIymin; | |
374 | fIx=fIxmin; | |
375 | fIy=fIymin; | |
376 | GetPadC(fIx,fIy,fX,fY); | |
377 | } | |
378 | ||
379 | ||
380 | void 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 | |
391 | ||
392 | if (fX < fXmax && fX != 0) { | |
393 | if (fIx==-1) fIx++; | |
394 | fIx++; | |
395 | // step up | |
396 | } else if (fIy != fIymax) { | |
397 | if (fIy==-1) fIy++; | |
398 | fIy++; | |
399 | // get y-position of next row (yc), xc not used here | |
400 | GetPadC(fIx,fIy,xc,yc); | |
401 | // get x-pad coordiante for first pad in row (fIx) | |
402 | GetPadI(fXmin,yc,fIx,iyc); | |
403 | } else { | |
404 | fIx=-1; | |
405 | fIy=-1; | |
406 | } | |
407 | GetPadC(fIx,fIy,fX,fY); | |
408 | fSector=Sector(fIx,fIy); | |
409 | if (MorePads() && | |
410 | (fSector ==-1 || fSector==0)) | |
411 | NextPad(); | |
412 | } | |
413 | ||
414 | Int_t AliMUONSegmentationV01::MorePads() | |
415 | ||
416 | { | |
417 | // Stopping condition for the iterator over pads | |
418 | // | |
419 | // Are there more pads in the integration region | |
420 | return (fIx != -1 || fIy != -1); | |
421 | /* | |
422 | if ((fX >= fXmax && fIy >= fIymax) || fY==0) { | |
423 | return 0; | |
424 | } else { | |
425 | return 1; | |
426 | } | |
427 | */ | |
428 | } | |
429 | ||
430 | void AliMUONSegmentationV01:: | |
431 | IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2) | |
432 | { | |
433 | // Returns integration limits for current pad | |
434 | // | |
435 | x1=fXhit-fX-Dpx(fSector)/2.; | |
436 | x2=x1+Dpx(fSector); | |
437 | y1=fYhit-fY-Dpy(fSector)/2.; | |
438 | y2=y1+Dpy(fSector); | |
439 | } | |
440 | ||
441 | void AliMUONSegmentationV01:: | |
442 | Neighbours(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 | |
465 | AliMUONSegmentationV01::GetPadC(iX,iY,x,y); | |
466 | AliMUONSegmentationV01::GetPadI(x+kEpsilon,y+fDpy,ixx,iyy); | |
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 | |
503 | AliMUONSegmentationV01::GetPadC(iX,iY,x,y); | |
504 | AliMUONSegmentationV01::GetPadI(x+kEpsilon,y-fDpy,ixx,iyy); | |
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 | ||
543 | void AliMUONSegmentationV01::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) const | |
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; | |
549 | x[0]=((*fRSec)[0]+(*fRSec)[1])/2/TMath::Sqrt(2.); | |
550 | y[0]=x[0]; | |
551 | x[1]=((*fRSec)[1]+(*fRSec)[2])/2/TMath::Sqrt(2.); | |
552 | y[1]=x[1]; | |
553 | x[2]=((*fRSec)[2]+(*fRSec)[3])/2/TMath::Sqrt(2.); | |
554 | y[2]=x[2]; | |
555 | } | |
556 | ||
557 | void AliMUONSegmentationV01::Draw(const char* opt) const | |
558 | { | |
559 | ||
560 | // Draws the segmentation zones | |
561 | // | |
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 { | |
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 | ||
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; | |
636 | } | |
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 | } | |
655 | } | |
656 | } | |
657 | } | |
658 | void AliMUONSegmentationV01::SetCorrFunc(Int_t isec, TF1* func) | |
659 | { | |
660 | // Set the correction function | |
661 | (*fCorrA)[isec]=func; | |
662 | } | |
663 | ||
664 | TF1* AliMUONSegmentationV01::CorrFunc(Int_t isec) const | |
665 | { | |
666 | // Get correction function | |
667 | return (TF1*) (*fCorrA)[isec]; | |
668 | } | |
669 | ||
670 | AliMUONSegmentationV01& AliMUONSegmentationV01::operator | |
671 | =(const AliMUONSegmentationV01 & rhs) | |
672 | { | |
673 | // Dummy assignment operator | |
674 | return *this; | |
675 | } | |
676 |