]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALGeometry.h
1st draft for pass0
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALGeometry.h
index b78f8ae35676c120dbad57ff8654ac2b2e5a9490..1ca41f6bbc3ec2dc2a7ec87e9f09a1f7b23a5c10 100644 (file)
 #ifndef ALIEMCALGEOMETRY_H
 #define ALIEMCALGEOMETRY_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+/* Copyright(c) 1998-2004, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 /* $Id$ */
 
 //_________________________________________________________________________
 // Geometry class  for EMCAL : singleton
-// EMCAL consists of a shell of Pb
+// EMCAL consists of a layers of scintillator, and lead.
 //                  
-//*-- Author: Yves Schutz (SUBATECH)
-
-#include <assert.h> 
+//*-- Author: Sahal Yacoob (LBL / UCT)
+//*--   and : Yves Schutz (Subatech)
+//*--   and : Alexei Pavlinov (WSU) - shashlyk staff
+//*--   and : Gustavo Conesa: Add TRU mapping. TRU parameters still not fixed.
 
 // --- ROOT system ---
-
-class TObjArray ;  
-class TVector3; 
-class TMatrix ; 
+#include <Riostream.h>
+#include <TMath.h>
+#include <TArrayD.h>
+#include <TMatrixF.h>
+class TVector3;
 
 // --- AliRoot header files ---
+#include "AliEMCALGeoUtils.h"
+#include "AliEMCALEMCGeometry.h"
+//class AliRecPoint;
+//class AliEMCALRecPoint;
 
