]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSv11Geometry.cxx
Updated some functions, and removed most all violoations.
[u/mrichter/AliRoot.git] / ITS / AliITSv11Geometry.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 /*
17  $Id$ 
18 */
19
20
21 ////////////////////////////////////////////////////////////////////////
22 //  This class is a base class for the ITS geometry version 11. It 
23 //  contains common/standard functions used in many places in defining 
24 //  the ITS geometry, version 11. Large posions of the ITS geometry, 
25 //  version 11, should be derived from this class so as to make maximum 
26 //  use of these common functions. This class also defines the proper 
27 //  conversion valuse such, to cm and degrees, such that the most usefull 
28 //  units, those used in the Engineering drawings, can be used.
29 ////////////////////////////////////////////////////////////////////////
30
31
32 #include <Riostream.h>
33 #include <TMath.h>
34 #include <TGeoPcon.h>
35 #include <TGeoCone.h>
36 #include <TGeoTube.h> // contaings TGeoTubeSeg
37 #include <TGeoArb8.h>
38 #include <TPolyMarker.h>
39 #include <TPolyLine.h>
40 #include "AliITSv11Geometry.h"
41
42 ClassImp(AliITSv11Geometry)
43 //______________________________________________________________________
44 Double_t AliITSv11Geometry::Yfrom2Points(Double_t x0,Double_t y0,
45                                          Double_t x1,Double_t y1,
46                                          Double_t x){
47     // Given the two points (x0,y0) and (x1,y1) and the location x, returns
48     // the value y corresponding to that point x on the line defined by the
49     // two points.
50     // Inputs:
51     //    Double_t  x0  The first x value defining the line
52     //    Double_t  y0  The first y value defining the line
53     //    Double_t  x1  The second x value defining the line
54     //    Double_t  y1  The second y value defining the line
55     //    Double_t   x  The x value for which the y value is wanted.
56     // Outputs:
57     //    none.
58     // Return:
59     //    The value y corresponding to the point x on the line defined by
60     //    the two points (x0,y0) and (x1,y1).
61
62     if(x0==x1 && y0==y1) {
63         printf("Error: AliITSv11Geometry::Yfrom2Ponts The two points are "
64                "the same (%e,%e) and (%e,%e)",x0,y0,x1,y1);
65         return 0.0;
66     } // end if
67     if(x0==x1){
68         printf("Warning: AliITSv11Geometry::Yfrom2Points x0=%e == x1=%e. "
69                "line vertical ""returning mean y",x0,x1);
70         return 0.5*(y0+y1);
71     }// end if x0==x1
72     Double_t m = (y0-y1)/(x0-x1);
73     return m*(x-x0)+y0;
74 }
75 //______________________________________________________________________
76 Double_t AliITSv11Geometry::Xfrom2Points(Double_t x0,Double_t y0,
77                                          Double_t x1,Double_t y1,
78                                          Double_t y){
79     // Given the two points (x0,y0) and (x1,y1) and the location y, returns
80     // the value x corresponding to that point y on the line defined by the
81     // two points.
82     // Inputs:
83     //    Double_t  x0  The first x value defining the line
84     //    Double_t  y0  The first y value defining the line
85     //    Double_t  x1  The second x value defining the line
86     //    Double_t  y1  The second y value defining the line
87     //    Double_t   y  The y value for which the x value is wanted.
88     // Outputs:
89     //    none.
90     // Return:
91     //    The value x corresponding to the point y on the line defined by
92     //    the two points (x0,y0) and (x1,y1).
93
94     if(x0==x1 && y0==y1) {
95         printf("Error: AliITSv11Geometry::Yfrom2Ponts The two points are "
96                "the same (%e,%e) and (%e,%e)",x0,y0,x1,y1);
97         return 0.0;
98     } // end if
99     if(y0==y1){
100         printf("Warrning: AliITSv11Geometry::Yfrom2Points y0=%e == y1=%e. "
101                "line horizontal returning mean x",y0,y1);
102         return 0.5*(x0+x1);
103     }// end if y0==y1
104     Double_t m = (x0-x1)/(y0-y1);
105     return m*(y-y0)+x0;
106 }
107 //______________________________________________________________________
108 Double_t AliITSv11Geometry::RmaxFrom2Points(const TGeoPcon *p,Int_t i1,
109                                             Int_t i2,Double_t z){
110     // functions Require at parts of Volume A to be already defined.
111     // Retruns the value of Rmax corresponding to point z alone the line
112     // defined by the two points p.Rmax(i1),p-GetZ(i1) and p->GetRmax(i2),
113     // p->GetZ(i2).
114     // Inputs:
115     //    TGeoPcon *p  The Polycone where the two points come from
116     //    Int_t    i1  Point 1
117     //    Int_t    i2  Point 2
118     //    Double_t  z  The value of z for which Rmax is to be found
119     // Outputs:
120     //    none.
121     // Return:
122     //    Double_t Rmax the value corresponding to z
123     Double_t d0,d1,d2,r;
124
125     d0 = p->GetRmax(i1)-p->GetRmax(i2);// cout <<"L263: d0="<<d0<<endl;
126     d1 = z-p->GetZ(i2);// cout <<"L264: d1="<<d1<<endl;
127     d2 = p->GetZ(i1)-p->GetZ(i2);// cout <<"L265: d2="<<d2<<endl;
128     r  = p->GetRmax(i2) + d1*d0/d2;// cout <<"L266: r="<<r<<endl;
129     return r;
130 }
131 //______________________________________________________________________
132 Double_t AliITSv11Geometry::RminFrom2Points(const TGeoPcon *p,Int_t i1,
133                                             Int_t i2,Double_t z){
134     // Retruns the value of Rmin corresponding to point z alone the line
135     // defined by the two points p->GetRmin(i1),p->GetZ(i1) and 
136     // p->GetRmin(i2),  p->GetZ(i2).
137     // Inputs:
138     //    TGeoPcon *p  The Polycone where the two points come from
139     //    Int_t    i1  Point 1
140     //    Int_t    i2  Point 2
141     //    Double_t  z  The value of z for which Rmax is to be found
142     // Outputs:
143     //    none.
144     // Return:
145     //    Double_t Rmax the value corresponding to z
146
147     return p->GetRmin(i2)+(p->GetRmin(i1)-p->GetRmin(i2))*(z-p->GetZ(i2))/
148      (p->GetZ(i1)-p->GetZ(i2));
149 }
150 //______________________________________________________________________
151 Double_t AliITSv11Geometry::RFrom2Points(const Double_t *p,const Double_t *az,
152                                          Int_t i1,Int_t i2,Double_t z){
153     // Retruns the value of Rmin corresponding to point z alone the line
154     // defined by the two points p->GetRmin(i1),p->GetZ(i1) and 
155     // p->GetRmin(i2), p->GetZ(i2).
156     // Inputs:
157     //    Double_t az  Array of z values
158     //    Double_t  r  Array of r values
159     //    Int_t    i1  First Point in arrays
160     //    Int_t    i2  Second Point in arrays
161     //    Double_t z   Value z at which r is to be found
162     // Outputs:
163     //    none.
164     // Return:
165     //    The value r corresponding to z and the line defined by the two points
166
167     return p[i2]+(p[i1]-p[i2])*(z-az[i2])/(az[i1]-az[i2]);
168 }
169 //______________________________________________________________________
170 Double_t AliITSv11Geometry::Zfrom2MinPoints(const TGeoPcon *p,Int_t i1,
171                                             Int_t i2,Double_t r){
172     // Retruns the value of Z corresponding to point R alone the line
173     // defined by the two points p->GetRmin(i1),p->GetZ(i1) and 
174     // p->GetRmin(i2),p->GetZ(i2)
175     // Inputs:
176     //    TGeoPcon *p  The Poly cone where the two points come from.
177     //    Int_t    i1  First Point in arrays
178     //    Int_t    i2  Second Point in arrays
179     //    Double_t r   Value r min at which z is to be found
180     // Outputs:
181     //    none.
182     // Return:
183     //    The value z corresponding to r min and the line defined by 
184     //    the two points
185
186     return p->GetZ(i2)+(p->GetZ(i1)-p->GetZ(i2))*(r-p->GetRmin(i2))/
187      (p->GetRmin(i1)-p->GetRmin(i2));
188 }
189 //______________________________________________________________________
190 Double_t AliITSv11Geometry::Zfrom2MaxPoints(const TGeoPcon *p,Int_t i1,
191                                             Int_t i2,Double_t r){
192     // Retruns the value of Z corresponding to point R alone the line
193     // defined by the two points p->GetRmax(i1),p->GetZ(i1) and 
194     // p->GetRmax(i2),p->GetZ(i2)
195     // Inputs:
196     //    TGeoPcon *p  The Poly cone where the two points come from.
197     //    Int_t    i1  First Point in arrays
198     //    Int_t    i2  Second Point in arrays
199     //    Double_t r   Value r max at which z is to be found
200     // Outputs:
201     //    none.
202     // Return:
203     //    The value z corresponding to r max and the line defined by 
204     //    the two points
205
206     return p->GetZ(i2)+(p->GetZ(i1)-p->GetZ(i2))*(r-p->GetRmax(i2))/
207      (p->GetRmax(i1)-p->GetRmax(i2));
208 }
209 //______________________________________________________________________
210 Double_t AliITSv11Geometry::Zfrom2Points(const Double_t *z,const Double_t *ar,
211                                          Int_t i1,Int_t i2,Double_t r){
212     // Retruns the value of z corresponding to point R alone the line
213     // defined by the two points p->GetRmax(i1),p->GetZ(i1) and 
214     // p->GetRmax(i2),p->GetZ(i2)
215     // Inputs:
216     //    Double_t  z  Array of z values
217     //    Double_t ar  Array of r values
218     //    Int_t    i1  First Point in arrays
219     //    Int_t    i2  Second Point in arrays
220     //    Double_t r   Value r at which z is to be found
221     // Outputs:
222     //    none.
223     // Return:
224     //    The value z corresponding to r and the line defined by the two points
225
226     return z[i2]+(z[i1]-z[i2])*(r-ar[i2])/(ar[i1]-ar[i2]);
227 }
228 //______________________________________________________________________
229 Double_t AliITSv11Geometry::RmaxFromZpCone(const TGeoPcon *p,int ip,
230                                            Double_t tc,Double_t z,
231                                            Double_t th){
232     // General Outer Cone surface equation Rmax.
233     // Intputs:
234     //     TGeoPcon  *p   The poly cone where the initial point comes from
235     //     Int_t     ip   The index in p to get the point location
236     //     Double_t  tc   The angle of that part of the cone is at
237     //     Double_t   z   The value of z to compute Rmax from
238     //     Double_t  th   The perpendicular distance the parralell line is
239     //                    from the point ip.
240     // Outputs:
241     //     none.
242     // Return:
243     //     The value Rmax correstponding to the line at angle th, offeset by
244     //     th, and the point p->GetZ/Rmin[ip] at the location z.
245     Double_t tantc = TanD(tc);
246     Double_t costc = CosD(tc);
247
248     return -tantc*(z-p->GetZ(ip))+p->GetRmax(ip)+th/costc;
249 }
250 //______________________________________________________________________
251 Double_t AliITSv11Geometry::RFromZpCone(const Double_t *ar,
252                                         const Double_t *az,int ip,
253                                         Double_t tc,Double_t z,
254                                         Double_t th){
255     // General Cone surface equation R(z).
256     // Intputs:
257     //     Double_t  ar   The array of R values
258     //     Double_t  az   The array of Z values
259     //     Int_t     ip   The index in p to get the point location
260     //     Double_t  tc   The angle of that part of the cone is at
261     //     Double_t   z   The value of z to compute R from
262     //     Double_t  th   The perpendicular distance the parralell line is
263     //                    from the point ip.
264     // Outputs:
265     //     none.
266     // Return:
267     //     The value R correstponding to the line at angle th, offeset by
268     //     th, and the point p->GetZ/Rmax[ip] at the locatin z.
269     Double_t tantc = TanD(tc);
270     Double_t costc = CosD(tc);
271
272     return -tantc*(z-az[ip])+ar[ip]+th/costc;
273 }
274 //______________________________________________________________________
275 Double_t AliITSv11Geometry::RminFromZpCone(const TGeoPcon *p,Int_t ip,
276                                            Double_t tc,Double_t z,
277                                            Double_t th){
278     // General Inner Cone surface equation Rmin.
279     // Intputs:
280     //     TGeoPcon  *p   The poly cone where the initial point comes from
281     //     Int_t     ip   The index in p to get the point location
282     //     Double_t  tc   The angle of that part of the cone is at
283     //     Double_t   z   The value of z to compute Rmin from
284     //     Double_t  th   The perpendicular distance the parralell line is
285     //                    from the point ip.
286     // Outputs:
287     //     none.
288     // Return:
289     //     The value Rmin correstponding to the line at angle th, offeset by
290     //     th, and the point p->GetZ/Rmin[ip] at the location z.
291     Double_t tantc = TanD(tc);
292     Double_t costc = CosD(tc);
293
294     return -tantc*(z-p->GetZ(ip))+p->GetRmin(ip)+th/costc;
295 }
296 //______________________________________________________________________
297 Double_t AliITSv11Geometry::ZFromRmaxpCone(const TGeoPcon *p,int ip,
298                                            Double_t tc,Double_t r,
299                                            Double_t th){
300     // General Outer cone Surface equation for z.
301     // Intputs:
302     //     TGeoPcon  *p   The poly cone where the initial point comes from
303     //     Int_t     ip   The index in p to get the point location
304     //     Double_t  tc   The angle of that part of the cone is at
305     //     Double_t   r   The value of Rmax to compute z from
306     //     Double_t  th   The perpendicular distance the parralell line is
307     //                    from the point ip.
308     // Outputs:
309     //     none.
310     // Return:
311     //     The value Z correstponding to the line at angle th, offeset by
312     //     th, and the point p->GetZ/Rmax[ip] at the location r.
313     Double_t tantc = TanD(tc);
314     Double_t costc = CosD(tc);
315
316     return p->GetZ(ip)+(p->GetRmax(ip)+th/costc-r)/tantc;
317 }
318 //______________________________________________________________________
319 Double_t AliITSv11Geometry::ZFromRmaxpCone(const Double_t *ar,
320                                            const Double_t *az,int ip,
321                                            Double_t tc,Double_t r,
322                                            Double_t th){
323     // General Outer cone Surface equation for z.
324     // Intputs:
325     //     Double_t  ar   The array of R values
326     //     Double_t  az   The array of Z values
327     //     Int_t     ip   The index in p to get the point location
328     //     Double_t  tc   The angle of that part of the cone is at
329     //     Double_t   r   The value of Rmax to compute z from
330     //     Double_t  th   The perpendicular distance the parralell line is
331     //                    from the point ip.
332     // Outputs:
333     //     none.
334     // Return:
335     //     The value Z correstponding to the line at angle th, offeset by
336     //     th, and the point p->GetZ/Rmax[ip] at the locatin r.
337     Double_t tantc = TanD(tc);
338     Double_t costc = CosD(tc);
339
340     return az[ip]+(ar[ip]+th/costc-r)/tantc;
341 }
342 //______________________________________________________________________
343 Double_t AliITSv11Geometry::ZFromRminpCone(const TGeoPcon *p,int ip,
344                                            Double_t tc,Double_t r,
345                                            Double_t th){
346     // General Inner cone Surface equation for z.
347     // Intputs:
348     //     TGeoPcon  *p   The poly cone where the initial point comes from
349     //     Int_t     ip   The index in p to get the point location
350     //     Double_t  tc   The angle of that part of the cone is at
351     //     Double_t   r   The value of Rmin to compute z from
352     //     Double_t  th   The perpendicular distance the parralell line is
353     //                    from the point ip.
354     // Outputs:
355     //     none.
356     // Return:
357     //     The value Z correstponding to the line at angle th, offeset by
358     //     th, and the point p->GetZ/Rmin[ip] at the location r.
359     Double_t tantc = TanD(tc);
360     Double_t costc = CosD(tc);
361
362     return p->GetZ(ip)+(p->GetRmin(ip)+th/costc-r)/tantc;
363 }
364 //______________________________________________________________________
365 void AliITSv11Geometry::RadiusOfCurvature(Double_t rc,Double_t theta0,
366                                           Double_t z0,Double_t r0,
367                                           Double_t theta1,Double_t &z1,
368                                           Double_t &r1){
369     // Given a initial point z0,r0, the initial angle theta0, and the radius
370     // of curvature, returns the point z1, r1 at the angle theta1. Theta
371     // measured from the r axis in the clock wise direction [degrees].
372     // Inputs:
373     //    Double_t rc     The radius of curvature
374     //    Double_t theta0 The starting angle (degrees)
375     //    Double_t z0     The value of z at theta0
376     //    Double_t r0     The value of r at theta0
377     //    Double_t theta1 The ending angle (degrees)
378     // Outputs:
379     //    Double_t &z1  The value of z at theta1
380     //    Double_t &r1  The value of r at theta1
381     // Return:
382     //    none.
383
384     z1 = rc*(SinD(theta1)-SinD(theta0))+z0;
385     r1 = rc*(CosD(theta1)-CosD(theta0))+r0;
386     return;
387 }
388 //______________________________________________________________________
389 void AliITSv11Geometry::InsidePoint(const TGeoPcon *p,Int_t i1,Int_t i2,
390                                     Int_t i3,Double_t c,TGeoPcon *q,Int_t j1,
391                                     Bool_t max){
392     // Given two lines defined by the points i1, i2,i3 in the TGeoPcon 
393     // class p that intersect at point p->GetZ(i2) return the point z,r 
394     // that is Cthick away in the TGeoPcon class q. If points i1=i2
395     // and max == kTRUE, then p->GetRmin(i1) and p->GetRmax(i2) are used.
396     // if points i2=i3 and max=kTRUE then points p->GetRmax(i2) and
397     // p->GetRmin(i3) are used. If i2=i3 and max=kFALSE, then p->GetRmin(i2)
398     // and p->GetRmax(i3) are used.
399     // Inputs:
400     //    TGeoPcon  *p  Class where points i1, i2, and i3 are taken from
401     //    Int_t     i1  First point in class p
402     //    Int_t     i2  Second point in class p
403     //    Int_t     i3  Third point in class p
404     //    Double_t  c   Distance inside the outer surface/inner suface
405     //                  that the point j1 is to be computed for.
406     //    TGeoPcon  *q  Pointer to class for results to be put into.
407     //    Int_t     j1  Point in class q where data is to be stored.
408     //    Bool_t    max if kTRUE, then a Rmax value is computed,
409     //                  else a Rmin valule is computed.
410     // Output:
411     //    TGeoPcon  *q  Pointer to class for results to be put into.
412     // Return:
413     //    none.
414     Double_t x0,y0,x1,y1,x2,y2,x,y;
415
416     if(max){
417         c = -c; //cout <<"L394 c="<<c<<endl;
418         y0 = p->GetRmax(i1);
419         if(i1==i2) y0 = p->GetRmin(i1); //cout <<"L396 y0="<<y0<<endl;
420         y1 = p->GetRmax(i2);  //cout <<"L397 y1="<<y1<<endl;
421         y2 = p->GetRmax(i3); //cout <<"L398 y2="<<y2<<endl;
422         if(i2==i3) y2 = p->GetRmin(i3); //cout <<"L399 y2="<<y2<<endl;
423     }else{ // min
424         y0 = p->GetRmin(i1); //cout <<"L401 y0="<<y0<<endl;
425         y1 = p->GetRmin(i2); //cout <<"L402 y1="<<y1<<endl;
426         y2 = p->GetRmin(i3);
427         if(i2==i3) y2 = p->GetRmax(i3); //cout <<"L404 y2="<<y2<<endl;
428     } // end if
429     x0 = p->GetZ(i1); //cout <<"L406 x0="<<x0<<endl;
430     x1 = p->GetZ(i2); //cout <<"L407 x1="<<x1<<endl;
431     x2 = p->GetZ(i3); //cout <<"L408 x2="<<x2<<endl;
432     //
433     InsidePoint(x0,y0,x1,y1,x2,y2,c,x,y);
434     q->Z(j1) = x;
435     if(max) q->Rmax(j1) = y;
436     else    q->Rmin(j1) = y;
437     return;
438 }
439 //----------------------------------------------------------------------
440 void AliITSv11Geometry::InsidePoint(Double_t x0,Double_t y0,
441                                     Double_t x1,Double_t y1,
442                                     Double_t x2,Double_t y2,Double_t c,
443                                     Double_t &x,Double_t &y){
444     // Given two intersecting lines defined by the points (x0,y0), (x1,y1) and
445     // (x1,y1), (x1,y2) {intersecting at (x1,y1)} the point (x,y) a distance
446     // c away is returned such that two lines a distance c away from the
447     // lines defined above intersect at (x,y).
448     // Inputs:
449     //    Double_t  x0 X point on the first intersecting sets of lines
450     //    Double_t  y0 Y point on the first intersecting sets of lines
451     //    Double_t  x1 X point on the first/second intersecting sets of lines
452     //    Double_t  y1 Y point on the first/second intersecting sets of lines
453     //    Double_t  x2 X point on the second intersecting sets of lines
454     //    Double_t  y2 Y point on the second intersecting sets of lines
455     //    Double_t  c  Distance the two sets of lines are from each other
456     // Output:
457     //    Double_t  x  X point for the intersecting sets of parellel lines
458     //    Double_t  y  Y point for the intersecting sets of parellel lines
459     // Return:
460     //    none.
461     Double_t dx01,dx12,dy01,dy12,r01,r12,m;
462     dx01 = x0-x1; //cout <<"L410 dx01="<<dx01<<endl;
463     dx12 = x1-x2; //cout <<"L411 dx12="<<dx12<<endl;
464     dy01 = y0-y1; //cout <<"L412 dy01="<<dy01<<endl;
465     dy12 = y1-y2; //cout <<"L413 dy12="<<dy12<<endl;
466     r01  = TMath::Sqrt(dy01*dy01+dx01*dx01); //cout <<"L414 r01="<<r01<<endl;
467     r12  = TMath::Sqrt(dy12*dy12+dx12*dx12); //cout <<"L415 r12="<<r12<<endl;
468     m = dx12*dy01-dy12*dx01;
469     if(m*m<DBL_EPSILON){ // m == n
470         if(dy01==0.0){ // line are =
471             x = x1+c; //cout <<"L419 x="<<x<<endl;
472             y = y1; //cout <<"L420 y="<<y<<endl;
473             return;
474         }else if(dx01==0.0){
475             x = x1;
476             y = y1+c;
477             return;
478         }else{ // dx01!=0 and dy01 !=0.
479             x = x1-0.5*c*r01/dy01; //cout <<"L434 x="<<x<<endl;
480             y = y1+0.5*c*r01/dx01; //cout <<"L435 y="<<y<<endl;
481         } // end if
482         return;
483     } //
484     x = x1-c*(dx12*r01-dx01*r12)/m; //cout <<"L442 x="<<x<<endl;
485     y = y1-c*(dy12*r01-dy01*r12)/m; //cout <<"L443 y="<<y<<endl;
486     //cout <<"=============================================="<<endl;
487     return;
488 }
489 //----------------------------------------------------------------------
490 void AliITSv11Geometry:: PrintArb8(const TGeoArb8 *a)const{
491     // Prints out the content of the TGeoArb8. Usefull for debugging.
492     // Inputs:
493     //   TGeoArb8 *a
494     // Outputs:
495     //   none.
496     // Return:
497     //   none.
498
499     if(GetDebug()){
500         printf("%s",a->GetName());
501         a->InspectShape();
502     } // end if
503     return;
504 }
505 //----------------------------------------------------------------------
506 void AliITSv11Geometry:: PrintPcon(const TGeoPcon *a)const{
507     // Prints out the content of the TGeoPcon. Usefull for debugging.
508     // Inputs:
509     //   TGeoPcon *a
510     // Outputs:
511     //   none.
512     // Return:
513     //   none.
514   
515     if(GetDebug()) return;
516     cout << a->GetName() << ": N=" << a->GetNz() << " Phi1=" << a->GetPhi1()
517          << ", Dphi=" << a->GetDphi() << endl;
518     cout << "i\t   Z   \t  Rmin \t  Rmax" << endl;
519     for(Int_t iii=0;iii<a->GetNz();iii++){
520         cout << iii << "\t" << a->GetZ(iii) << "\t" << a->GetRmin(iii)
521              << "\t" << a->GetRmax(iii) << endl;
522     } // end for iii
523     return;
524 }
525 //----------------------------------------------------------------------
526 void AliITSv11Geometry::PrintTube(const TGeoTube *a)const{
527     // Prints out the content of the TGeoTube. Usefull for debugging.
528     // Inputs:
529     //   TGeoTube *a
530     // Outputs:
531     //   none.
532     // Return:
533     //   none.
534
535     if(GetDebug()) return;
536     cout << a->GetName() <<": Rmin="<<a->GetRmin()
537          <<" Rmax=" <<a->GetRmax()<<" Dz="<<a->GetDz()<<endl;
538     return;
539 }
540 //----------------------------------------------------------------------
541 void AliITSv11Geometry::PrintTubeSeg(const TGeoTubeSeg *a)const{
542     // Prints out the content of the TGeoTubeSeg. Usefull for debugging.
543     // Inputs:
544     //   TGeoTubeSeg *a
545     // Outputs:
546     //   none.
547     // Return:
548     //   none.
549
550     if(GetDebug()) return;
551     cout << a->GetName() <<": Phi1="<<a->GetPhi1()<<
552         " Phi2="<<a->GetPhi2()<<" Rmin="<<a->GetRmin()
553          <<" Rmax=" <<a->GetRmax()<<" Dz="<<a->GetDz()<<endl;
554     return;
555 }
556 //----------------------------------------------------------------------
557 void AliITSv11Geometry::PrintConeSeg(const TGeoConeSeg *a)const{
558     // Prints out the content of the TGeoConeSeg. Usefull for debugging.
559     // Inputs:
560     //   TGeoConeSeg *a
561     // Outputs:
562     //   none.
563     // Return:
564     //   none.
565
566     if(GetDebug()) return;
567     cout << a->GetName() <<": Phi1="<<a->GetPhi1()<<
568         " Phi2="<<a->GetPhi2()<<" Rmin1="<<a->GetRmin1()
569          <<" Rmax1=" <<a->GetRmax1()<<" Rmin2="<<a->GetRmin2()
570          <<" Rmax2=" <<a->GetRmax2()<<" Dz="<<a->GetDz()<<endl;
571     return;
572 }
573 //----------------------------------------------------------------------
574 void AliITSv11Geometry::PrintBBox(const TGeoBBox *a)const{
575     // Prints out the content of the TGeoBBox. Usefull for debugging.
576     // Inputs:
577     //   TGeoBBox *a
578     // Outputs:
579     //   none.
580     // Return:
581     //   none.
582
583     if(GetDebug()) return;
584     cout << a->GetName() <<": Dx="<<a->GetDX()<<
585         " Dy="<<a->GetDY()<<" Dz="<<a->GetDZ() <<endl;
586     return;
587 }
588 //---------------------------------------------------------------------
589 void AliITSv11Geometry::DrawCrossSection(const TGeoPcon *p,
590                             Int_t fillc,Int_t fills,
591                             Int_t linec,Int_t lines,Int_t linew,
592                             Int_t markc,Int_t marks,Float_t marksize)const{
593     // Draws a cross sectional view of the TGeoPcon, Primarily for debugging.
594     // A TCanvas should exist first.
595     //  Inputs:
596     //    TGeoPcon  *p  The TGeoPcon to be "drawn"
597     //    Int_t  fillc  The fill color to be used
598     //    Int_t  fills  The fill style to be used
599     //    Int_t  linec  The line color to be used
600     //    Int_t  lines  The line style to be used
601     //    Int_t  linew  The line width to be used
602     //    Int_t  markc  The markder color to be used
603     //    Int_t  marks  The markder style to be used
604     //    Float_t marksize The marker size
605     // Outputs:
606     //   none.
607     // Return:
608     //   none.
609     Int_t n=0,m=0,i=0;
610     Double_t *z=0,*r=0;
611     TPolyMarker *pts=0;
612     TPolyLine   *line=0;
613
614     n = p->GetNz();
615     if(n<=0) return;
616     m = 2*n+1;
617     z = new Double_t[m];
618     r = new Double_t[m];
619
620     for(i=0;i<n;i++){
621         z[i] = p->GetZ(i);
622         r[i] = p->GetRmax(i);
623         z[i+n] = p->GetZ(n-1-i);
624         r[i+n] = p->GetRmin(n-1-i);
625     } //  end for i
626     z[n-1] = z[0];
627     r[n-1] = r[0];
628
629     line = new TPolyLine(n,z,r);
630     pts  = new TPolyMarker(n,z,r);
631
632     line->SetFillColor(fillc);
633     line->SetFillStyle(fills);
634     line->SetLineColor(linec);
635     line->SetLineStyle(lines);
636     line->SetLineWidth(linew);
637     pts->SetMarkerColor(markc);
638     pts->SetMarkerStyle(marks);
639     pts->SetMarkerSize(marksize);
640
641     line->Draw("f");
642     line->Draw();
643     pts->Draw();
644
645     delete[] z;
646     delete[] r;
647
648     cout<<"Hit Return to continue"<<endl;
649     cin >> n;
650     delete line;
651     delete pts;
652     return;
653 }
654 //----------------------------------------------------------------------