]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALEMCGeometry.h
Fixing a warning
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALEMCGeometry.h
1 #ifndef ALIEMCALEMCGEOMETRY_H
2 #define ALIEMCALEMCGEOMETRY_H
3 /* Copyright(c) 1998-2004, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id: AliEMCALEMCGeometry.h 26174 2008-05-26 20:27:16Z jklay $ */
7
8 //_________________________________________________________________________
9 // Geometry class  for EMCAL : singleton
10 // EMCAL consists of a layers of scintillator, and lead.
11 //                  
12 //*-- Author: Sahal Yacoob (LBL / UCT)
13 //*--   and : Yves Schutz (Subatech)
14 //*--   and : Aleksei Pavlinov (WSU) - shashlyk staff
15 //*--   and : Gustavo Conesa: Add TRU mapping. TRU parameters still not fixed.
16 //*--   and : Magali Estienne (Subatech): class added for new library for EMCALGeoUtils.par file
17
18 // --- ROOT system ---
19 #include <TMath.h>
20 #include <TArrayD.h>
21 #include <TNamed.h>
22 class TString ;
23 class TObjArray;
24 class Riostream;
25
26 // --- AliRoot header files ---
27 class AliEMCALEMCGeometry;
28 class AliEMCALShishKebabTrd1Module;
29
30 class AliEMCALEMCGeometry : public TNamed {
31 public:
32   AliEMCALEMCGeometry(); // default ctor only for internal usage (singleton)
33   AliEMCALEMCGeometry(const AliEMCALEMCGeometry& geom);
34   // ctor only for internal usage (singleton)
35   AliEMCALEMCGeometry(const Text_t* name, const Text_t* title);
36
37   virtual ~AliEMCALEMCGeometry(void); 
38
39   AliEMCALEMCGeometry & operator = (const AliEMCALEMCGeometry  & /*rvalue*/) {
40     // assignement operator requested by coding convention but not needed
41     Fatal("operator =", "not implemented");
42     return *this;
43   };
44
45   //////////
46   // General
47   //
48   Bool_t IsInitialized(void) const { return fgInit ; }
49   static const Char_t* GetDefaultGeometryName() {return fgkDefaultGeometryName;}
50   void   PrintGeometry();                                            //*MENU*  
51   
52   void   Init(void);                            // initializes the parameters of EMCAL
53   void   CheckAdditionalOptions();        //
54   void   DefineSamplingFraction();        // Jun 5, 2006
55
56   //////////////////////////////////////
57   // Return EMCAL geometrical parameters
58   //
59   
60   TString GetGeoName() const {return fGeoName;}
61   const Char_t* GetNameOfEMCALEnvelope() const { const Char_t* env = "XEN1"; return env ;}
62   Float_t GetArm1PhiMin() const { return fArm1PhiMin ; }
63   Float_t GetArm1PhiMax() const { return fArm1PhiMax ; }
64   Float_t GetArm1EtaMin() const { return fArm1EtaMin;}
65   Float_t GetArm1EtaMax() const { return fArm1EtaMax;}
66   Float_t GetIPDistance() const { return fIPDistance;}   
67   Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; }  
68   Float_t GetShellThickness() const { return fShellThickness ; }
69   Float_t GetZLength() const { return fZLength ; } 
70   Int_t   GetNECLayers() const {return fNECLayers ;}
71   Int_t   GetNZ() const {return fNZ ;}
72   Int_t   GetNEta() const {return fNZ ;}
73   Int_t   GetNPhi() const {return fNPhi ;}
74   Float_t GetECPbRadThick()const {return fECPbRadThickness;}
75   Float_t GetECScintThick() const {return fECScintThick;}
76   Float_t GetSampling() const {return fSampling ; } 
77   Int_t   GetNumberOfSuperModules() const {return fNumberOfSuperModules;}
78   Float_t GetfPhiGapForSuperModules() const {return fPhiGapForSM;}
79   Float_t GetPhiModuleSize() const  {return fPhiModuleSize;}
80   Float_t GetEtaModuleSize() const  {return fEtaModuleSize;}
81   Float_t GetFrontSteelStrip() const {return fFrontSteelStrip;}
82   Float_t GetLateralSteelStrip() const {return fLateralSteelStrip;}
83   Float_t GetPassiveScintThick() const {return fPassiveScintThick;}
84   Float_t GetPhiTileSize() const {return fPhiTileSize;}
85   Float_t GetEtaTileSize() const {return fEtaTileSize;}
86   Int_t   GetNPhiSuperModule() const {return fNPhiSuperModule;}
87   Int_t   GetNPHIdiv() const {return fNPHIdiv ;}
88   Int_t   GetNETAdiv() const {return fNETAdiv ;}
89   Int_t   GetNCells()  const {return fNCells;}
90   Float_t GetLongModuleSize() const {return fLongModuleSize;}
91   Float_t GetTrd1Angle() const {return fTrd1Angle;}
92   Float_t Get2Trd1Dx2()  const {return f2Trd1Dx2;}
93   Float_t GetEtaMaxOfTRD1() const {return fEtaMaxOfTRD1;}
94   // --
95   Int_t   GetNCellsInSupMod() const {return fNCellsInSupMod;}
96   Int_t   GetNCellsInModule()  const {return fNCellsInModule; }
97   Int_t   GetKey110DEG()      const {return fKey110DEG;}
98   Int_t   GetILOSS() const {return fILOSS;}
99   Int_t   GetIHADR() const {return fIHADR;}
100     // For gamma(Jet) trigger simulations
101   Int_t    GetNTRU() const    {return fNTRUEta*fNTRUPhi ; }  
102   Int_t    GetNTRUEta() const {return fNTRUEta ; }  
103   Int_t    GetNTRUPhi() const {return fNTRUPhi ; }
104   Int_t    GetNEtaSubOfTRU() const {return fNEtaSubOfTRU;}
105   Int_t    GetNModulesInTRU() const {return fNModulesInTRUEta*fNModulesInTRUPhi; }
106   Int_t    GetNModulesInTRUEta() const {return fNModulesInTRUEta ; }  
107   Int_t    GetNModulesInTRUPhi() const {return fNModulesInTRUPhi ; }  
108
109   // --
110   Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/ ((Float_t)fNZ);}
111   Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/ ((Float_t)fNPhi);}
112   Int_t   GetNTowers() const {return fNPhi * fNZ ;}
113   //
114   Double_t GetPhiCenterOfSM(Int_t nsupmod) const;
115   Float_t *GetSuperModulesPars() {return fParSM;}
116   //
117   Bool_t   GetPhiBoundariesOfSM   (Int_t nSupMod, Double_t &phiMin, Double_t &phiMax) const;
118   Bool_t   GetPhiBoundariesOfSMGap(Int_t nPhiSec, Double_t &phiMin, Double_t &phiMax) const;
119   //
120   // Local Coordinates of SM
121 /*   TArrayD  GetCentersOfCellsEtaDir() const {return fCentersOfCellsEtaDir;}        // size fNEta*fNETAdiv (for TRD1 only) (eta or z in SM, in cm) */
122 /*   TArrayD  GetCentersOfCellsXDir()   const {return fCentersOfCellsXDir;}          // size fNEta*fNETAdiv (for TRD1 only) (       x in SM, in cm) */
123 /*   TArrayD  GetCentersOfCellsPhiDir() const {return fCentersOfCellsPhiDir;}        // size fNPhi*fNPHIdiv (for TRD1 only) (phi or y in SM, in cm) */
124 /*   // */
125 /*   TArrayD  GetEtaCentersOfCells() const {return fEtaCentersOfCells;}           // [fNEta*fNETAdiv*fNPhi*fNPHIdiv], positive direction (eta>0); eta depend from phi position;  */
126 /*   TArrayD  GetPhiCentersOfCells() const {return fPhiCentersOfCells;}           // [fNPhi*fNPHIdiv] from center of SM (-10. < phi < +10.) */
127
128         static int ParseString(const TString &topt, TObjArray &Opt) ; 
129
130   ///////////////////////////////
131   //Geometry data member setters
132   //
133   void SetNZ(Int_t nz) { fNZ= nz; 
134                          printf("SetNZ: Number of modules in Z set to %d", fNZ) ; }
135   void SetNPhi(Int_t nphi) { fNPhi= nphi; 
136                              printf("SetNPhi: Number of modules in Phi set to %d", fNPhi) ; }
137   void SetNTRUEta(Int_t ntru) {fNTRUEta = ntru;
138                printf("SetNTRU: Number of TRUs per SuperModule in Etaset to %d", fNTRUEta) ;}
139   void SetNTRUPhi(Int_t ntru) {fNTRUPhi = ntru;
140               printf("SetNTRU: Number of TRUs per SuperModule in Phi set to %d", fNTRUPhi) ;}
141   void SetSampling(Float_t samp) { fSampling = samp; 
142                               printf("SetSampling: Sampling factor set to %f", fSampling) ; }
143
144   ///////////////////
145   // useful utilities
146   //
147   Float_t AngleFromEta(Float_t eta) const { // returns theta in radians for a given pseudorapidity
148     return 2.0*TMath::ATan(TMath::Exp(-eta));
149   }
150   Float_t ZFromEtaR(Float_t r,Float_t eta) const { // returns z in for a given
151     // pseudorapidity and r=sqrt(x*x+y*y).
152     return r/TMath::Tan(AngleFromEta(eta));
153   }
154
155   //////////////////////////////////////////////////
156   // Obsolete methods to be thrown out when feasible
157   Float_t GetAlFrontThickness() const { return fAlFrontThick;}
158   Float_t GetGap2Active() const {return  fGap2Active ;}
159   Float_t GetSteelFrontThickness() const { return fSteelFrontThick;}
160   Float_t GetTrd2AngleY()const {return fTrd2AngleY;}
161   Float_t Get2Trd2Dy2()  const {return f2Trd2Dy2;}
162   Float_t GetTubsR()     const {return fTubsR;}
163   Float_t GetTubsTurnAngle() const {return fTubsTurnAngle;}
164   Float_t GetIP2ECASection() const { return ( GetIPDistance() + GetAlFrontThickness() 
165                                               + GetGap2Active() ) ; }   
166   //////////////////////////////////////////////////
167
168   static Bool_t  fgInit;                // Tells if geometry has been succesfully set up.
169   static const Char_t* fgkDefaultGeometryName; // Default name of geometry
170
171 private:
172
173   // Member data
174
175   TString fGeoName;                     //geometry name
176
177   TObjArray *fArrayOpts;                //! array of geometry options
178   const char *fkAdditionalOpts[6];  //! some additional options for the geometry type and name
179   int  fNAdditionalOpts;     //! size of additional options parameter
180
181   Float_t fECPbRadThickness;            // cm, Thickness of the Pb radiators
182   Float_t fECScintThick;                // cm, Thickness of the scintillators
183   Int_t   fNECLayers;                   // number of scintillator layers
184   
185   Float_t fArm1PhiMin;                  // Minimum angular position of EMCAL in Phi (degrees)
186   Float_t fArm1PhiMax;                  // Maximum angular position of EMCAL in Phi (degrees)
187   Float_t fArm1EtaMin;                  // Minimum pseudorapidity position of EMCAL in Eta
188   Float_t fArm1EtaMax;                  // Maximum pseudorapidity position of EMCAL in Eta
189   
190   // Geometry Parameters
191   Float_t fEnvelop[3];                  // the GEANT TUB for the detector 
192   Float_t fIPDistance;                  // Radial Distance of the inner surface of the EMCAL
193   Float_t fShellThickness;              // Total thickness in (x,y) direction
194   Float_t fZLength;                     // Total length in z direction
195   Int_t   fNZ;                          // Number of Towers in the Z direction
196   Int_t   fNPhi;                        // Number of Towers in the PHI direction
197   Float_t fSampling;                    // Sampling factor
198
199   // Shish-kebab option - 23-aug-04 by PAI; COMPACT, TWIST, TRD1 and TRD2
200   Int_t   fNumberOfSuperModules;         // default is 12 = 6 * 2 
201   Float_t fFrontSteelStrip;              // 13-may-05
202   Float_t fLateralSteelStrip;            // 13-may-05
203   Float_t fPassiveScintThick;            // 13-may-05
204   Float_t fPhiModuleSize;                // Phi -> X 
205   Float_t fEtaModuleSize;                // Eta -> Y
206   Float_t fPhiTileSize;                  // Size of phi tile
207   Float_t fEtaTileSize;                  // Size of eta tile
208   Float_t fLongModuleSize;               // Size of long module
209   Int_t   fNPhiSuperModule;              // 6 - number supermodule in phi direction
210   Int_t   fNPHIdiv;                      // number phi divizion of module
211   Int_t   fNETAdiv;                      // number eta divizion of module
212   //
213   Int_t   fNCells;                       // number of cells in calo
214   Int_t   fNCellsInSupMod;               // number cell in super module
215   Int_t   fNCellsInModule;               // number cell in module)
216   //TRU parameters
217   Int_t   fNTRUEta ;                     // Number of TRUs per module in eta
218   Int_t   fNTRUPhi ;                     // Number of TRUs per module in phi
219   Int_t   fNModulesInTRUEta;             // Number of modules per TRU in eta 
220   Int_t   fNModulesInTRUPhi;             // Number of modules per TRU in phi 
221   Int_t   fNEtaSubOfTRU;                 // Number of eta (z) subregiohi
222
223   // TRD1 options - 30-sep-04
224   Float_t fTrd1Angle;                    // angle in x-z plane (in degree) 
225   Float_t f2Trd1Dx2;                     // 2*dx2 for TRD1
226   Float_t fPhiGapForSM;                  // Gap betweeen supermodules in phi direction
227   Int_t   fKey110DEG;                    // for calculation abs cell id; 19-oct-05 
228   TArrayD fPhiBoundariesOfSM;            // phi boundaries of SM in rad; size is fNumberOfSuperModules;
229   TArrayD fPhiCentersOfSM;                // phi of centers of SMl size is fNumberOfSuperModules/2
230   Float_t fEtaMaxOfTRD1;                 // max eta in case of TRD1 geometry (see AliEMCALShishKebabTrd1Module)
231   // Local Coordinates of SM
232   TArrayD fCentersOfCellsEtaDir;        // size fNEta*fNETAdiv (for TRD1 only) (eta or z in SM, in cm)
233   TArrayD fCentersOfCellsXDir;          // size fNEta*fNETAdiv (for TRD1 only) (       x in SM, in cm)
234   TArrayD fCentersOfCellsPhiDir;        // size fNPhi*fNPHIdiv (for TRD1 only) (phi or y in SM, in cm)
235   //
236   TArrayD fEtaCentersOfCells;           // [fNEta*fNETAdiv*fNPhi*fNPHIdiv], positive direction (eta>0); eta depend from phi position; 
237   TArrayD fPhiCentersOfCells;           // [fNPhi*fNPHIdiv] from center of SM (-10. < phi < +10.)
238   // Move from AliEMCALv0 - Feb 19, 2006
239   TList   *fShishKebabTrd1Modules; //! list of modules
240   // Local coordinates of SM for TRD1
241   Float_t fParSM[3];       // SM sizes as in GEANT (TRD1)
242
243   Int_t   fILOSS; // Options for Geant (MIP business) - will call in AliEMCAL
244   Int_t   fIHADR; // Options for Geant (MIP business) - will call in AliEMCAL
245
246   ////////////////////////////////////////////////////////////
247   //Obsolete member data that will be thrown out when feasible
248   //
249   Float_t fAlFrontThick;                // Thickness of the front Al face of the support box  
250   Float_t fGap2Active;                  // Gap between the envelop and the active material
251   Float_t fSteelFrontThick;              // Thickness of the front stell face of the support box - 9-sep-04
252   // TRD2 options - 27-jan-07
253   Float_t fTrd2AngleY;                   // angle in y-z plane (in degree) 
254   Float_t f2Trd2Dy2;                     // 2*dy2 for TRD2
255   Float_t fEmptySpace;                   // 2mm om fred drawing
256   // Super module as TUBS
257   Float_t fTubsR;                        // radius of tubs 
258   Float_t fTubsTurnAngle;                // turn angle of tubs in degree
259
260   ///////////////////////////////////////////////////////////
261
262   ClassDef(AliEMCALEMCGeometry, 1) // EMCAL geometry class 
263 };
264
265 #endif // AliEMCALEMCGEOMETRY_H