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