-#include "AliGeometry.h"
-
+class AliEMCALGeometry : public AliEMCALGeoUtils {
 
-class AliEMCALGeometry : public AliGeometry {
+public:
 
-public: 
+  AliEMCALGeometry(); // default ctor only for internal usage (singleton)
+  AliEMCALGeometry(const AliEMCALGeometry& geom);
+  virtual ~AliEMCALGeometry(void); 
 
-  AliEMCALGeometry() {
-    // default ctor 
-    // must be kept public for root persistency purposes, but should never be called by the outside world
-  } ;  
+  static AliEMCALGeometry * GetInstance(const Text_t* name,
+                                       const Text_t* title="") ; 
+  static AliEMCALGeometry * GetInstance();
+  AliEMCALGeometry & operator = (const AliEMCALGeometry  & /*rvalue*/) {
+    // assignement operator requested by coding convention but not needed
+    Fatal("operator =", "not implemented");
+    return *this;
+  };
 
-  AliEMCALGeometry(const AliEMCALGeometry & geom) {
-    // cpy ctor requested by Coding Convention but not yet needed
-    assert(0==1) ;
-  } 
-  
-  virtual ~AliEMCALGeometry(void) ; 
-  static AliEMCALGeometry * GetInstance(const Text_t* name, const Text_t* title="") ; 
-  static AliEMCALGeometry * GetInstance() ; 
 
-  AliEMCALGeometry & operator = (const AliEMCALGeometry  & rvalue) const {
-    // assignement operator requested by coding convention but not needed
-    assert(0==1) ;
-    return *(GetInstance()) ; 
-  }
-  virtual void GetGlobal(const AliRecPoint *, TVector3 &, TMatrix &) const {}
-  virtual void GetGlobal(const AliRecPoint *, TVector3 &) const {}
+  //////////
   // General
-
-  Bool_t  IsInitialized(void) const { return fgInit ; }  
-                                                                       
-  // Return EMCA geometrical parameters
-
-  // geometry
-  const Float_t GetAirGap() const { return fAirGap ; }
-  const Float_t GetArm1PhiMin() const { return fArm1PhiMin ; }
-  const Float_t GetArm1PhiMax() const { return fArm1PhiMax ; }
-  const Float_t GetArm2PhiMin() const { return fArm2PhiMin ; }
-  const Float_t GetArm2PhiMax() const { return fArm2PhiMax ; }
-  const Float_t GetIPDistance()   const { return  fIPDistance  ; } 
-  const Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; }  
-  const Float_t GetShellThickness() const { return fShellThickness ; }
-  const Float_t GetZLength() const { return fZLength ; } 
-  const Float_t GetGap2Active() const {return  fGap2Active ; }
-  // material 
-  const Float_t GetAmat()   const { return  fAmat ; }  
-  const Float_t GetZmat()   const { return  fZmat ; }   
-  const Float_t GetDmat()   const { return  fDmat ; }  
-  const Float_t GetRmat()   const { return  fRmat ; }  
-  const Float_t GetEmat()   const { return  fEmat ; }  
-  const Float_t GetLmat()   const { return  fEmat * fRmat ; }  
+  //
+  Bool_t  IsInitialized(void) const { return AliEMCALEMCGeometry::fgInit ; }
+  static const Char_t* GetDefaultGeometryName() {return AliEMCALEMCGeometry::fgkDefaultGeometryName;}
+
+  //////////////////////////
+  // Global geometry methods
+  //
+  using AliEMCALGeoUtils::GetGlobal;
+
+//  virtual void GetGlobal(const AliRecPoint *rp, TVector3 & gpos, TMatrixF & /* gmat */) 
+//    const {GetGlobal(rp,gpos); }
+//  virtual void GetGlobalEMCAL(const AliEMCALRecPoint *rp, TVector3 &vglob) const;
+//  virtual void GetGlobalEMCAL(const AliEMCALRecPoint *rp, TVector3 & gpos, TMatrixF & /* gmat */) 
+//    const {GetGlobalEMCAL(rp,gpos); }
+
+  // Return EMC geometry parameters
+  AliEMCALEMCGeometry * GetEMCGeometry()      const {return fEMCGeometry ;}
+
+  //////////////////////////////////////
+  // Return EMCAL geometrical parameters
+  //
+  const Char_t*  GetNameOfEMCALEnvelope(void) const {return fEMCGeometry->GetNameOfEMCALEnvelope();}
+  Float_t  GetArm1PhiMin(void) const { return fEMCGeometry->GetArm1PhiMin(); }
+  Float_t  GetArm1PhiMax(void) const { return fEMCGeometry->GetArm1PhiMax(); }
+  Float_t  GetArm1EtaMin(void) const { return fEMCGeometry->GetArm1EtaMin();}
+  Float_t  GetArm1EtaMax(void) const { return fEMCGeometry->GetArm1EtaMax();}
+  Float_t  GetIPDistance(void) const { return fEMCGeometry->GetIPDistance();}   
+  Float_t  GetEnvelop(Int_t index) const { return fEMCGeometry->GetEnvelop(index); }  
+  Float_t  GetShellThickness(void) const { return fEMCGeometry->GetShellThickness(); }
+  Float_t  GetZLength(void) const { return fEMCGeometry->GetZLength(); } 
+  Int_t    GetNECLayers(void) const {return fEMCGeometry->GetNECLayers();}
+  Int_t    GetNZ(void) const {return fEMCGeometry->GetNZ();}
+  Int_t    GetNEta(void) const {return fEMCGeometry->GetNEta();}
+  Int_t    GetNPhi(void) const {return fEMCGeometry->GetNPhi();}
+  Float_t  GetECPbRadThick(void)const {return fEMCGeometry->GetECPbRadThick();}
+  Float_t  GetECScintThick(void) const {return fEMCGeometry->GetECScintThick();}
+  Float_t  GetSampling(void) const {return fEMCGeometry->GetSampling(); } 
+  Int_t    GetNumberOfSuperModules(void) const {return fEMCGeometry->GetNumberOfSuperModules();}
+  Float_t  GetfPhiGapForSuperModules(void) const {return fEMCGeometry->GetfPhiGapForSuperModules();}
+  Float_t  GetPhiModuleSize(void) const  {return fEMCGeometry->GetPhiModuleSize();}
+  Float_t  GetEtaModuleSize(void) const  {return fEMCGeometry->GetEtaModuleSize();}
+  Float_t  GetFrontSteelStrip(void) const {return fEMCGeometry->GetFrontSteelStrip();}
+  Float_t  GetLateralSteelStrip(void) const {return fEMCGeometry->GetLateralSteelStrip();}
+  Float_t  GetPassiveScintThick(void) const {return fEMCGeometry->GetPassiveScintThick();}
+  Float_t  GetPhiTileSize(void) const {return fEMCGeometry->GetPhiTileSize();}
+  Float_t  GetEtaTileSize(void) const {return fEMCGeometry->GetEtaTileSize();}
+  Int_t    GetNPhiSuperModule(void) const {return fEMCGeometry->GetNPhiSuperModule();}
+  Int_t    GetNPHIdiv(void) const {return fEMCGeometry->GetNPHIdiv();}
+  Int_t    GetNETAdiv(void) const {return fEMCGeometry->GetNETAdiv();}
+  Int_t    GetNCells(void)  const {return fEMCGeometry->GetNCells();}
+  Float_t  GetLongModuleSize(void) const {return fEMCGeometry->GetLongModuleSize();}
+  Float_t  GetTrd1Angle(void) const {return fEMCGeometry->GetTrd1Angle();}
+  Float_t  Get2Trd1Dx2(void)  const {return fEMCGeometry->Get2Trd1Dx2();}
+  Float_t  GetTrd1AlFrontThick() const {return fEMCGeometry->GetTrd1AlFrontThick();}
+  Float_t  GetTrd1BondPaperThick() const {return fEMCGeometry->GetTrd1BondPaperThick();}
+   // --
+  Int_t    GetNCellsInSupMod(void) const {return fEMCGeometry->GetNCellsInSupMod();}
+  Int_t    GetNCellsInModule(void)  const {return fEMCGeometry->GetNCellsInModule(); }
+  Int_t    GetKey110DEG(void)      const {return fEMCGeometry->GetKey110DEG();}
+  Int_t    GetILOSS(void) const {return fEMCGeometry->GetILOSS();}
+  Int_t    GetIHADR(void) const {return fEMCGeometry->GetIHADR();}
+  // For gamma(Jet) trigger simulations
+  Int_t    GetNTRU() const    {return fEMCGeometry->GetNTRU(); }  
+  Int_t    GetNTRUEta() const {return fEMCGeometry->GetNTRUEta(); }  
+  Int_t    GetNTRUPhi() const {return fEMCGeometry->GetNTRUPhi(); }
+  Int_t    GetNEtaSubOfTRU() const {return fEMCGeometry->GetNEtaSubOfTRU();}
+  Int_t    GetNModulesInTRU() const {return fEMCGeometry->GetNModulesInTRU(); }
+  Int_t    GetNModulesInTRUEta() const {return fEMCGeometry->GetNModulesInTRUEta(); }  
+  Int_t    GetNModulesInTRUPhi() const {return fEMCGeometry->GetNModulesInTRUPhi(); }  
+
+  // --
+  Float_t  GetDeltaEta(void) const {return fEMCGeometry->GetDeltaEta();}
+  Float_t  GetDeltaPhi(void) const {return fEMCGeometry->GetDeltaPhi();}
+  Int_t    GetNTowers(void) const {return fEMCGeometry->GetNTowers();}
+  //
+  Double_t GetPhiCenterOfSM(Int_t nsupmod) const {return fEMCGeometry->GetPhiCenterOfSM(nsupmod);}
+  Float_t  GetSuperModulesPar(Int_t ipar) const {return fEMCGeometry->GetSuperModulesPar(ipar);}
+  //
+  Bool_t   GetPhiBoundariesOfSM(Int_t nSupMod, Double_t &phiMin, Double_t &phiMax) const {return fEMCGeometry->GetPhiBoundariesOfSM(nSupMod, phiMin, phiMax);}
+  Bool_t   GetPhiBoundariesOfSMGap(Int_t nPhiSec, Double_t &phiMin, Double_t &phiMax) const {return fEMCGeometry->GetPhiBoundariesOfSMGap(nPhiSec, phiMin, phiMax);}
+  //
+  
+  //  Methods for AliEMCALRecPoint with taking into account energy of rec.point - Jul 30. 2007
+  using AliEMCALGeoUtils::RelPosCellInSModule;
+  Bool_t   RelPosCellInSModule(Int_t absId,Double_t distEff,Double_t &xr,Double_t &yr,
+                                                          Double_t & zr) const;
+       
+  //Not in use, comment for the moment
+  //Bool_t   RelPosCellInSModule(Int_t absId,Int_t maxAbsId,Double_t distEff,Double_t &xr,
+  //                  Double_t &yr,Double_t &zr) const;
+
+  ///////////////////////////////
+  //Geometry data member setters
+  //
+  void SetNZ(Int_t nz) { fEMCGeometry->SetNZ(nz);}
+  void SetNPhi(Int_t nphi) { fEMCGeometry->SetNPhi(nphi);}
+
+  void SetNTRUEta(Int_t ntru) { fEMCGeometry->SetNTRUEta(ntru);}
+  void SetNTRUPhi(Int_t ntru) { fEMCGeometry->SetNTRUPhi(ntru);}
+  void SetSampling(Float_t samp) { fEMCGeometry->SetSampling(samp);}
+
+  void PrintGeometry() {fEMCGeometry->PrintGeometry();}  //*MENU*  
+
+  //////////////////////////////////////////////////
+  // Obsolete methods to be thrown out when feasible
+  Float_t GetGap2Active(void) const {return  fEMCGeometry->GetGap2Active();}
+  Float_t GetSteelFrontThickness(void) const { return fEMCGeometry->GetSteelFrontThickness();}
+  Float_t GetTrd2AngleY(void) const {return fEMCGeometry->GetTrd2AngleY();}
+  Float_t Get2Trd2Dy2(void)  const {return fEMCGeometry->Get2Trd2Dy2();}
+  Float_t GetTubsR(void)     const {return fEMCGeometry->GetTubsR();}
+  Float_t GetTubsTurnAngle(void) const {return fEMCGeometry->GetTubsTurnAngle();}
+  //Float_t GetAlFrontThickness(void) const { return fEMCGeometry->GetAlFrontThickness();}
+  //  Float_t GetIP2ECASection(void) const { return fEMCGeometry->GetIP2ECASection(); }   
+  //////////////////////////////////////////////////
 
 protected:
 
-  AliEMCALGeometry(const Text_t* name, const Text_t* title="") : AliGeometry(name, title) { 
-    // ctor only for internal usage (singleton)
-    Init() ; 
-  }
-  void Init(void) ;            // initializes the parameters of EMCAL 
+  // ctor only for internal usage (singleton)
+  AliEMCALGeometry(const Text_t* name, const Text_t* title);
 
+  void Init(void);                             // initializes the parameters of EMCAL
+  
 private:
 
-  static AliEMCALGeometry * fgGeom ; // pointer to the unique instance of the singleton 
-  static Bool_t fgInit ;             // Tells if geometry has been succesfully set up 
-
-  // geometry
-  Float_t fAirGap ;                  // Distance between envelop and active material 
-  Float_t fArm1PhiMin ;              // Minimum phi angle covered by Arm 1 
-  Float_t fArm1PhiMax ;              // Maximum phi angle covered by Arm 1       
-  Float_t fArm2PhiMin ;              // Minimum phi angle covered by Arm 2        
-  Float_t fArm2PhiMax ;              // Maximum phi angle covered by Arm 2
-  // It is assumed that Arm1 and Arm2 have the same following parameters
-  Float_t fEnvelop[3] ;              // the GEANT TUB that contains the 2 arms
-  Float_t fIPDistance ;              // Distance of the inner surface to the interaction point
-  Float_t fShellThickness ;          // Total thickness in (x,y) direction
-  Float_t fZLength ;                 // Total length in z direction
-  Float_t fGap2Active ;              // Gap between the envelop and the active material
-
-  //material
-  Float_t fAmat ;  // average atomic weight of the active material
-  Float_t fZmat ;  // average atomic number of the active material 
-  Float_t fDmat ;  // average density of the active material
-  Float_t fRmat ;  // average radiation length of the active material
-  Float_t fEmat ;  // thickness of the active material in radiation length units
-  ClassDef(AliEMCALGeometry,1)       // EMCAL geometry class 
-
-} ;
+  //Member data
+  static AliEMCALGeometry * fgGeom;    // pointer to the unique instance of the singleton
+  //  static Bool_t  fgInit;           // Tells if geometry has been succesfully set up.
+  static const Char_t* fgkDefaultGeometryName; // Default name of geometry
+
+  ///////////////////////////////////////////////////////////
+
+  ClassDef(AliEMCALGeometry, 15) // EMCAL geometry class 
+};
 
 #endif // AliEMCALGEOMETRY_H