Changes related to the extraction of the V0 finder into a separate class (A. Dainese...
[u/mrichter/AliRoot.git] / ITS / AliITSv11Geometry.cxx
CommitLineData
172b0d90 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
166d14ba 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
172b0d90 32#include <Riostream.h>
33#include <TMath.h>
db486a6e 34#include <TArc.h>
35#include <TLine.h>
36#include <TArrow.h>
37#include <TCanvas.h>
38#include <TText.h>
172b0d90 39#include <TGeoPcon.h>
40#include <TGeoCone.h>
41#include <TGeoTube.h> // contaings TGeoTubeSeg
42#include <TGeoArb8.h>
54c9a3d9 43#include <TGeoElement.h>
44#include <TGeoMaterial.h>
166d14ba 45#include <TPolyMarker.h>
46#include <TPolyLine.h>
54c9a3d9 47#include <AliMagF.h>
48#include <AliRun.h>
172b0d90 49#include "AliITSv11Geometry.h"
50
51ClassImp(AliITSv11Geometry)
a98296c1 52
db486a6e 53const Double_t AliITSv11Geometry::fgkmicron = 1.0E-4;
a98296c1 54const Double_t AliITSv11Geometry::fgkmm = 0.10;
55const Double_t AliITSv11Geometry::fgkcm = 1.00;
56const Double_t AliITSv11Geometry::fgkDegree = 1.0;
57const Double_t AliITSv11Geometry::fgkRadian = 180./3.14159265358979323846;
a53658c6 58const Double_t AliITSv11Geometry::fgkgcm3 = 1.0; // assume default is g/cm^3
54c9a3d9 59const Double_t AliITSv11Geometry::fgkKgm3 = 1.0E+3;// assume Kg/m^3
60const Double_t AliITSv11Geometry::fgkKgdm3 = 1.0; // assume Kg/dm^3
a53658c6 61const Double_t AliITSv11Geometry::fgkCelsius = 1.0; // Assume default is C
62const Double_t AliITSv11Geometry::fgkPascal = 1.0E-3; // Assume kPascal
63const Double_t AliITSv11Geometry::fgkKPascal = 1.0; // Asume kPascal
64const Double_t AliITSv11Geometry::fgkeV = 1.0E-9; // GeV default
65const Double_t AliITSv11Geometry::fgkKeV = 1.0e-6; // GeV default
66const Double_t AliITSv11Geometry::fgkMeV = 1.0e-3; // GeV default
67const Double_t AliITSv11Geometry::fgkGeV = 1.0; // GeV default
172b0d90 68//______________________________________________________________________
166d14ba 69Double_t AliITSv11Geometry::Yfrom2Points(Double_t x0,Double_t y0,
70 Double_t x1,Double_t y1,
cee918ed 71 Double_t x)const{
166d14ba 72 // Given the two points (x0,y0) and (x1,y1) and the location x, returns
73 // the value y corresponding to that point x on the line defined by the
74 // two points.
75 // Inputs:
76 // Double_t x0 The first x value defining the line
77 // Double_t y0 The first y value defining the line
78 // Double_t x1 The second x value defining the line
79 // Double_t y1 The second y value defining the line
80 // Double_t x The x value for which the y value is wanted.
81 // Outputs:
82 // none.
83 // Return:
84 // The value y corresponding to the point x on the line defined by
85 // the two points (x0,y0) and (x1,y1).
86
87 if(x0==x1 && y0==y1) {
88 printf("Error: AliITSv11Geometry::Yfrom2Ponts The two points are "
89 "the same (%e,%e) and (%e,%e)",x0,y0,x1,y1);
90 return 0.0;
91 } // end if
92 if(x0==x1){
93 printf("Warning: AliITSv11Geometry::Yfrom2Points x0=%e == x1=%e. "
94 "line vertical ""returning mean y",x0,x1);
95 return 0.5*(y0+y1);
96 }// end if x0==x1
97 Double_t m = (y0-y1)/(x0-x1);
98 return m*(x-x0)+y0;
99}
100//______________________________________________________________________
101Double_t AliITSv11Geometry::Xfrom2Points(Double_t x0,Double_t y0,
102 Double_t x1,Double_t y1,
cee918ed 103 Double_t y)const{
166d14ba 104 // Given the two points (x0,y0) and (x1,y1) and the location y, returns
105 // the value x corresponding to that point y on the line defined by the
106 // two points.
107 // Inputs:
108 // Double_t x0 The first x value defining the line
109 // Double_t y0 The first y value defining the line
110 // Double_t x1 The second x value defining the line
111 // Double_t y1 The second y value defining the line
112 // Double_t y The y value for which the x value is wanted.
113 // Outputs:
114 // none.
115 // Return:
116 // The value x corresponding to the point y on the line defined by
117 // the two points (x0,y0) and (x1,y1).
118
119 if(x0==x1 && y0==y1) {
120 printf("Error: AliITSv11Geometry::Yfrom2Ponts The two points are "
121 "the same (%e,%e) and (%e,%e)",x0,y0,x1,y1);
122 return 0.0;
123 } // end if
124 if(y0==y1){
125 printf("Warrning: AliITSv11Geometry::Yfrom2Points y0=%e == y1=%e. "
126 "line horizontal returning mean x",y0,y1);
127 return 0.5*(x0+x1);
128 }// end if y0==y1
129 Double_t m = (x0-x1)/(y0-y1);
130 return m*(y-y0)+x0;
131}
132//______________________________________________________________________
133Double_t AliITSv11Geometry::RmaxFrom2Points(const TGeoPcon *p,Int_t i1,
cee918ed 134 Int_t i2,Double_t z)const{
172b0d90 135 // functions Require at parts of Volume A to be already defined.
136 // Retruns the value of Rmax corresponding to point z alone the line
137 // defined by the two points p.Rmax(i1),p-GetZ(i1) and p->GetRmax(i2),
138 // p->GetZ(i2).
166d14ba 139 // Inputs:
140 // TGeoPcon *p The Polycone where the two points come from
141 // Int_t i1 Point 1
142 // Int_t i2 Point 2
143 // Double_t z The value of z for which Rmax is to be found
144 // Outputs:
145 // none.
146 // Return:
147 // Double_t Rmax the value corresponding to z
172b0d90 148 Double_t d0,d1,d2,r;
149
150 d0 = p->GetRmax(i1)-p->GetRmax(i2);// cout <<"L263: d0="<<d0<<endl;
151 d1 = z-p->GetZ(i2);// cout <<"L264: d1="<<d1<<endl;
152 d2 = p->GetZ(i1)-p->GetZ(i2);// cout <<"L265: d2="<<d2<<endl;
153 r = p->GetRmax(i2) + d1*d0/d2;// cout <<"L266: r="<<r<<endl;
154 return r;
155}
156//______________________________________________________________________
166d14ba 157Double_t AliITSv11Geometry::RminFrom2Points(const TGeoPcon *p,Int_t i1,
cee918ed 158 Int_t i2,Double_t z)const{
172b0d90 159 // Retruns the value of Rmin corresponding to point z alone the line
160 // defined by the two points p->GetRmin(i1),p->GetZ(i1) and
161 // p->GetRmin(i2), p->GetZ(i2).
166d14ba 162 // Inputs:
163 // TGeoPcon *p The Polycone where the two points come from
164 // Int_t i1 Point 1
165 // Int_t i2 Point 2
166 // Double_t z The value of z for which Rmax is to be found
167 // Outputs:
168 // none.
169 // Return:
170 // Double_t Rmax the value corresponding to z
172b0d90 171
172 return p->GetRmin(i2)+(p->GetRmin(i1)-p->GetRmin(i2))*(z-p->GetZ(i2))/
173 (p->GetZ(i1)-p->GetZ(i2));
174}
175//______________________________________________________________________
166d14ba 176Double_t AliITSv11Geometry::RFrom2Points(const Double_t *p,const Double_t *az,
cee918ed 177 Int_t i1,Int_t i2,Double_t z)const{
172b0d90 178 // Retruns the value of Rmin corresponding to point z alone the line
179 // defined by the two points p->GetRmin(i1),p->GetZ(i1) and
180 // p->GetRmin(i2), p->GetZ(i2).
166d14ba 181 // Inputs:
182 // Double_t az Array of z values
183 // Double_t r Array of r values
184 // Int_t i1 First Point in arrays
185 // Int_t i2 Second Point in arrays
186 // Double_t z Value z at which r is to be found
187 // Outputs:
188 // none.
189 // Return:
190 // The value r corresponding to z and the line defined by the two points
172b0d90 191
166d14ba 192 return p[i2]+(p[i1]-p[i2])*(z-az[i2])/(az[i1]-az[i2]);
172b0d90 193}
194//______________________________________________________________________
166d14ba 195Double_t AliITSv11Geometry::Zfrom2MinPoints(const TGeoPcon *p,Int_t i1,
cee918ed 196 Int_t i2,Double_t r)const{
172b0d90 197 // Retruns the value of Z corresponding to point R alone the line
198 // defined by the two points p->GetRmin(i1),p->GetZ(i1) and
199 // p->GetRmin(i2),p->GetZ(i2)
166d14ba 200 // Inputs:
201 // TGeoPcon *p The Poly cone where the two points come from.
202 // Int_t i1 First Point in arrays
203 // Int_t i2 Second Point in arrays
204 // Double_t r Value r min at which z is to be found
205 // Outputs:
206 // none.
207 // Return:
208 // The value z corresponding to r min and the line defined by
209 // the two points
172b0d90 210
211 return p->GetZ(i2)+(p->GetZ(i1)-p->GetZ(i2))*(r-p->GetRmin(i2))/
212 (p->GetRmin(i1)-p->GetRmin(i2));
213}
214//______________________________________________________________________
166d14ba 215Double_t AliITSv11Geometry::Zfrom2MaxPoints(const TGeoPcon *p,Int_t i1,
cee918ed 216 Int_t i2,Double_t r)const{
172b0d90 217 // Retruns the value of Z corresponding to point R alone the line
218 // defined by the two points p->GetRmax(i1),p->GetZ(i1) and
219 // p->GetRmax(i2),p->GetZ(i2)
166d14ba 220 // Inputs:
221 // TGeoPcon *p The Poly cone where the two points come from.
222 // Int_t i1 First Point in arrays
223 // Int_t i2 Second Point in arrays
224 // Double_t r Value r max at which z is to be found
225 // Outputs:
226 // none.
227 // Return:
228 // The value z corresponding to r max and the line defined by
229 // the two points
172b0d90 230
231 return p->GetZ(i2)+(p->GetZ(i1)-p->GetZ(i2))*(r-p->GetRmax(i2))/
232 (p->GetRmax(i1)-p->GetRmax(i2));
233}
234//______________________________________________________________________
166d14ba 235Double_t AliITSv11Geometry::Zfrom2Points(const Double_t *z,const Double_t *ar,
cee918ed 236 Int_t i1,Int_t i2,Double_t r)const{
166d14ba 237 // Retruns the value of z corresponding to point R alone the line
172b0d90 238 // defined by the two points p->GetRmax(i1),p->GetZ(i1) and
239 // p->GetRmax(i2),p->GetZ(i2)
166d14ba 240 // Inputs:
241 // Double_t z Array of z values
242 // Double_t ar Array of r values
243 // Int_t i1 First Point in arrays
244 // Int_t i2 Second Point in arrays
245 // Double_t r Value r at which z is to be found
246 // Outputs:
247 // none.
248 // Return:
249 // The value z corresponding to r and the line defined by the two points
172b0d90 250
166d14ba 251 return z[i2]+(z[i1]-z[i2])*(r-ar[i2])/(ar[i1]-ar[i2]);
172b0d90 252}
253//______________________________________________________________________
166d14ba 254Double_t AliITSv11Geometry::RmaxFromZpCone(const TGeoPcon *p,int ip,
255 Double_t tc,Double_t z,
cee918ed 256 Double_t th)const{
166d14ba 257 // General Outer Cone surface equation Rmax.
258 // Intputs:
259 // TGeoPcon *p The poly cone where the initial point comes from
260 // Int_t ip The index in p to get the point location
261 // Double_t tc The angle of that part of the cone is at
262 // Double_t z The value of z to compute Rmax from
263 // Double_t th The perpendicular distance the parralell line is
264 // from the point ip.
265 // Outputs:
266 // none.
267 // Return:
268 // The value Rmax correstponding to the line at angle th, offeset by
269 // th, and the point p->GetZ/Rmin[ip] at the location z.
cee918ed 270 Double_t tantc = TMath::Tan(tc*TMath::DegToRad());
271 Double_t costc = TMath::Cos(tc*TMath::DegToRad());
172b0d90 272
273 return -tantc*(z-p->GetZ(ip))+p->GetRmax(ip)+th/costc;
274}
275//______________________________________________________________________
166d14ba 276Double_t AliITSv11Geometry::RFromZpCone(const Double_t *ar,
277 const Double_t *az,int ip,
278 Double_t tc,Double_t z,
cee918ed 279 Double_t th)const{
166d14ba 280 // General Cone surface equation R(z).
281 // Intputs:
282 // Double_t ar The array of R values
283 // Double_t az The array of Z values
284 // Int_t ip The index in p to get the point location
285 // Double_t tc The angle of that part of the cone is at
286 // Double_t z The value of z to compute R from
287 // Double_t th The perpendicular distance the parralell line is
288 // from the point ip.
289 // Outputs:
290 // none.
291 // Return:
292 // The value R correstponding to the line at angle th, offeset by
293 // th, and the point p->GetZ/Rmax[ip] at the locatin z.
cee918ed 294 Double_t tantc = TMath::Tan(tc*TMath::DegToRad());
295 Double_t costc = TMath::Cos(tc*TMath::DegToRad());
172b0d90 296
166d14ba 297 return -tantc*(z-az[ip])+ar[ip]+th/costc;
172b0d90 298}
299//______________________________________________________________________
166d14ba 300Double_t AliITSv11Geometry::RminFromZpCone(const TGeoPcon *p,Int_t ip,
301 Double_t tc,Double_t z,
cee918ed 302 Double_t th)const{
166d14ba 303 // General Inner Cone surface equation Rmin.
304 // Intputs:
305 // TGeoPcon *p The poly cone where the initial point comes from
306 // Int_t ip The index in p to get the point location
307 // Double_t tc The angle of that part of the cone is at
308 // Double_t z The value of z to compute Rmin from
309 // Double_t th The perpendicular distance the parralell line is
310 // from the point ip.
311 // Outputs:
312 // none.
313 // Return:
314 // The value Rmin correstponding to the line at angle th, offeset by
315 // th, and the point p->GetZ/Rmin[ip] at the location z.
cee918ed 316 Double_t tantc = TMath::Tan(tc*TMath::DegToRad());
317 Double_t costc = TMath::Cos(tc*TMath::DegToRad());
172b0d90 318
319 return -tantc*(z-p->GetZ(ip))+p->GetRmin(ip)+th/costc;
320}
321//______________________________________________________________________
166d14ba 322Double_t AliITSv11Geometry::ZFromRmaxpCone(const TGeoPcon *p,int ip,
323 Double_t tc,Double_t r,
cee918ed 324 Double_t th)const{
166d14ba 325 // General Outer cone Surface equation for z.
326 // Intputs:
327 // TGeoPcon *p The poly cone where the initial point comes from
328 // Int_t ip The index in p to get the point location
329 // Double_t tc The angle of that part of the cone is at
330 // Double_t r The value of Rmax to compute z from
331 // Double_t th The perpendicular distance the parralell line is
332 // from the point ip.
333 // Outputs:
334 // none.
335 // Return:
336 // The value Z correstponding to the line at angle th, offeset by
337 // th, and the point p->GetZ/Rmax[ip] at the location r.
cee918ed 338 Double_t tantc = TMath::Tan(tc*TMath::DegToRad());
339 Double_t costc = TMath::Cos(tc*TMath::DegToRad());
172b0d90 340
341 return p->GetZ(ip)+(p->GetRmax(ip)+th/costc-r)/tantc;
342}
343//______________________________________________________________________
166d14ba 344Double_t AliITSv11Geometry::ZFromRmaxpCone(const Double_t *ar,
345 const Double_t *az,int ip,
346 Double_t tc,Double_t r,
cee918ed 347 Double_t th)const{
166d14ba 348 // General Outer cone Surface equation for z.
349 // Intputs:
350 // Double_t ar The array of R values
351 // Double_t az The array of Z values
352 // Int_t ip The index in p to get the point location
353 // Double_t tc The angle of that part of the cone is at
354 // Double_t r The value of Rmax to compute z from
355 // Double_t th The perpendicular distance the parralell line is
356 // from the point ip.
357 // Outputs:
358 // none.
359 // Return:
360 // The value Z correstponding to the line at angle th, offeset by
361 // th, and the point p->GetZ/Rmax[ip] at the locatin r.
cee918ed 362 Double_t tantc = TMath::Tan(tc*TMath::DegToRad());
363 Double_t costc = TMath::Cos(tc*TMath::DegToRad());
172b0d90 364
166d14ba 365 return az[ip]+(ar[ip]+th/costc-r)/tantc;
172b0d90 366}
367//______________________________________________________________________
166d14ba 368Double_t AliITSv11Geometry::ZFromRminpCone(const TGeoPcon *p,int ip,
369 Double_t tc,Double_t r,
cee918ed 370 Double_t th)const{
166d14ba 371 // General Inner cone Surface equation for z.
372 // Intputs:
373 // TGeoPcon *p The poly cone where the initial point comes from
374 // Int_t ip The index in p to get the point location
375 // Double_t tc The angle of that part of the cone is at
376 // Double_t r The value of Rmin to compute z from
377 // Double_t th The perpendicular distance the parralell line is
378 // from the point ip.
379 // Outputs:
380 // none.
381 // Return:
382 // The value Z correstponding to the line at angle th, offeset by
383 // th, and the point p->GetZ/Rmin[ip] at the location r.
cee918ed 384 Double_t tantc = TMath::Tan(tc*TMath::DegToRad());
385 Double_t costc = TMath::Cos(tc*TMath::DegToRad());
172b0d90 386
387 return p->GetZ(ip)+(p->GetRmin(ip)+th/costc-r)/tantc;
388}
389//______________________________________________________________________
166d14ba 390void AliITSv11Geometry::RadiusOfCurvature(Double_t rc,Double_t theta0,
391 Double_t z0,Double_t r0,
392 Double_t theta1,Double_t &z1,
cee918ed 393 Double_t &r1)const{
172b0d90 394 // Given a initial point z0,r0, the initial angle theta0, and the radius
395 // of curvature, returns the point z1, r1 at the angle theta1. Theta
396 // measured from the r axis in the clock wise direction [degrees].
166d14ba 397 // Inputs:
398 // Double_t rc The radius of curvature
399 // Double_t theta0 The starting angle (degrees)
400 // Double_t z0 The value of z at theta0
401 // Double_t r0 The value of r at theta0
402 // Double_t theta1 The ending angle (degrees)
403 // Outputs:
404 // Double_t &z1 The value of z at theta1
405 // Double_t &r1 The value of r at theta1
406 // Return:
407 // none.
172b0d90 408
cee918ed 409 z1 = rc*(TMath::Sin(theta1*TMath::DegToRad())-TMath::Sin(theta0*TMath::DegToRad()))+z0;
410 r1 = rc*(TMath::Cos(theta1*TMath::DegToRad())-TMath::Cos(theta0*TMath::DegToRad()))+r0;
172b0d90 411 return;
412}
413//______________________________________________________________________
166d14ba 414void AliITSv11Geometry::InsidePoint(const TGeoPcon *p,Int_t i1,Int_t i2,
415 Int_t i3,Double_t c,TGeoPcon *q,Int_t j1,
cee918ed 416 Bool_t max)const{
172b0d90 417 // Given two lines defined by the points i1, i2,i3 in the TGeoPcon
418 // class p that intersect at point p->GetZ(i2) return the point z,r
419 // that is Cthick away in the TGeoPcon class q. If points i1=i2
420 // and max == kTRUE, then p->GetRmin(i1) and p->GetRmax(i2) are used.
421 // if points i2=i3 and max=kTRUE then points p->GetRmax(i2) and
422 // p->GetRmin(i3) are used. If i2=i3 and max=kFALSE, then p->GetRmin(i2)
423 // and p->GetRmax(i3) are used.
424 // Inputs:
425 // TGeoPcon *p Class where points i1, i2, and i3 are taken from
426 // Int_t i1 First point in class p
427 // Int_t i2 Second point in class p
428 // Int_t i3 Third point in class p
429 // Double_t c Distance inside the outer surface/inner suface
430 // that the point j1 is to be computed for.
431 // TGeoPcon *q Pointer to class for results to be put into.
432 // Int_t j1 Point in class q where data is to be stored.
433 // Bool_t max if kTRUE, then a Rmax value is computed,
434 // else a Rmin valule is computed.
435 // Output:
436 // TGeoPcon *q Pointer to class for results to be put into.
437 // Return:
438 // none.
439 Double_t x0,y0,x1,y1,x2,y2,x,y;
440
441 if(max){
442 c = -c; //cout <<"L394 c="<<c<<endl;
443 y0 = p->GetRmax(i1);
444 if(i1==i2) y0 = p->GetRmin(i1); //cout <<"L396 y0="<<y0<<endl;
445 y1 = p->GetRmax(i2); //cout <<"L397 y1="<<y1<<endl;
446 y2 = p->GetRmax(i3); //cout <<"L398 y2="<<y2<<endl;
447 if(i2==i3) y2 = p->GetRmin(i3); //cout <<"L399 y2="<<y2<<endl;
448 }else{ // min
449 y0 = p->GetRmin(i1); //cout <<"L401 y0="<<y0<<endl;
450 y1 = p->GetRmin(i2); //cout <<"L402 y1="<<y1<<endl;
451 y2 = p->GetRmin(i3);
452 if(i2==i3) y2 = p->GetRmax(i3); //cout <<"L404 y2="<<y2<<endl;
453 } // end if
454 x0 = p->GetZ(i1); //cout <<"L406 x0="<<x0<<endl;
455 x1 = p->GetZ(i2); //cout <<"L407 x1="<<x1<<endl;
456 x2 = p->GetZ(i3); //cout <<"L408 x2="<<x2<<endl;
457 //
458 InsidePoint(x0,y0,x1,y1,x2,y2,c,x,y);
459 q->Z(j1) = x;
460 if(max) q->Rmax(j1) = y;
461 else q->Rmin(j1) = y;
462 return;
463}
464//----------------------------------------------------------------------
166d14ba 465void AliITSv11Geometry::InsidePoint(Double_t x0,Double_t y0,
466 Double_t x1,Double_t y1,
467 Double_t x2,Double_t y2,Double_t c,
cee918ed 468 Double_t &x,Double_t &y)const{
172b0d90 469 // Given two intersecting lines defined by the points (x0,y0), (x1,y1) and
543b7370 470 // (x1,y1), (x2,y2) {intersecting at (x1,y1)} the point (x,y) a distance
172b0d90 471 // c away is returned such that two lines a distance c away from the
472 // lines defined above intersect at (x,y).
473 // Inputs:
474 // Double_t x0 X point on the first intersecting sets of lines
475 // Double_t y0 Y point on the first intersecting sets of lines
476 // Double_t x1 X point on the first/second intersecting sets of lines
477 // Double_t y1 Y point on the first/second intersecting sets of lines
478 // Double_t x2 X point on the second intersecting sets of lines
479 // Double_t y2 Y point on the second intersecting sets of lines
480 // Double_t c Distance the two sets of lines are from each other
481 // Output:
482 // Double_t x X point for the intersecting sets of parellel lines
483 // Double_t y Y point for the intersecting sets of parellel lines
484 // Return:
485 // none.
166d14ba 486 Double_t dx01,dx12,dy01,dy12,r01,r12,m;
543b7370 487
488 //printf("InsidePoint: x0=% #12.7g y0=% #12.7g x1=% #12.7g y1=% #12.7g "
489 // "x2=% #12.7g y2=% #12.7g c=% #12.7g ",x0,y0,x1,y2,x2,y2,c);
172b0d90 490 dx01 = x0-x1; //cout <<"L410 dx01="<<dx01<<endl;
491 dx12 = x1-x2; //cout <<"L411 dx12="<<dx12<<endl;
492 dy01 = y0-y1; //cout <<"L412 dy01="<<dy01<<endl;
493 dy12 = y1-y2; //cout <<"L413 dy12="<<dy12<<endl;
166d14ba 494 r01 = TMath::Sqrt(dy01*dy01+dx01*dx01); //cout <<"L414 r01="<<r01<<endl;
495 r12 = TMath::Sqrt(dy12*dy12+dx12*dx12); //cout <<"L415 r12="<<r12<<endl;
172b0d90 496 m = dx12*dy01-dy12*dx01;
497 if(m*m<DBL_EPSILON){ // m == n
498 if(dy01==0.0){ // line are =
499 x = x1+c; //cout <<"L419 x="<<x<<endl;
500 y = y1; //cout <<"L420 y="<<y<<endl;
543b7370 501 //printf("dy01==0.0 x=% #12.7g y=% #12.7g\n",x,y);
172b0d90 502 return;
503 }else if(dx01==0.0){
504 x = x1;
505 y = y1+c;
543b7370 506 //printf("dx01==0.0 x=% #12.7g y=% #12.7g\n",x,y);
172b0d90 507 return;
508 }else{ // dx01!=0 and dy01 !=0.
166d14ba 509 x = x1-0.5*c*r01/dy01; //cout <<"L434 x="<<x<<endl;
510 y = y1+0.5*c*r01/dx01; //cout <<"L435 y="<<y<<endl;
543b7370 511 //printf("m*m<DBL_E x=% #12.7g y=% #12.7g\n",x,y);
172b0d90 512 } // end if
513 return;
514 } //
cee918ed 515 x = x1+c*(dx12*r01-dx01*r12)/m; //cout <<"L442 x="<<x<<endl;
516 y = y1+c*(dy12*r01-dy01*r12)/m; //cout <<"L443 y="<<y<<endl;
543b7370 517 //printf(" x=% #12.7g y=% #12.7g\n",x,y);
172b0d90 518 //cout <<"=============================================="<<endl;
519 return;
520}
521//----------------------------------------------------------------------
166d14ba 522void AliITSv11Geometry:: PrintArb8(const TGeoArb8 *a)const{
523 // Prints out the content of the TGeoArb8. Usefull for debugging.
524 // Inputs:
525 // TGeoArb8 *a
526 // Outputs:
527 // none.
528 // Return:
529 // none.
530
cee918ed 531 if(!GetDebug()) return;
532 printf("%s",a->GetName());
533 a->InspectShape();
166d14ba 534 return;
172b0d90 535}
536//----------------------------------------------------------------------
166d14ba 537void AliITSv11Geometry:: PrintPcon(const TGeoPcon *a)const{
538 // Prints out the content of the TGeoPcon. Usefull for debugging.
539 // Inputs:
540 // TGeoPcon *a
541 // Outputs:
542 // none.
543 // Return:
544 // none.
545
cee918ed 546 if(!GetDebug()) return;
166d14ba 547 cout << a->GetName() << ": N=" << a->GetNz() << " Phi1=" << a->GetPhi1()
548 << ", Dphi=" << a->GetDphi() << endl;
172b0d90 549 cout << "i\t Z \t Rmin \t Rmax" << endl;
166d14ba 550 for(Int_t iii=0;iii<a->GetNz();iii++){
551 cout << iii << "\t" << a->GetZ(iii) << "\t" << a->GetRmin(iii)
552 << "\t" << a->GetRmax(iii) << endl;
172b0d90 553 } // end for iii
166d14ba 554 return;
172b0d90 555}
556//----------------------------------------------------------------------
166d14ba 557void AliITSv11Geometry::PrintTube(const TGeoTube *a)const{
558 // Prints out the content of the TGeoTube. Usefull for debugging.
559 // Inputs:
560 // TGeoTube *a
561 // Outputs:
562 // none.
563 // Return:
564 // none.
565
cee918ed 566 if(!GetDebug()) return;
166d14ba 567 cout << a->GetName() <<": Rmin="<<a->GetRmin()
568 <<" Rmax=" <<a->GetRmax()<<" Dz="<<a->GetDz()<<endl;
569 return;
172b0d90 570}
571//----------------------------------------------------------------------
166d14ba 572void AliITSv11Geometry::PrintTubeSeg(const TGeoTubeSeg *a)const{
573 // Prints out the content of the TGeoTubeSeg. Usefull for debugging.
574 // Inputs:
575 // TGeoTubeSeg *a
576 // Outputs:
577 // none.
578 // Return:
579 // none.
580
cee918ed 581 if(!GetDebug()) return;
166d14ba 582 cout << a->GetName() <<": Phi1="<<a->GetPhi1()<<
583 " Phi2="<<a->GetPhi2()<<" Rmin="<<a->GetRmin()
584 <<" Rmax=" <<a->GetRmax()<<" Dz="<<a->GetDz()<<endl;
585 return;
172b0d90 586}
587//----------------------------------------------------------------------
166d14ba 588void AliITSv11Geometry::PrintConeSeg(const TGeoConeSeg *a)const{
589 // Prints out the content of the TGeoConeSeg. Usefull for debugging.
590 // Inputs:
591 // TGeoConeSeg *a
592 // Outputs:
593 // none.
594 // Return:
595 // none.
596
cee918ed 597 if(!GetDebug()) return;
166d14ba 598 cout << a->GetName() <<": Phi1="<<a->GetPhi1()<<
599 " Phi2="<<a->GetPhi2()<<" Rmin1="<<a->GetRmin1()
600 <<" Rmax1=" <<a->GetRmax1()<<" Rmin2="<<a->GetRmin2()
601 <<" Rmax2=" <<a->GetRmax2()<<" Dz="<<a->GetDz()<<endl;
602 return;
172b0d90 603}
604//----------------------------------------------------------------------
166d14ba 605void AliITSv11Geometry::PrintBBox(const TGeoBBox *a)const{
606 // Prints out the content of the TGeoBBox. Usefull for debugging.
607 // Inputs:
608 // TGeoBBox *a
609 // Outputs:
610 // none.
611 // Return:
612 // none.
613
cee918ed 614 if(!GetDebug()) return;
166d14ba 615 cout << a->GetName() <<": Dx="<<a->GetDX()<<
616 " Dy="<<a->GetDY()<<" Dz="<<a->GetDZ() <<endl;
617 return;
172b0d90 618}
166d14ba 619//---------------------------------------------------------------------
54c9a3d9 620void AliITSv11Geometry::CreateDefaultMaterials(){
621 // Create ITS materials
622 // Defined media here should correspond to the one defined in galice.cuts
623 // File which is red in (AliMC*) fMCApp::Init() { ReadTransPar(); }
624 // Inputs:
625 // none.
626 // Outputs:
627 // none.
628 // Return:
629 // none.
630 Int_t i;
631 Double_t w;
632
633 // Define some elements
634 TGeoElement *itsH = new TGeoElement("ITS_H","Hydrogen",1,1.00794);
635 TGeoElement *itsHe = new TGeoElement("ITS_He","Helium",2,4.002602);
636 TGeoElement *itsC = new TGeoElement("ITS_C","Carbon",6,12.0107);
637 TGeoElement *itsN = new TGeoElement("ITS_N","Nitrogen",7,14.0067);
638 TGeoElement *itsO = new TGeoElement("ITS_O","Oxygen",8,15.994);
639 TGeoElement *itsF = new TGeoElement("ITS_F","Florine",9,18.9984032);
640 TGeoElement *itsNe = new TGeoElement("ITS_Ne","Neon",10,20.1797);
641 TGeoElement *itsMg = new TGeoElement("ITS_Mg","Magnesium",12,24.3050);
642 TGeoElement *itsAl = new TGeoElement("ITS_Al","Aluminum",13,26981538);
643 TGeoElement *itsSi = new TGeoElement("ITS_Si","Silicon",14,28.0855);
644 TGeoElement *itsP = new TGeoElement("ITS_P" ,"Phosphorous",15,30.973761);
645 TGeoElement *itsS = new TGeoElement("ITS_S" ,"Sulfur",16,32.065);
646 TGeoElement *itsAr = new TGeoElement("ITS_Ar","Argon",18,39.948);
647 TGeoElement *itsTi = new TGeoElement("ITS_Ti","Titanium",22,47.867);
648 TGeoElement *itsCr = new TGeoElement("ITS_Cr","Chromium",24,51.9961);
649 TGeoElement *itsMn = new TGeoElement("ITS_Mn","Manganese",25,54.938049);
650 TGeoElement *itsFe = new TGeoElement("ITS_Fe","Iron",26,55.845);
651 TGeoElement *itsCo = new TGeoElement("ITS_Co","Cobalt",27,58.933200);
652 TGeoElement *itsNi = new TGeoElement("ITS_Ni","Nickrl",28,56.6930);
653 TGeoElement *itsCu = new TGeoElement("ITS_Cu","Copper",29,63.546);
654 TGeoElement *itsZn = new TGeoElement("ITS_Zn","Zinc",30,65.39);
655 TGeoElement *itsKr = new TGeoElement("ITS_Kr","Krypton",36,83.80);
656 TGeoElement *itsMo = new TGeoElement("ITS_Mo","Molylibdium",42,95.94);
657 TGeoElement *itsXe = new TGeoElement("ITS_Xe","Zeon",54,131.293);
658
659 // Start with the Materials since for any one material there
660 // can be defined more than one Medium.
661 // Air, dry. at 15degree C, 101325Pa at sea-level, % by volume
662 // (% by weight). Density is 351 Kg/m^3
663 // N2 78.084% (75.47%), O2 20.9476% (23.20%), Ar 0.934 (1.28%)%,
664 // C02 0.0314% (0.0590%), Ne 0.001818% (0.0012%, CH4 0.002% (),
665 // He 0.000524% (0.00007%), Kr 0.000114% (0.0003%), H2 0.00005% (3.5E-6%),
666 // Xe 0.0000087% (0.00004 %), H2O 0.0% (dry) + trace amounts at the ppm
667 // levels.
668 TGeoMixture *itsAir = new TGeoMixture("ITS_Air",9);
669 w = 75.47E-2;
670 itsAir->AddElement(itsN,w);// Nitorgen, atomic
671 w = 23.29E-2 + // O2
672 5.90E-4 * 2.*15.994/(12.0107+2.*15.994);// CO2.
673 itsAir->AddElement(itsO,w);// Oxygen, atomic
674 w = 1.28E-2;
675 itsAir->AddElement(itsAr,w);// Argon, atomic
676 w = 5.90E-4*12.0107/(12.0107+2.*15.994)+ // CO2
677 2.0E-5 *12.0107/(12.0107+4.* 1.00794); // CH4
678 itsAir->AddElement(itsC,w);// Carbon, atomic
679 w = 1.818E-5;
680 itsAir->AddElement(itsNe,w);// Ne, atomic
681 w = 3.5E-8;
682 itsAir->AddElement(itsHe,w);// Helium, atomic
683 w = 7.0E-7;
684 itsAir->AddElement(itsKr,w);// Krypton, atomic
685 w = 3.0E-6;
686 itsAir->AddElement(itsH,w);// Hydrogen, atomic
687 w = 4.0E-7;
688 itsAir->AddElement(itsXe,w);// Xenon, atomic
689 itsAir->SetDensity(351.0*fgkKgm3); //
690 itsAir->SetPressure(101325*fgkPascal);
691 itsAir->SetTemperature(15.0*fgkCelsius);
692 itsAir->SetState(TGeoMaterial::kMatStateGas);
693 //
694 // Silicone
695 TGeoMaterial *itsSiDet = new TGeoMaterial("ITS_Si",itsSi,2.33*fgkgcm3);
696 itsSiDet->SetTemperature(15.0*fgkCelsius);
697 itsSiDet->SetState(TGeoMaterial::kMatStateSolid);
698 //
699 // Epoxy C18 H19 O3
700 TGeoMixture *itsEpoxy = new TGeoMixture("ITS_Epoxy",3);
701 itsEpoxy->AddElement(itsC,18);
702 itsEpoxy->AddElement(itsH,19);
703 itsEpoxy->AddElement(itsO,3);
704 itsEpoxy->SetDensity(1.8*fgkgcm3);
705 itsEpoxy->SetTemperature(15.0*fgkCelsius);
706 itsEpoxy->SetState(TGeoMaterial::kMatStateSolid);
707 //
708 // Carbon Fiber, M55J, 60% fiber by volume. Fiber density
709 // 1.91 g/cm^3. See ToryaCA M55J data sheet.
710 //Begin_Html
711 /*
712 <A HREF="http://torayusa.com/cfa/pdfs/M55JDataSheet.pdf"> Data Sheet
713 </A>
714 */
715 //End_Html
716 TGeoMixture *itsCarbonFiber = new TGeoMixture("ITS_CarbonFiber-M55J",4);
717 // Assume that the epoxy fill in the space between the fibers and so
718 // no change in the total volume. To compute w, assume 1cm^3 total
719 // volume.
720 w = 1.91/(1.91+(1.-.60)*itsEpoxy->GetDensity());
721 itsCarbonFiber->AddElement(itsC,w);
722 w = (1.-.60)*itsEpoxy->GetDensity()/(1.91+(1.-.06)*itsEpoxy->GetDensity());
723 for(i=0;i<itsEpoxy->GetNelements();i++)
724 itsCarbonFiber->AddElement(itsEpoxy->GetElement(i),
725 itsEpoxy->GetWmixt()[i]*w);
726 itsCarbonFiber->SetDensity((1.91+(1.-.60)*itsEpoxy->GetDensity())*fgkgcm3);
727 itsCarbonFiber->SetTemperature(22.0*fgkCelsius);
728 itsCarbonFiber->SetState(TGeoMaterial::kMatStateSolid);
729 //
730 //
731 //
732 // Rohacell 51A millable foam product.
733 // C9 H13 N1 O2 52Kg/m^3
734 // Elemental composition, Private comunications with
735 // Bjorn S. Nilsen
736 //Begin_Html
737 /*
738 <A HREF="http://www.rohacell.com/en/performanceplastics8344.html">
739 Rohacell-A see Properties
740 </A>
741 */
742 //End_Html
743 TGeoMixture *itsFoam = new TGeoMixture("ITS_Foam",4);
744 itsFoam->AddElement(itsC,9);
745 itsFoam->AddElement(itsH,13);
746 itsFoam->AddElement(itsN,1);
747 itsFoam->AddElement(itsO,2);
748 itsFoam->SetTitle("Rohacell 51 A");
749 itsFoam->SetDensity(52.*fgkKgm3);
750 itsFoam->SetTemperature(22.0*fgkCelsius);
751 itsFoam->SetState(TGeoMaterial::kMatStateSolid);
752 //
753 // Kapton % by weight, H 2.6362, C69.1133, N 7.3270, O 20.0235
754 // Density 1.42 g/cm^3
755 //Begin_Html
756 /*
757 <A HREF="http://www2.dupont.com/Kapton/en_US/assets/downloads/pdf/summaryofprop.pdf">
758 Kapton. also see </A>
759 <A HREF="http://physics.nist.gov/cgi-bin/Star/compos.pl?matno=179">
760 </A>
761 */
762 //End_Html
763 TGeoMixture *itsKapton = new TGeoMixture("ITS_Kapton",4);
764 itsKapton->AddElement(itsH,0.026362);
765 itsKapton->AddElement(itsC,0.691133);
766 itsKapton->AddElement(itsN,0.073270);
767 itsKapton->AddElement(itsO,0.200235);
768 itsKapton->SetTitle("Kapton ribon and cable base");
769 itsKapton->SetDensity(1.42*fgkgcm3);
770 itsKapton->SetTemperature(22.0*fgkCelsius);
771 itsKapton->SetState(TGeoMaterial::kMatStateSolid);
772 //
773 // UPILEX-S C16 H6 O4 N2 polymer (a Kapton like material)
774 // Density 1.47 g/cm^3
775 //Begin_Html
776 /*
777 <A HREF="http://northamerica.ube.com/page.php?pageid=9">
778 UPILEX-S. also see </A>
779 <A HREF="http://northamerica.ube.com/page.php?pageid=81">
780 </A>
781 */
782 //End_Html
783 TGeoMixture *itsUpilex = new TGeoMixture("ITS_Upilex",4);
784 itsUpilex->AddElement(itsC,16);
785 itsUpilex->AddElement(itsH,6);
786 itsUpilex->AddElement(itsN,2);
787 itsUpilex->AddElement(itsO,4);
788 itsUpilex->SetTitle("Upilex ribon, cable, and pcb base");
789 itsUpilex->SetDensity(1.47*fgkgcm3);
790 itsUpilex->SetTemperature(22.0*fgkCelsius);
791 itsUpilex->SetState(TGeoMaterial::kMatStateSolid);
792 //
793 // Aluminum 6061 (Al used by US groups)
794 // % by weight, Cr 0.04-0.35 range [0.0375 nominal value used]
795 // Cu 0.15-0.4 [0.275], Fe Max 0.7 [0.35], Mg 0.8-1.2 [1.0],
796 // Mn Max 0.15 [0.075] Si 0.4-0.8 [0.6], Ti Max 0.15 [0.075],
797 // Zn Max 0.25 [0.125], Rest Al [97.4625]. Density 2.7 g/cm^3
798 //Begin_Html
799 /*
800 <A HREG="http://www.matweb.com/SpecificMaterial.asp?bassnum=MA6016&group=General">
801 Aluminum 6061 specifications
802 </A>
803 */
804 //End_Html
805 TGeoMixture *itsAl6061 = new TGeoMixture("ITS_Al6061",9);
806 itsAl6061->AddElement(itsCr,0.000375);
807 itsAl6061->AddElement(itsCu,0.00275);
808 itsAl6061->AddElement(itsFe,0.0035);
809 itsAl6061->AddElement(itsMg,0.01);
810 itsAl6061->AddElement(itsMn,0.00075);
811 itsAl6061->AddElement(itsSi,0.006);
812 itsAl6061->AddElement(itsTi,0.00075);
813 itsAl6061->AddElement(itsZn,0.00125);
814 itsAl6061->AddElement(itsAl,0.974625);
815 itsAl6061->SetTitle("Aluminum Alloy 6061");
816 itsAl6061->SetDensity(2.7*fgkgcm3);
817 itsAl6061->SetTemperature(22.0*fgkCelsius);
818 itsAl6061->SetState(TGeoMaterial::kMatStateSolid);
819 //
820 // Aluminum 7075 (Al used by Italian groups)
821 // % by weight, Cr 0.18-0.28 range [0.23 nominal value used]
822 // Cu 1.2-2.0 [1.6], Fe Max 0.5 [0.25], Mg 2.1-2.9 [2.5],
823 // Mn Max 0.3 [0.125] Si Max 0.4 [0.2], Ti Max 0.2 [0.1],
824 // Zn 5.1-6.1 [5.6], Rest Al [89.395]. Density 2.81 g/cm^3
825 //Begin_Html
826 /*
827 <A HREG="http://asm.matweb.com/search/SpecificMaterial.asp?bassnum=MA7075T6">
828 Aluminum 7075 specifications
829 </A>
830 */
831 //End_Html
832 TGeoMixture *itsAl7075 = new TGeoMixture("ITS_Al7075",9);
833 itsAl7075->AddElement(itsCr,0.0023);
834 itsAl7075->AddElement(itsCu,0.016);
835 itsAl7075->AddElement(itsFe,0.0025);
836 itsAl7075->AddElement(itsMg,0.025);
837 itsAl7075->AddElement(itsMn,0.00125);
838 itsAl7075->AddElement(itsSi,0.002);
839 itsAl7075->AddElement(itsTi,0.001);
840 itsAl7075->AddElement(itsZn,0.056);
841 itsAl7075->AddElement(itsAl,0.89395);
842 itsAl7075->SetTitle("Aluminum Alloy 7075");
843 itsAl7075->SetDensity(2.81*fgkgcm3);
844 itsAl7075->SetTemperature(22.0*fgkCelsius);
845 itsAl7075->SetState(TGeoMaterial::kMatStateSolid);
846 //
847 // "Ruby" spheres, Al2 O3
848 // "Ruby" Sphere posts, Ryton R-4 04
849 //Begin_Html
850 /*
851 <A HREF="">
852 Ruby Sphere Posts
853 </A>
854 */
855 //End_Html
856 TGeoMixture *itsRuby = new TGeoMixture("ITS_RubySphere",2);
857 itsRuby->AddElement(itsAl,2);
858 itsRuby->AddElement(itsO,3);
859 itsRuby->SetTitle("Ruby reference sphere");
860 itsRuby->SetDensity(2.81*fgkgcm3);
861 itsRuby->SetTemperature(22.0*fgkCelsius);
862 itsRuby->SetState(TGeoMaterial::kMatStateSolid);
863 //
864 //
865 // Inox, AISI 304L, compoistion % by weight (assumed)
866 // C Max 0.03 [0.015], Mn Max 2.00 [1.00], Si Max 1.00 [0.50]
867 // P Max 0.045 [0.0225], S Max 0.03 [0.015], Ni 8.0-10.5 [9.25]
868 // Cr 18-20 [19.], Mo 2.-2.5 [2.25], rest Fe: density 7.93 Kg/dm^3
869 //Begin_Html
870 /*
871 <A HREF="http://www.cimap.fr/caracter.pdf">
872 Stainless steal (INOX) AISI 304L composition
873 </A>
874 */
875 //End_Html
876 TGeoMixture *itsInox304L = new TGeoMixture("ITS_Inox304L",9);
877 itsInox304L->AddElement(itsC,0.00015);
878 itsInox304L->AddElement(itsMn,0.010);
879 itsInox304L->AddElement(itsSi,0.005);
880 itsInox304L->AddElement(itsP,0.000225);
881 itsInox304L->AddElement(itsS,0.00015);
882 itsInox304L->AddElement(itsNi,0.0925);
883 itsInox304L->AddElement(itsCr,0.1900);
884 itsInox304L->AddElement(itsMo,0.0225);
885 itsInox304L->AddElement(itsFe,0.679475); // Rest Fe
886 itsInox304L->SetTitle("ITS Stainless Steal (Inox) type AISI 304L");
887 itsInox304L->SetDensity(7.93*fgkKgdm3);
888 itsInox304L->SetTemperature(22.0*fgkCelsius);
889 itsInox304L->SetState(TGeoMaterial::kMatStateSolid);
890 //
891 // Inox, AISI 316L, composition % by weight (assumed)
892 // C Max 0.03 [0.015], Mn Max 2.00 [1.00], Si Max 1.00 [0.50]
893 // P Max 0.045 [0.0225], S Max 0.03 [0.015], Ni 10.0-14. [12.]
894 // Cr 16-18 [17.], Mo 2-3 [2.5]: density 7.97 Kg/dm^3
895 //Begin_Html
896 /*
897 <A HREF="http://www.cimap.fr/caracter.pdf">
898 Stainless steal (INOX) AISI 316L composition
899 </A>
900 */
901 //End_Html
902 TGeoMixture *itsInox316L = new TGeoMixture("ITS_Inox316L",9);
903 itsInox316L->AddElement(itsC,0.00015);
904 itsInox316L->AddElement(itsMn,0.010);
905 itsInox316L->AddElement(itsSi,0.005);
906 itsInox316L->AddElement(itsP,0.000225);
907 itsInox316L->AddElement(itsS,0.00015);
908 itsInox316L->AddElement(itsNi,0.12);
909 itsInox316L->AddElement(itsCr,0.17);
910 itsInox316L->AddElement(itsMo,0.025);
911 itsInox316L->AddElement(itsFe,0.66945); // Rest Fe
912 itsInox316L->SetTitle("ITS Stainless Steal (Inox) type AISI 316L");
913 itsInox316L->SetDensity(7.97*fgkKgdm3);
914 itsInox316L->SetTemperature(22.0*fgkCelsius);
915 itsInox316L->SetState(TGeoMaterial::kMatStateSolid);
916 //
917 // Inox, Phynox or Elgiloy AMS 5833, composition % by weight
918 // C Max 0.15 [0.15], Mn Max 2.00 [2.00], Be max 0.0001 [none]
919 // Ni 18. [18.], Cr 21.5 [21.5], Mo 7.5 [7.5], Co 42 [42.]:
920 // density 8.3 Kg/dm^3
921 //Begin_Html
922 /*
923 <A HREF="http://www.freepatentsonline.com/20070032816.html">
924 Compostion of Phynox or Elgiloy AMS 5833, also see
925 </A>
926 <A HREF="http://www.alloywire.com/phynox_alloy.html">
927 under corss reference number [0024].
928 </A>
929 */
930 //End_Html
931 TGeoMixture *itsPhynox = new TGeoMixture("ITS_Phynox",7);
932 itsPhynox->AddElement(itsC,0.0015);
933 itsPhynox->AddElement(itsMn,0.020);
934 itsPhynox->AddElement(itsNi,0.18);
935 itsPhynox->AddElement(itsCr,0.215);
936 itsPhynox->AddElement(itsMo,0.075);
937 itsPhynox->AddElement(itsCo,0.42);
938 itsPhynox->AddElement(itsFe,0.885);
939 itsPhynox->SetTitle("ITS Cooling tube alloy");
940 itsPhynox->SetDensity(8.3*fgkgcm3);
941 itsPhynox->SetTemperature(22.0*fgkCelsius);
942 itsPhynox->SetState(TGeoMaterial::kMatStateSolid);
943 //
944 // G10FR4
945 //
946 // Demineralized Water H2O SDD & SSD Cooling liquid
947 TGeoMixture *itsWater = new TGeoMixture("ITS_Water",2);
948 itsWater->AddElement(itsH,2);
949 itsWater->AddElement(itsO,1);
950 itsWater->SetTitle("ITS Cooling Water");
951 itsWater->SetDensity(1.0*fgkgcm3);
952 itsWater->SetTemperature(22.0*fgkCelsius);
953 itsWater->SetState(TGeoMaterial::kMatStateLiquid);
954 //
955 // Freon SPD Cooling liquid PerFluorobuthane C4F10
956 //Begin_Html
957 /*
958 <A HREF=" http://st-support-cooling-electronics.web.cern.ch/st-support-cooling-electronics/default.htm">
959 SPD 2 phase cooling using PerFluorobuthane
960 </A>
961 */
962 //End_Html
963 TGeoMixture *itsFreon = new TGeoMixture("ITS_SPD_Freon",2);
964 itsFreon->AddElement(itsC,4);
965 itsFreon->AddElement(itsF,10);
966 itsFreon->SetTitle("ITS SPD 2 phase Cooling freon");
967 itsFreon->SetDensity(1.52*fgkgcm3);
968 itsFreon->SetTemperature(22.0*fgkCelsius);
969 itsFreon->SetState(TGeoMaterial::kMatStateLiquid);
970 //
f7a1cc68 971 // Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
972 // Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
54c9a3d9 973
974 // Float_t tmaxfd = 0.1;// 1.0;// Degree
975 // Float_t stemax = 1.0;// cm
976 // Float_t deemax = 0.1;// 30.0;// Fraction of particle's energy 0<deemax<=1
977 // Float_t epsil = 1.0E-4;// 1.0; cm
978 // Float_t stmin = 0.0; // cm "Default value used"
979
980 // Float_t tmaxfdSi = 0.1; // .10000E+01; // Degree
981 // Float_t stemaxSi = 0.0075; // .10000E+01; // cm
982 // Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
983 // Float_t epsilSi = 1.0E-4;// .10000E+01;
984 /*
985 Float_t stminSi = 0.0; // cm "Default value used"
986
987 Float_t tmaxfdAir = 0.1; // .10000E+01; // Degree
988 Float_t stemaxAir = .10000E+01; // cm
989 Float_t deemaxAir = 0.1; // 0.30000E-02; // Fraction of particle's energy 0<deemax<=1
990 Float_t epsilAir = 1.0E-4;// .10000E+01;
991 Float_t stminAir = 0.0; // cm "Default value used"
992
993 Float_t tmaxfdServ = 1.0; // 10.0; // Degree
994 Float_t stemaxServ = 1.0; // 0.01; // cm
995 Float_t deemaxServ = 0.5; // 0.1; // Fraction of particle's energy 0<deemax<=1
996 Float_t epsilServ = 1.0E-3; // 0.003; // cm
997 Float_t stminServ = 0.0; //0.003; // cm "Default value used"
998
999 // Freon PerFluorobuthane C4F10 see
1000 // http://st-support-cooling-electronics.web.cern.ch/
1001 // st-support-cooling-electronics/default.htm
1002 Float_t afre[2] = { 12.011,18.9984032 };
1003 Float_t zfre[2] = { 6., 9. };
1004 Float_t wfre[2] = { 4.,10. };
1005 Float_t densfre = 1.52;
1006
1007 //CM55J
1008 Float_t aCM55J[4]={12.0107,14.0067,15.9994,1.00794};
1009 Float_t zCM55J[4]={6.,7.,8.,1.};
1010 Float_t wCM55J[4]={0.908508078,0.010387573,0.055957585,0.025146765};
1011 Float_t dCM55J = 1.63;
1012
1013 //ALCM55J
1014 Float_t aALCM55J[5]={12.0107,14.0067,15.9994,1.00794,26.981538};
1015 Float_t zALCM55J[5]={6.,7.,8.,1.,13.};
1016 Float_t wALCM55J[5]={0.817657902,0.0093488157,0.0503618265,0.0226320885,0.1};
1017 Float_t dALCM55J = 1.9866;
1018
1019 //Si Chips
1020 Float_t aSICHIP[6]={12.0107,14.0067,15.9994,1.00794,28.0855,107.8682};
1021 Float_t zSICHIP[6]={6.,7.,8.,1.,14., 47.};
1022 Float_t wSICHIP[6]={0.039730642,0.001396798,0.01169634,
1023 0.004367771,0.844665,0.09814344903};
1024 Float_t dSICHIP = 2.36436;
1025
1026 //Inox
1027 Float_t aINOX[9]={12.0107,54.9380, 28.0855,30.9738,32.066,
1028 58.6928,55.9961,95.94,55.845};
1029 Float_t zINOX[9]={6.,25.,14.,15.,16., 28.,24.,42.,26.};
1030 Float_t wINOX[9]={0.0003,0.02,0.01,0.00045,0.0003,0.12,0.17,0.025,0.654};
1031 Float_t dINOX = 8.03;
1032
1033 //SDD HV microcable
1034 Float_t aHVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
1035 Float_t zHVm[5]={6.,1.,7.,8.,13.};
1036 Float_t wHVm[5]={0.520088819984,0.01983871336,0.0551367996,0.157399667056, 0.247536};
1037 Float_t dHVm = 1.6087;
1038
1039 //SDD LV+signal cable
1040 Float_t aLVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
1041 Float_t zLVm[5]={6.,1.,7.,8.,13.};
1042 Float_t wLVm[5]={0.21722436468,0.0082859922,0.023028867,0.06574077612, 0.68572};
1043 Float_t dLVm = 2.1035;
1044
1045 //SDD hybrid microcab
1046 Float_t aHLVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
1047 Float_t zHLVm[5]={6.,1.,7.,8.,13.};
1048 Float_t wHLVm[5]={0.24281879711,0.00926228815,0.02574224025,0.07348667449, 0.64869};
1049 Float_t dHLVm = 2.0502;
1050
1051 //SDD anode microcab
1052 Float_t aALVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
1053 Float_t zALVm[5]={6.,1.,7.,8.,13.};
1054 Float_t wALVm[5]={0.392653705471,0.0128595919215,
1055 0.041626868025,0.118832707289, 0.431909};
1056 Float_t dALVm = 2.0502;
1057
1058 //X7R capacitors
1059 Float_t aX7R[7]={137.327,47.867,15.9994,58.6928,63.5460,118.710,207.2};
1060 Float_t zX7R[7]={56.,22.,8.,28.,29.,50.,82.};
1061 Float_t wX7R[7]={0.251639432,0.084755042,0.085975822,
1062 0.038244751,0.009471271,0.321736471,0.2081768};
1063 Float_t dX7R = 7.14567;
1064
1065 // AIR
1066 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1067 Float_t zAir[4]={6.,7.,8.,18.};
1068 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1069 Float_t dAir = 1.20479E-3;
1070
1071 // Water
1072 Float_t aWater[2]={1.00794,15.9994};
1073 Float_t zWater[2]={1.,8.};
1074 Float_t wWater[2]={0.111894,0.888106};
1075 Float_t dWater = 1.0;
1076
1077 // CERAMICS
1078 // 94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
1079 Float_t acer[5] = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
1080 Float_t zcer[5] = { 13., 8., 14., 25., 24. };
1081 Float_t wcer[5] = {.4443408,.5213375,.0130872,.0178135,.003421};
1082 Float_t denscer = 3.6;
1083
1084 // G10FR4
1085 Float_t zG10FR4[14] = {14.00, 20.00, 13.00, 12.00, 5.00,
1086 22.00, 11.00, 19.00, 26.00, 9.00,
1087 8.00, 6.00, 7.00, 1.00};
1088 Float_t aG10FR4[14] = {28.0855000,40.0780000,26.9815380,24.3050000,
1089 10.8110000,47.8670000,22.9897700,39.0983000,
1090 55.8450000,18.9984000,15.9994000,12.0107000,
1091 14.0067000,1.0079400};
1092 Float_t wG10FR4[14] = {0.15144894,0.08147477,0.04128158,0.00904554,
1093 0.01397570,0.00287685,0.00445114,0.00498089,
1094 0.00209828,0.00420000,0.36043788,0.27529426,
1095 0.01415852,0.03427566};
1096 Float_t densG10FR4= 1.8;
1097
1098 //--- EPOXY --- C18 H19 O3
1099 Float_t aEpoxy[3] = {15.9994, 1.00794, 12.0107} ;
1100 Float_t zEpoxy[3] = { 8., 1., 6.} ;
1101 Float_t wEpoxy[3] = { 3., 19., 18.} ;
1102 Float_t dEpoxy = 1.8 ;
1103
1104 // rohacell: C9 H13 N1 O2
1105 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1106 Float_t zrohac[4] = { 6., 1., 7., 8.};
1107 Float_t wrohac[4] = { 9., 13., 1., 2.};
1108 Float_t drohac = 0.05;
1109
1110 // If he/she means stainless steel (inox) + Aluminium and Zeff=15.3383 then
1111 // %Al=81.6164 %inox=100-%Al
1112 Float_t aInAl[5] = {27., 55.847,51.9961,58.6934,28.0855 };
1113 Float_t zInAl[5] = {13., 26.,24.,28.,14. };
1114 Float_t wInAl[5] = {.816164, .131443,.0330906,.0183836,.000919182};
1115 Float_t dInAl = 3.075;
1116
1117 // Kapton
1118 Float_t aKapton[4]={1.00794,12.0107, 14.010,15.9994};
1119 Float_t zKapton[4]={1.,6.,7.,8.};
1120 Float_t wKapton[4]={0.026362,0.69113,0.07327,0.209235};
1121 Float_t dKapton = 1.42;
1122
1123 //SDD ruby sph.
1124 Float_t aAlOxide[2] = { 26.981539,15.9994};
1125 Float_t zAlOxide[2] = { 13., 8.};
1126 Float_t wAlOxide[2] = {0.4707, 0.5293};
1127 Float_t dAlOxide = 3.97;
1128 */
1129}
1130//---------------------------------------------------------------------
166d14ba 1131void AliITSv11Geometry::DrawCrossSection(const TGeoPcon *p,
1132 Int_t fillc,Int_t fills,
1133 Int_t linec,Int_t lines,Int_t linew,
1134 Int_t markc,Int_t marks,Float_t marksize)const{
1135 // Draws a cross sectional view of the TGeoPcon, Primarily for debugging.
1136 // A TCanvas should exist first.
1137 // Inputs:
1138 // TGeoPcon *p The TGeoPcon to be "drawn"
1139 // Int_t fillc The fill color to be used
1140 // Int_t fills The fill style to be used
1141 // Int_t linec The line color to be used
1142 // Int_t lines The line style to be used
1143 // Int_t linew The line width to be used
1144 // Int_t markc The markder color to be used
1145 // Int_t marks The markder style to be used
1146 // Float_t marksize The marker size
1147 // Outputs:
1148 // none.
1149 // Return:
1150 // none.
1151 Int_t n=0,m=0,i=0;
1152 Double_t *z=0,*r=0;
1153 TPolyMarker *pts=0;
1154 TPolyLine *line=0;
172b0d90 1155
166d14ba 1156 n = p->GetNz();
1157 if(n<=0) return;
1158 m = 2*n+1;
1159 z = new Double_t[m];
1160 r = new Double_t[m];
1161
1162 for(i=0;i<n;i++){
1163 z[i] = p->GetZ(i);
1164 r[i] = p->GetRmax(i);
1165 z[i+n] = p->GetZ(n-1-i);
1166 r[i+n] = p->GetRmin(n-1-i);
1167 } // end for i
1168 z[n-1] = z[0];
1169 r[n-1] = r[0];
1170
1171 line = new TPolyLine(n,z,r);
1172 pts = new TPolyMarker(n,z,r);
1173
1174 line->SetFillColor(fillc);
1175 line->SetFillStyle(fills);
1176 line->SetLineColor(linec);
1177 line->SetLineStyle(lines);
1178 line->SetLineWidth(linew);
1179 pts->SetMarkerColor(markc);
1180 pts->SetMarkerStyle(marks);
1181 pts->SetMarkerSize(marksize);
1182
1183 line->Draw("f");
1184 line->Draw();
1185 pts->Draw();
1186
1187 delete[] z;
1188 delete[] r;
1189
1190 cout<<"Hit Return to continue"<<endl;
1191 cin >> n;
1192 delete line;
1193 delete pts;
1194 return;
1195}
db486a6e 1196//______________________________________________________________________
1197Bool_t AliITSv11Geometry::AngleOfIntersectionWithLine(Double_t x0,Double_t y0,
1198 Double_t x1,Double_t y1,
1199 Double_t xc,Double_t yc,
1200 Double_t rc,Double_t &t0,
1201 Double_t &t1)const{
1202 // Computes the angles, t0 and t1 corresponding to the intersection of
1203 // the line, defined by {x0,y0} {x1,y1}, and the circle, defined by
1204 // its center {xc,yc} and radius r. If the line does not intersect the
1205 // line, function returns kFALSE, otherwise it returns kTRUE. If the
1206 // line is tangent to the circle, the angles t0 and t1 will be the same.
1207 // Inputs:
1208 // Double_t x0 X of first point defining the line
1209 // Double_t y0 Y of first point defining the line
1210 // Double_t x1 X of Second point defining the line
1211 // Double_t y1 Y of Second point defining the line
1212 // Double_t xc X of Circle center point defining the line
1213 // Double_t yc Y of Circle center point defining the line
1214 // Double_t r radius of circle
1215 // Outputs:
1216 // Double_t &t0 First angle where line intersects circle
1217 // Double_t &t1 Second angle where line intersects circle
1218 // Return:
1219 // kTRUE, line intersects circle, kFALSE line does not intersect circle
1220 // or the line is not properly defined point {x0,y0} and {x1,y1}
1221 // are the same point.
1222 Double_t dx,dy,cx,cy,s2,t[4];
1223 Double_t a0,b0,c0,a1,b1,c1,sinthp,sinthm,costhp,costhm;
1224 Int_t i,j;
1225
1226 t0 = 400.0;
1227 t1 = 400.0;
1228 dx = x1-x0;
1229 dy = y1-y0;
1230 cx = xc-x0;
1231 cy = yc-y0;
1232 s2 = dx*dx+dy*dy;
1233 if(s2==0.0) return kFALSE;
1234
1235 a0 = rc*rc*s2;
1236 if(a0==0.0) return kFALSE;
1237 b0 = 2.0*rc*dx*(dx*cy-cx*dy);
1238 c0 = dx*dx*cy*cy-2.0*dy*dx*cy*cx+cx*cx*dy*dy-rc*rc*dy*dy;
1239 c0 = 0.25*b0*b0/(a0*a0)-c0/a0;
1240 if(c0<0.0) return kFALSE;
1241 sinthp = -0.5*b0/a0+TMath::Sqrt(c0);
1242 sinthm = -0.5*b0/a0-TMath::Sqrt(c0);
1243
1244 a1 = rc*rc*s2;
1245 if(a1==0.0) return kFALSE;
1246 b1 = 2.0*rc*dy*(dy*cx-dx*cy);
1247 c1 = dy*dy*cx*cx-2.0*dy*dx*cy*cx+dx*dx*cy*cy-rc*rc*dx*dx;
1248 c1 = 0.25*b1*b1/(a1*a1)-c1/a1;
1249 if(c1<0.0) return kFALSE;
1250 costhp = -0.5*b1/a1+TMath::Sqrt(c1);
1251 costhm = -0.5*b1/a1-TMath::Sqrt(c1);
1252
1253 t[0] = t[1] = t[2] = t[3] = 400.;
1254 a0 = TMath::ATan2(sinthp,costhp); if(a0<0.0) a0 += 2.0*TMath::Pi();
1255 a1 = TMath::ATan2(sinthp,costhm); if(a1<0.0) a1 += 2.0*TMath::Pi();
1256 b0 = TMath::ATan2(sinthm,costhp); if(b0<0.0) b0 += 2.0*TMath::Pi();
1257 b1 = TMath::ATan2(sinthm,costhm); if(b1<0.0) b1 += 2.0*TMath::Pi();
1258 x1 = xc+rc*TMath::Cos(a0);
1259 y1 = yc+rc*TMath::Sin(a0);
1260 s2 = dx*(y1-y0)-dy*(x1-x0);
1261 if(s2*s2<DBL_EPSILON) t[0] = a0*TMath::RadToDeg();
1262 x1 = xc+rc*TMath::Cos(a1);
1263 y1 = yc+rc*TMath::Sin(a1);
1264 s2 = dx*(y1-y0)-dy*(x1-x0);
1265 if(s2*s2<DBL_EPSILON) t[1] = a1*TMath::RadToDeg();
1266 x1 = xc+rc*TMath::Cos(b0);
1267 y1 = yc+rc*TMath::Sin(b0);
1268 s2 = dx*(y1-y0)-dy*(x1-x0);
1269 if(s2*s2<DBL_EPSILON) t[2] = b0*TMath::RadToDeg();
1270 x1 = xc+rc*TMath::Cos(b1);
1271 y1 = yc+rc*TMath::Sin(b1);
1272 s2 = dx*(y1-y0)-dy*(x1-x0);
1273 if(s2*s2<DBL_EPSILON) t[3] = b1*TMath::RadToDeg();
1274 for(i=0;i<4;i++)for(j=i+1;j<4;j++){
1275 if(t[i]>t[j]) {t0 = t[i];t[i] = t[j];t[j] = t0;}
1276 } // end for i,j
1277 t0 = t[0];
1278 t1 = t[1];
1279 //
1280 return kTRUE;
1281}
1282//______________________________________________________________________
1283Double_t AliITSv11Geometry::AngleForRoundedCorners0(Double_t dx,Double_t dy,
1284 Double_t sdr)const{
1285 // Basic function used to determine the ending angle and starting angles
1286 // for rounded corners given the relative distance between the centers
1287 // of the circles and the difference/sum of their radii. Case 0.
1288 // Inputs:
1289 // Double_t dx difference in x locations of the circle centers
1290 // Double_t dy difference in y locations of the circle centers
1291 // Double_t sdr difference or sum of the circle radii
1292 // Outputs:
1293 // none.
1294 // Return:
1295 // the angle in Degrees
1296 Double_t a,b;
1297
1298 b = dy*dy+dx*dx-sdr*sdr;
1299 if(b<0.0) Error("AngleForRoundedCorners0",
1300 "dx^2(%e)+dy^2(%e)-sdr^2(%e)=b=%e<0",dx,dy,sdr,b);
1301 b = TMath::Sqrt(b);
1302 a = -sdr*dy+dx*b;
1303 b = -sdr*dx-dy*b;
1304 return TMath::ATan2(a,b)*TMath::RadToDeg();
1305
1306}
1307//______________________________________________________________________
1308Double_t AliITSv11Geometry::AngleForRoundedCorners1(Double_t dx,Double_t dy,
1309 Double_t sdr)const{
1310 // Basic function used to determine the ending angle and starting angles
1311 // for rounded corners given the relative distance between the centers
1312 // of the circles and the difference/sum of their radii. Case 1.
1313 // Inputs:
1314 // Double_t dx difference in x locations of the circle centers
1315 // Double_t dy difference in y locations of the circle centers
1316 // Double_t sdr difference or sum of the circle radii
1317 // Outputs:
1318 // none.
1319 // Return:
1320 // the angle in Degrees
1321 Double_t a,b;
1322
1323 b = dy*dy+dx*dx-sdr*sdr;
1324 if(b<0.0) Error("AngleForRoundedCorners1",
1325 "dx^2(%e)+dy^2(%e)-sdr^2(%e)=b=%e<0",dx,dy,sdr,b);
1326 b = TMath::Sqrt(b);
1327 a = -sdr*dy-dx*b;
1328 b = -sdr*dx+dy*b;
1329 return TMath::ATan2(a,b)*TMath::RadToDeg();
1330
1331}
166d14ba 1332//----------------------------------------------------------------------
db486a6e 1333void AliITSv11Geometry::AnglesForRoundedCorners(Double_t x0,Double_t y0,
1334 Double_t r0,Double_t x1,
1335 Double_t y1,Double_t r1,
1336 Double_t &t0,Double_t &t1)
1337 const{
1338 // Function to compute the ending angle, for arc 0, and starting angle,
1339 // for arc 1, such that a straight line will connect them with no
1340 // discontinuities.
1341 //Begin_Html
1342 /*
1343 <img src="picts/ITS/AliITSv11Geometry_AnglesForRoundedCorners.gif">
1344 */
1345 //End_Html
1346 // Inputs:
1347 // Double_t x0 X Coordinate of arc 0 center.
1348 // Double_t y0 Y Coordinate of arc 0 center.
1349 // Double_t r0 Radius of curvature of arc 0. For signe see figure.
1350 // Double_t x1 X Coordinate of arc 1 center.
1351 // Double_t y1 Y Coordinate of arc 1 center.
1352 // Double_t r1 Radius of curvature of arc 1. For signe see figure.
1353 // Outputs:
1354 // Double_t t0 Ending angle of arch 0, with respect to x axis, Degrees.
1355 // Double_t t1 Starting angle of arch 1, with respect to x axis,
1356 // Degrees.
1357 // Return:
1358 // none.
1359 Double_t t;
1360
1361 if(r0>=0.0&&r1>=0.0) { // Inside to inside ++
1362 t = AngleForRoundedCorners1(x1-x0,y1-y0,r1-r0);
1363 t0 = t1 = t;
1364 return;
1365 }else if(r0>=0.0&&r1<=0.0){ // Inside to Outside +-
1366 r1 = -r1; // make positive
1367 t = AngleForRoundedCorners0(x1-x0,y1-y0,r1+r0);
1368 t0 = 180.0 + t;
1369 if(t0<0.0) t += 360.;
1370 if(t<0.0) t += 360.;
1371 t1 = t;
1372 return;
1373 }else if(r0<=0.0&&r1>=0.0){ // Outside to Inside -+
1374 r0 = - r0; // make positive
1375 t = AngleForRoundedCorners1(x1-x0,y1-y0,r1+r0);
1376 t0 = 180.0 + t;
1377 if(t0>180.) t0 -= 360.;
1378 if(t >180.) t -= 360.;
1379 t1 = t;
1380 return;
1381 }else if(r0<=0.0&&r1<=0.0) { // Outside to outside --
1382 r0 = -r0; // make positive
1383 r1 = -r1; // make positive
1384 t = AngleForRoundedCorners0(x1-x0,y1-y0,r1-r0);
1385 t0 = t1 = t;
1386 return;
1387 } // end if
1388 return;
1389}
1390//----------------------------------------------------------------------
1391void AliITSv11Geometry::MakeFigure1(Double_t x0,Double_t y0,Double_t r0,
1392 Double_t x1,Double_t y1,Double_t r1){
1393 // Function to create the figure discribing how the function
1394 // AnglesForRoundedCorners works.
1395 //
1396 // Inputs:
1397 // Double_t x0 X Coordinate of arc 0 center.
1398 // Double_t y0 Y Coordinate of arc 0 center.
1399 // Double_t r0 Radius of curvature of arc 0. For signe see figure.
1400 // Double_t x1 X Coordinate of arc 1 center.
1401 // Double_t y1 Y Coordinate of arc 1 center.
1402 // Double_t r1 Radius of curvature of arc 1. For signe see figure.
1403 // Outputs:
1404 // none.
1405 // Return:
1406 // none.
1407 Double_t t0[4],t1[4],xa0[4],ya0[4],xa1[4],ya1[4],ra0[4],ra1[4];
1408 Double_t xmin,ymin,xmax,ymax,h;
1409 Int_t j;
1410
1411 for(j=0;j<4;j++) {
1412 ra0[j] = r0; if(j%2) ra0[j] = -r0;
1413 ra1[j] = r1; if(j>1) ra1[j] = -r1;
1414 AnglesForRoundedCorners(x0,y0,ra0[j],x1,y1,ra1[j],t0[j],t1[j]);
1415 xa0[j] = TMath::Abs(r0)*CosD(t0[j])+x0;
1416 ya0[j] = TMath::Abs(r0)*SinD(t0[j])+y0;
1417 xa1[j] = TMath::Abs(r1)*CosD(t1[j])+x1;
1418 ya1[j] = TMath::Abs(r1)*SinD(t1[j])+y1;
1419 } // end for j
1420 if(r0<0.0) r0 = -r0;
1421 if(r1<0.0) r1 = -r1;
1422 xmin = TMath::Min(x0 - r0,x1-r1);
1423 ymin = TMath::Min(y0 - r0,y1-r1);
1424 xmax = TMath::Max(x0 + r0,x1+r1);
1425 ymax = TMath::Max(y0 + r0,y1+r1);
1426 for(j=1;j<4;j++) {
1427 xmin = TMath::Min(xmin,xa0[j]);
1428 xmin = TMath::Min(xmin,xa1[j]);
1429 ymin = TMath::Min(ymin,ya0[j]);
1430 ymin = TMath::Min(ymin,ya1[j]);
1431
1432 xmax = TMath::Max(xmax,xa0[j]);
1433 xmax = TMath::Max(xmax,xa1[j]);
1434 ymax = TMath::Max(ymax,ya0[j]);
1435 ymax = TMath::Max(ymax,ya1[j]);
1436 } // end for j
1437 if(xmin<0.0) xmin *= 1.1; else xmin *= 0.9;
1438 if(ymin<0.0) ymin *= 1.1; else ymin *= 0.9;
1439 if(xmax<0.0) xmax *= 0.9; else xmax *= 1.1;
1440 if(ymax<0.0) ymax *= 0.9; else ymax *= 1.1;
1441 j = (Int_t)(500.0*(ymax-ymin)/(xmax-xmin));
1442 TCanvas *can = new TCanvas("AliITSv11Geometry_AnglesForRoundedCorners",
1443 "Figure for AliITSv11Geometry",500,j);
1444 h = ymax-ymin; if(h<0) h = -h;
1445 can->Range(xmin,ymin,xmax,ymax);
1446 TArc *c0 = new TArc(x0,y0,r0);
1447 TArc *c1 = new TArc(x1,y1,r1);
1448 TLine *line[4];
1449 TArrow *ar0[4];
1450 TArrow *ar1[4];
1451 for(j=0;j<4;j++){
1452 ar0[j] = new TArrow(x0,y0,xa0[j],ya0[j]);
1453 ar1[j] = new TArrow(x1,y1,xa1[j],ya1[j]);
1454 line[j] = new TLine(xa0[j],ya0[j],xa1[j],ya1[j]);
1455 ar0[j]->SetLineColor(j+1);
1456 ar0[j]->SetArrowSize(0.1*r0/h);
1457 ar1[j]->SetLineColor(j+1);
1458 ar1[j]->SetArrowSize(0.1*r1/h);
1459 line[j]->SetLineColor(j+1);
1460 } // end for j
1461 c0->Draw();
1462 c1->Draw();
1463 for(j=0;j<4;j++){
1464 ar0[j]->Draw();
1465 ar1[j]->Draw();
1466 line[j]->Draw();
1467 } // end for j
1468 TText *t = new TText();
1469 t->SetTextSize(0.02);
1470 Char_t txt[100];
1471 sprintf(txt,"(x0=%5.2f,y0=%5.2f)",x0,y0);
1472 t->DrawText(x0,y0,txt);
1473 sprintf(txt,"(x1=%5.2f,y1=%5.2f)",x1,y1);
1474 for(j=0;j<4;j++) {
1475 t->SetTextColor(j+1);
1476 t->DrawText(x1,y1,txt);
1477 sprintf(txt,"r0=%5.2f",ra0[j]);
1478 t->DrawText(0.5*(x0+xa0[j]),0.5*(y0+ya0[j]),txt);
1479 sprintf(txt,"r1=%5.2f",ra1[j]);
1480 t->DrawText(0.5*(x1+xa1[j]),0.5*(y1+ya1[j]),txt);
1481 } // end for j
1482}