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