New organization of v11 geometry
[u/mrichter/AliRoot.git] / ITS / AliITSv11Geometry.h
1 #ifndef ALIITSV11GEOMETRY_H
2 #define ALIITSV11GEOMETRY_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /*
7   $Id$
8  */
9 #include <TObject.h>
10 class TGeoArb8;
11 class TGeoPcon;
12 class TGeoTube;
13 class TGeoTubeSeg;
14 class TGeoConeSeg;
15 class TGeoBBox;
16
17 class AliITSv11Geometry : public TObject {
18   public:
19     AliITSv11Geometry(){fDebug=kTRUE;};
20     AliITSv11Geometry(Bool_t debug){fDebug=debug;};
21     virtual ~AliITSv11Geometry(){};
22     //
23     void SetDebug(){fDebug=kTRUE;}
24     void SetNoDebug(){fDebug=kFALSE;}
25     static Double_t RmaxFrom2Points(TGeoPcon *p,Int_t i1,Int_t i2,Double_t z);
26     static Double_t RminFrom2Points(TGeoPcon *p,Int_t i1,Int_t i2,Double_t z);
27     static Double_t RFrom2Points(Double_t *p,Double_t *Z,Int_t i1,Int_t i2,
28                                  Double_t z);
29     static Double_t Zfrom2MinPoints(TGeoPcon *p,Int_t i1,Int_t i2,Double_t r);
30     static Double_t Zfrom2MaxPoints(TGeoPcon *p,Int_t i1,Int_t i2,Double_t r);
31     static Double_t Zfrom2Points(Double_t *Z,Double_t *p,Int_t i1,Int_t i2,
32                                  Double_t r);
33     static Double_t RmaxFromZpCone(TGeoPcon *p,int ip,Double_t tc,Double_t z,
34                                    Double_t th=0.0);
35     static Double_t RmaxFromZpCone(TGeoPcon *p,Double_t tc,Double_t z,
36                                    Double_t th=0.0){
37         return RmaxFromZpCone(p,4,tc,z,th);};
38     static Double_t RFromZpCone(Double_t *Rmax,Double_t *Z,int ip,Double_t tc,
39                                 Double_t z,Double_t th=0.0);
40     static Double_t RmaxFromZpCone(Double_t *Rmax,Double_t *Z,Double_t tc,
41                                    Double_t z,Double_t th=0.0){
42         return RFromZpCone(Rmax,Z,4,tc,z,th);};
43     static Double_t RminFromZpCone(TGeoPcon *p,Int_t ip,Double_t tc,Double_t z,
44                                    Double_t th=0.0);
45     static Double_t RminFromZpCone(TGeoPcon *p,Double_t tc,Double_t z,
46                                    Double_t th=0.0){
47         return RminFromZpCone(p,3,tc,z,th);};
48     static Double_t RminFromZpCone(Double_t *Rmin,Double_t *Z,Double_t tc,
49                                    Double_t z,Double_t th=0.0){
50         return RFromZpCone(Rmin,Z,3,tc,z,th);};
51     static Double_t ZFromRmaxpCone(TGeoPcon *p,int ip,Double_t tc,Double_t r,
52                                    Double_t th=0.0);
53     static Double_t ZFromRmaxpCone(TGeoPcon *p,Double_t tc,Double_t r,
54                                    Double_t th=0.0)
55         {return ZFromRmaxpCone(p,4,tc,r,th);};
56     static Double_t ZFromRmaxpCone(Double_t *GetRmax,Double_t *GetZ,Int_t ip,
57                                    Double_t tc,Double_t r,Double_t th=0.0);
58     static Double_t ZFromRmaxpCone(Double_t *GetRmax,Double_t *GetZ,
59                                    Double_t tc,Double_t r,Double_t th=0.0){
60         return ZFromRmaxpCone(GetRmax,GetZ,4,tc,r,th);};
61     static Double_t ZFromRminpCone(TGeoPcon *p,int ip,Double_t tc,Double_t r,
62                                    Double_t th=0.0);
63     static Double_t ZFromRminpCone(TGeoPcon *p,Double_t tc,Double_t r,
64                                    Double_t th=0.0)
65         {return ZFromRminpCone(p,3,tc,r,th);};
66     static void InsidePoint(TGeoPcon *p,Int_t i1,Int_t i2,Int_t i3,
67                             Double_t Cthick,TGeoPcon *q,Int_t j1,Bool_t max);
68     static void InsidePoint(Double_t x0,Double_t y0,Double_t x1,Double_t y1,
69                             Double_t x2,Double_t y2,Double_t c,
70                             Double_t &x,Double_t &y);
71     static void RadiusOfCurvature(Double_t rc,Double_t theta0,Double_t z0,
72                                   Double_t r0,Double_t theta1,Double_t &z1,
73                                   Double_t &r1);
74     void printArb8(TGeoArb8 *A);
75     void printPcon(TGeoPcon *A);
76     void printTube(TGeoTube *A);
77     void printTubeSeg(TGeoTubeSeg *A);
78     void printConeSeg(TGeoConeSeg *A);
79     void printBBox(TGeoBBox *A);
80     Bool_t GetDebug(){return fDebug;}
81
82   private:
83     Bool_t fDebug; //! Debug flag
84     ClassDef(AliITSv11Geometry,1) // Base class for ITS v11 geometry
85 };
86
87
88 // Units, Convert from k?? to cm,degree,GeV,seconds,
89 const Double_t kmm = 0.10; // Convert mm to TGeom's cm.
90 const Double_t kcm = 1.00; // Convert cv to TGeom's cm.
91 const Double_t kDegree = 1.0; // Convert degrees to TGeom's degrees
92 const Double_t kRadian = TMath::DegToRad(); // conver to Radians
93
94 #endif