]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSv11.h
Work continuing.
[u/mrichter/AliRoot.git] / ITS / AliITSv11.h
1 #ifndef ALIITSV11_H
2 #define ALIITSV11_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
10 /////////////////////////////////////////////////////////////////////////
11 //  Manager and hits classes for set: ITS version 11, 2003 geometry    //
12 /////////////////////////////////////////////////////////////////////////
13  
14 #include "AliITS.h"
15  
16 class AliITSv11 : public AliITS {
17
18  public:
19     AliITSv11();
20     AliITSv11(const char *title);
21     AliITSv11(const AliITSv11 &source); // copy constructor
22     AliITSv11& operator=(const AliITSv11 &source); // assignment operator
23     virtual       ~AliITSv11() ;
24     virtual void   BuildGeometry();
25     virtual void   CreateGeometry();
26     virtual void   CreateMaterials();
27     virtual Int_t  IsVersion() const {// returns the ITS version number 
28                                       return 11;} 
29     virtual void   Init(); 
30     virtual void   SetDefaults();
31     virtual void   DrawModule();
32     virtual void   StepManager();
33     virtual void   SetWriteDet(Bool_t det=kTRUE){ // set .det write
34                                                  fGeomDetOut = det;}
35     virtual void   SetWriteDet(const char *f){ // set write file
36                                      strncpy(fWrite,f,60);fGeomDetOut = kTRUE;}
37     virtual void   SetReadDet(Bool_t det=kTRUE){ //set .det read
38                                                 fGeomDetIn = det;}
39     virtual void   SetReadDet(const char *f){ // set read file
40                                        strncpy(fRead,f,60);fGeomDetIn = kTRUE;}
41     virtual void   SetEUCLID(Bool_t euclid=kTRUE){ // set write Euclid file
42                                                   fEuclidOut = euclid;}
43     virtual void   SetEUCLIDFileName(const char *f){ // set write file
44                              fEuclidGeometry=f;fEuclidOut = kTRUE;}
45     virtual void   SetMinorVersion(Int_t v=22){ // Choose between existing minor versions
46         fMinorVersion = v;}
47     virtual void   SetThicknessDet1(Float_t v=200.){ 
48          // Set detector thickness in layer 1
49          fDet1 = v;}
50     virtual void   SetThicknessDet2(Float_t v=200.){ 
51          // Set detector thickness in layer 2
52          fDet2 = v;}
53     virtual void   SetThicknessChip1(Float_t v=300.){ 
54          // Set chip thickness in layer 1
55          fChip1 = v;}            
56     virtual void   SetThicknessChip2(Float_t v=200.){ 
57          // Set chip thickness in layer 2
58          fChip2 = v;}
59     virtual void   SetRails(Int_t v=1){ 
60          // Set flag for rails
61          fRails = v;}    
62     virtual void   SetCoolingFluid(Int_t v=1){ 
63          // Set flag for cooling fluid
64          fFluid = v;}            
65     virtual Bool_t GetEUCLID(){return fEuclidOut;}// returns value Euclid flag.
66     virtual const char  *GetEULIIDFileName() const{ // return .euc file name
67                                        return fEuclidGeometry.Data();}
68     virtual Bool_t GetWriteDet() { // returns value GeomDetOut flag.
69                                   return fGeomDetOut;}
70     virtual Bool_t GetReadDet() { // returns value GeomDetIn flag.
71                                  return fGeomDetIn;}
72     virtual char  *GetReadDetFileName(){ // return .det read file name
73                   if(fRead[0]!='\0') return fRead; else return fEuclidGeomDet;}
74     virtual char  *GetWriteDetFileName(){ // return .det write file name
75                 if(fWrite[0]!='\0') return fWrite; else return fEuclidGeomDet;}
76     virtual Int_t GetMajorVersion(){// return Major Version Number
77         return fMajorVersion;}
78     virtual Int_t GetMinorVersion(){// return Major Version Number
79         return fMinorVersion;}
80     virtual Float_t GetThicknessDet1(){ 
81          // Get detector thickness in layer 1
82          return fDet1;}
83     virtual Float_t GetThicknessDet2(){ 
84          // Get detector thickness in layer 2
85          return fDet2;}
86     virtual Float_t GetThicknessChip1(){ 
87          // Get chip thickness in layer 1
88          return fChip1;}                 
89     virtual Float_t GetThicknessChip2(){ 
90          // Get chip thickness in layer 2
91          return fChip2;}
92     virtual Int_t GetRails(){ 
93          // Get flag for rails
94          return fRails;}         
95     virtual Int_t GetCoolingFluid(){ 
96          // Get flag for cooling fluid
97          return fFluid;}                         
98                  
99  private:
100     void InitAliITSgeom();
101     void SetScalecm(){// Sets scale factor for centemeters
102     fScale = 1.0;}
103     void SetScalemm(){// Sets scale factor for milimeters
104     fScale = 0.10;}
105     void SetScalemicrons(){// Sets scale factor for micronsmeters
106     fScale = 1.0E-04;}
107     void SetScale(Double_t s=1.0){// Sets scale factor
108     fScale = s;}
109     Double_t GetScale(){// Returns the scale factor
110     return fScale;}
111     Bool_t IsScalecm(){// Returens kTRUE if scale factor is set of [cm]
112         if(fScale==1.0) return kTRUE; return kFALSE;}
113     // Create a Box
114     void Box(const char gnam[3],const TString &dis,
115              Double_t dx,Double_t dy,Double_t dz,Int_t med);
116     // Greate A Trapizoid with the x dimension varing along z.
117     void Trapezoid1(const char gnam[3],const TString &dis,Double_t dxn,
118                     Double_t dxp,Double_t dy,Double_t dz,Int_t med);
119     // Greate A Trapizoid with the x and y dimension varing along z.
120     void Trapezoid2(const char gnam[3],const TString &dis,Double_t dxn,
121                     Double_t dxp,Double_t dyn,Double_t dyp,Double_t dz,
122                     Int_t med);
123     // General trapazoid.
124     void Trapezoid(const char gnam[3],const TString &dis,Double_t dz,
125                    Double_t thet,Double_t phi,Double_t h1,Double_t bl1,
126                    Double_t tl1,Double_t alp1,Double_t h2,Double_t bl2,
127                    Double_t tl2,Double_t alp2,Int_t med);
128     // Simple Tube.
129     void Tube(const char gnam[3],const TString &dis,Double_t rmin,
130               Double_t rmax,Double_t dz,Int_t med);
131     // Tube segment.
132     void TubeSegment(const char gnam[3],const TString &dis,Double_t rmin,
133                      Double_t rmax,Double_t dz,Double_t phi1,Double_t phi2,
134                      Int_t med);
135     // Simple Cone.
136     void Cone(const char gnam[3],const TString &dis,Double_t dz,Double_t rmin1,
137               Double_t rmax1,Double_t rmin2,Double_t rmax2,Int_t med);
138     // Segment of a Cone.
139     void ConeSegment(const char gnam[3],const TString &dis,Double_t dz,
140                      Double_t rmin1,Double_t rmax1,Double_t rmin2,
141                      Double_t rmax2,Double_t phi1,Double_t phi2,Int_t med);
142     // Spherical shell segment.
143     void Sphere(const char gnam[3],const TString &dis,Double_t rmin,
144                 Double_t rmax,Double_t the1,Double_t the2,Double_t phi1,
145                 Double_t phi2,Int_t med);
146     // Parallelepiped.
147     void Parallelepiped(const char gnam[3],const TString &dis,Double_t dx,
148                         Double_t dy,Double_t dz,Double_t alph,Double_t thet,
149                         Double_t phi,Int_t med);
150     // Polygon.
151     void Polygon(const char gnam[3],const TString &dis,Double_t phi1,
152                  Double_t dphi,Int_t npdv,Int_t nz,Double_t *z,Double_t *rmin,
153                  Double_t *rmax,Int_t med);
154     //Poly-Cone
155     void PolyCone(const char gnam[3],const TString &dis,Double_t phi1,
156                   Double_t dphi,Int_t nz,Double_t *z,Double_t *rmin,
157                   Double_t *rmax,Int_t med);
158     // Ellliptical cross-sectino tube
159     void TubeElliptical(const char gnam[3],const TString &dis,Double_t p1,
160                         Double_t p2,Double_t dz,Int_t med);
161     // Hyperbolic tube
162     void TubeElliptical(const char gnam[3],const TString &dis,Double_t p1,
163                         Double_t p2,Double_t dz,Int_t med);
164     // Twisted genral trapezoid.
165     void TwistedTrapezoid(const char gnam[3],const TString &dis,Double_t dz,
166                           Double_t thet,Double_t phi,Double_t twist,
167                           Double_t h1,Double_t bl1,Double_t tl1,
168                           Double_t apl1,Double_t h2,Double_t bl2,
169                           Double_t tl2,Double_t apl2,Int_t med);
170     // Cut tube.
171     void CutTube(const char gnam[3],const TString &dis,Double_t rmin,
172                  Double_t rmax,Double_t dz,Double_t phi1,Double_t phi2,
173                  Double_t lx,Double_t ly,Double_t lz,Double_t hx,Double_t hy,
174                  Double_t hz,Int_t med);
175     // Position one volume inside another
176     void Pos(const char vol[3],Int_t cn,const char moth[3],Double_t x,
177              Double_t y,Double_t z,Int_t irot);
178     void SetMedArray(){// Sets up the array of media
179         fidmed = fIdtmed->GetArray()-199;}
180     // Define rotation matrix
181     void Matrix(Int_t irot,Double_t thet1,Double_t phi1,Double_t thet2,
182                 Double_t phi2,Double_t thet3,Double_t phi3);
183     // Defube ritatuib matrix
184     void Matrix(Int_t irot,Double_t rot[3][3]);
185     // Rotation matrix about axis i (i=0=>x, i=1=>y, i=2=>z).
186     void Matrix(Int_t irot,Int_t axis,Double_t thet);
187     // Rotation matrix about x axis
188     void XMatrix(Int_t irot,Double_t thet){
189         Matrix(irot,0,thet);}
190     // Rotation matrix about y axis
191     void YMatrix(Int_t irot,Double_t thet){
192         Matrix(irot,1,thet);}
193     // Rotation matrix about z axis
194     void ZMatrix(Int_t irot,Double_t thet){
195         Matrix(irot,2,thet);}
196     // Define Element material and medium
197     void Element(Int_t imat,const char *name,Int_t z,Double_t dens,Int_t istd);
198     // Define Material by constituant weights
199     void MixtureByWeight(Int_t imat,const char *name,Int_t *z,Doule_t *w,
200                          Double_t dens,Int_t nelments,Int_t istd);
201     // Define Material by constituant relative number
202     void MixtureByNumber(Int_t imat,const char *name,Int_t *z,Imt_t *i,
203                          Double_t dens,Int_t nelments,Int_t istd);
204     // Returns standard radiation lenghts of elements.
205     Float_t GetRadLength(Int_t z);
206     // Returns natrual abundance atomic mass numbers for a given element
207     Float_t GetA(Int_t z);
208     // Returns ITS standard Theata Max transport cut values
209     Float_t GetStandardThetaMax(Int_t istd);
210     // Returns ITS standard Theata Max transport cut values
211     Float_t GetStandardMaxStepSize(Int_t istd);
212     // Returns ITS standard Theata Max transport cut values
213     Float_t GetStandardEfraction(Int_t istd);
214     // Returns ITS standard Theata Max transport cut values
215     Float_t GetStandardEpsilon(Int_t istd);
216     // Degree Versions of TMath functions (as needed)
217     Double_t Sind(Double_t t){return TMath::Sin(TMath::Pi()*t/180.);}
218     Double_t Cosd(Double_t t){return TMath::Cos(TMath::Pi()*t/180.);}
219     Double_t Tand(Double_t t){return TMath::Tan(TMath::Pi()*t/180.);}
220     Double_t ASind(Double_t t){return 180.0*TMath::ASin(t)/TMath::Pi();}
221     Double_t ACosd(Double_t t){return 180.0*TMath::ACos(t)/TMath::Pi();}
222     Double_t ATand(Double_t t){return 180.0*TMath::ATan(t)/TMath::Pi();}
223     Double_t ATand2(Double_t y,Double_t x){return 180.0*TMath::ATan2(y,x)/TMath::Pi();}
224
225     // TString fEuclidGeomtery,fEuclidMaterial defined in AliModule.
226     Bool_t fEuclidOut;        // Flag to write geometry in euclid format
227     Bool_t fGeomDetOut;       // Flag to write .det file out
228     Bool_t fGeomDetIn;        // Flag to read .det file or directly from Geat.
229     Int_t  fMajorVersion;     // Major version number == IsVersion
230     Int_t  fMinorVersion;     // Minor version number
231     char   fEuclidGeomDet[60];// file where detector transormation are define.
232     char   fRead[60];         //! file name to read .det file
233     char   fWrite[60];        //! file name to write .det file
234     Float_t  fDet1;           // thickness of detector in SPD layer 1
235     Float_t  fDet2;           // thickness of detector in SPD layer 2
236     Float_t  fChip1;          // thickness of chip in SPD layer 1   
237     Float_t  fChip2;          // thickness of chip in SPD layer 2   
238     Int_t    fRails;          // flag to switch rails on (=1) and off (=0)
239     Int_t    fFluid;          // flag to switch between water (=1) and freon (=0)
240     Int_t fIDMother;          //! ITS Mother Volume id.
241     //
242     Int_t *fidmed;            //! array of media indexes.
243     Int_t *fidrot;            //! array of rotation matrixies indexes.
244     Double_t fScale;          //! scale factor (=1=>[cm])
245
246     ClassDef(AliITSv11,1)  //Hits manager for set:ITS version 11 
247                                  // PPR detailed Geometry asymmetric
248 };
249  
250 #endif