]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSGeometry.h
Updating limits to cope both with p-A and A-p ZDC timing
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGeometry.h
1 #ifndef ALIPHOSGEOMETRY_H
2 #define ALIPHOSGEOMETRY_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //_________________________________________________________________________
9 // Geometry class  for PHOS : singleton
10 // PHOS consists of the electromagnetic calorimeter (EMCA)
11 // and a charged particle veto either in the Subatech's version (PPSD)
12 // or in the IHEP's one (CPV).
13 // The EMCA/PPSD/CPV modules are parametrized so that any configuration
14 // can be easily implemented 
15 // The title is used to identify the version of CPV used.
16 // 
17 //*-- Author: Yves Schutz (SUBATECH)
18
19 // --- ROOT system ---
20
21 // --- AliRoot header files ---
22
23 #include "AliPHOSGeoUtils.h"
24 #include "AliPHOSEMCAGeometry.h"
25 #include "AliPHOSCPVGeometry.h"
26 #include "AliPHOSSupportGeometry.h"
27 #include <TMatrixFfwd.h>
28
29 class AliRecPoint ;
30 class AliPHOSRecPoint;
31 class TVector3;
32
33 class AliPHOSGeometry : public AliPHOSGeoUtils {
34
35 public: 
36
37   AliPHOSGeometry() ;
38   AliPHOSGeometry(const AliPHOSGeometry & geom) ;
39   
40   virtual ~AliPHOSGeometry(void) ; 
41   static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title="") ; 
42   static AliPHOSGeometry * GetInstance() ; 
43
44   virtual void   GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrixF & /* gmat */) const 
45                  {GetGlobal(RecPoint,gpos); }
46   virtual void   GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) const ;
47   virtual void   GetGlobalPHOS(const AliPHOSRecPoint* RecPoint, TVector3 & gpos) const ;
48   virtual void   GetGlobalPHOS(const AliPHOSRecPoint* RecPoint, TVector3 & gpos, TMatrixF & /* gmat */) const 
49                  {GetGlobalPHOS(RecPoint,gpos); }
50
51   AliPHOSGeometry & operator = (const AliPHOSGeometry  & /*rvalue*/) {
52     Fatal("operator =", "not implemented") ;
53     return *this ;    
54   }
55  
56
57   Bool_t IsInitialized(void)                  const { return fgInit ; }  
58                                                                        
59   // Return general PHOS parameters
60   Int_t    GetNModules(void)                    const { return fNModules ; }
61   Float_t  GetPHOSAngle(Int_t index)            const { return fPHOSAngle[index-1] ; }
62   Float_t* GetPHOSParams(void)                        { return fPHOSParams;}  //Half-sizes of PHOS trapecoid
63   Float_t  GetIPtoUpperCPVsurface(void)         const { return fIPtoUpperCPVsurface ; }
64   Float_t  GetOuterBoxSize(Int_t index)         const { return 2.*fPHOSParams[index]; }
65   Float_t  GetCrystalSize(Int_t index)          const { return fGeometryEMCA->GetCrystalSize(index) ;  }
66   Float_t  GetCellStep(void)                    const { return 2.*fGeometryEMCA->GetAirCellHalfSize()[0];}
67
68   Float_t GetModuleCenter(Int_t module, Int_t axis) const {
69     return fModuleCenter[module][axis];}
70   Float_t GetModuleAngle(Int_t module, Int_t axis, Int_t angle) const {
71     return fModuleAngle[module][axis][angle];}
72   
73
74   // Return ideal EMCA geometry parameters
75
76   AliPHOSEMCAGeometry * GetEMCAGeometry()      const {return fGeometryEMCA ;}
77   Float_t   GetIPtoCrystalSurface(void)        const { return fGeometryEMCA->GetIPtoCrystalSurface() ; }
78   Float_t   GetIPtoOuterCoverDistance(void)    const { return fGeometryEMCA->GetIPtoOuterCoverDistance() ; }
79   Int_t     GetNPhi(void)                      const { return fGeometryEMCA->GetNPhi() ; }
80   Int_t     GetNZ(void)                        const { return fGeometryEMCA->GetNZ() ; }
81   Int_t     GetNCristalsInModule(void)         const { return fGeometryEMCA->GetNPhi() * fGeometryEMCA->GetNZ() ; }
82
83   // Return ideal CPV geometry parameters
84   Int_t   GetNumberOfCPVLayers(void)           const { return fGeometryCPV ->GetNumberOfCPVLayers();      }
85   Float_t GetCPVActiveSize(Int_t index)        const { return fGeometryCPV->GetCPVActiveSize(index);      }
86   Int_t   GetNumberOfCPVChipsPhi(void)         const { return fGeometryCPV->GetNumberOfCPVChipsPhi();     }
87   Int_t   GetNumberOfCPVChipsZ(void)           const { return fGeometryCPV->GetNumberOfCPVChipsZ();       }
88   Int_t   GetNumberOfCPVPadsPhi(void)          const { return fGeometryCPV->GetNumberOfCPVPadsPhi();      }
89   Int_t   GetNumberOfCPVPadsZ(void)            const { return fGeometryCPV->GetNumberOfCPVPadsZ();        }
90   Float_t GetPadSizePhi(void)                  const { return fGeometryCPV->GetCPVPadSizePhi();           }
91   Float_t GetPadSizeZ(void)                    const { return fGeometryCPV->GetCPVPadSizeZ();             }
92   Float_t GetGassiplexChipSize(Int_t index)    const { return fGeometryCPV->GetGassiplexChipSize(index);  }
93   Float_t GetCPVGasThickness(void)             const { return fGeometryCPV->GetCPVGasThickness();         }
94   Float_t GetCPVTextoliteThickness(void)       const { return fGeometryCPV->GetCPVTextoliteThickness();   }
95   Float_t GetCPVCuNiFoilThickness(void)        const { return fGeometryCPV->GetCPVCuNiFoilThickness();    }
96   Float_t GetFTPosition(Int_t index)           const { return fGeometryCPV->GetFTPosition(index);         }
97   Float_t GetCPVFrameSize(Int_t index)         const { return fGeometryCPV->GetCPVFrameSize(index);       }
98   Float_t GetCPVBoxSize(Int_t index)           const { return fGeometryCPV ->GetCPVBoxSize(index);        } 
99   Float_t GetIPtoCPVDistance(void)             const { return  GetIPtoOuterCoverDistance() - 
100                                                                GetCPVBoxSize(1) - 1.0; }
101
102
103   // Return real CPV geometry parameters
104   void GetModuleCenter(TVector3& center, const char *det, Int_t module) const;
105
106   // Return PHOS' support geometry parameters
107
108   Float_t GetRailOuterSize(Int_t index)  const { return fGeometrySUPP->GetRailOuterSize(index); }
109   Float_t GetRailPart1    (Int_t index)  const { return fGeometrySUPP->GetRailPart1    (index); }
110   Float_t GetRailPart2    (Int_t index)  const { return fGeometrySUPP->GetRailPart2    (index); }
111   Float_t GetRailPart3    (Int_t index)  const { return fGeometrySUPP->GetRailPart3    (index); }
112   Float_t GetRailPos      (Int_t index)  const { return fGeometrySUPP->GetRailPos      (index); }
113   Float_t GetRailLength   (void)         const { return fGeometrySUPP->GetRailLength   ();      }
114   Float_t GetDistanceBetwRails(void)     const { return fGeometrySUPP->GetDistanceBetwRails();  }
115   Float_t GetRailsDistanceFromIP(void)   const { return fGeometrySUPP->GetRailsDistanceFromIP();}
116   Float_t GetRailRoadSize (Int_t index)  const { return fGeometrySUPP->GetRailRoadSize (index); }
117   Float_t GetCradleWallThickness(void)   const { return fGeometrySUPP->GetCradleWallThickness();}
118   Float_t GetCradleWall   (Int_t index)  const { return fGeometrySUPP->GetCradleWall   (index); }
119   Float_t GetCradleWheel  (Int_t index)  const { return fGeometrySUPP->GetCradleWheel  (index); }
120   void Init(void) ;            // steering method for PHOS and PPSD/CPV
121
122
123 protected:
124
125   AliPHOSGeometry(const Text_t* name, const Text_t* title="") ;
126 private:
127   void                     SetPHOSAngles();  // calculates the PHOS modules PHI angle
128
129
130   Float_t                  fAngle ;          // Position angles between modules
131   Float_t                 *fPHOSAngle ;      //[fNModules] Position angles of modules
132   Float_t                  fPHOSParams[4] ;  // Half-sizes of PHOS trapecoid
133   Float_t                  fIPtoUpperCPVsurface; // Minimal distance from IP to PHOS
134   Float_t                  fCrystalShift ;   //Distance from crystal center to front surface
135   Float_t                  fCryCellShift ;   //Distance from crystal center to front surface
136   TObjArray               *fRotMatrixArray ; // Liste of rotation matrices (one per phos module)
137   Float_t fModuleCenter[5][3];   // xyz-position of the module center
138   Float_t fModuleAngle[5][3][2]; // polar and azymuth angles for 3 axes of modules
139
140
141   static AliPHOSGeometry * fgGeom ; // pointer to the unique instance of the singleton 
142   static Bool_t fgInit ;            // Tells if geometry has been succesfully set up 
143
144   ClassDef(AliPHOSGeometry,3)       // PHOS geometry class 
145
146 } ;
147
148 #endif // AliPHOSGEOMETRY_H