]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSGeometry.h
Added method to calculate absID from position in PHOS local coordinate system
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGeometry.h
index 2ca41430ea18cb5bf1eff7f8f3f20a4462bdea89..fa6a5ffa164b6d10906421ee7cca57c6984f08ce 100644 (file)
 // 
 //*-- Author: Yves Schutz (SUBATECH)
 
-#include <assert.h> 
-
 // --- ROOT system ---
 
-#include "TString.h"
-#include "TObjArray.h"
-#include "TVector3.h" 
-
 // --- AliRoot header files ---
 
 #include "AliGeometry.h"
-
 #include "AliPHOSEMCAGeometry.h"
 #include "AliPHOSCPVGeometry.h"
 #include "AliPHOSSupportGeometry.h"
@@ -37,33 +30,21 @@ class AliPHOSGeometry : public AliGeometry {
 
 public: 
 
-  AliPHOSGeometry() {
-    // default ctor 
-    // must be kept public for root persistency purposes, but should never be called by the outside world
-    fPHOSAngle = 0 ;
-    fGeometryEMCA = 0;
-    fGeometrySUPP = 0;
-    fGeometryCPV  = 0;
-    fgGeom        = 0;
-    fRotMatrixArray = 0;  }  
-
-  AliPHOSGeometry(const AliPHOSGeometry & geom) {
-    // cpy ctor requested by Coding Convention but not yet needed
-    
-    assert(0==1) ;
+  AliPHOSGeometry() ;
+
+  AliPHOSGeometry(const AliPHOSGeometry & geom) : AliGeometry(geom) {
+    Fatal("cpy ctor", "not implemented") ; 
   } 
   
   virtual ~AliPHOSGeometry(void) ; 
   static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title="") ; 
   static AliPHOSGeometry * GetInstance() ; 
-  virtual void  GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrix & gmat) const ;
-  virtual void  GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) const ;
+  virtual void   GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrix & gmat) const ;
+  virtual void   GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) const ;
+  virtual Bool_t Impact(const TParticle * particle) const ;
 
-  AliPHOSGeometry & operator = (const AliPHOSGeometry  & rvalue) const {
-    // assignement operator requested by coding convention but not needed
-    assert(0==1) ;
-    return *(GetInstance()) ; 
-  }
+  AliPHOSGeometry & operator = (const AliPHOSGeometry  & /*rvalue*/) const {
+    Fatal("operator =", "nt implemented") ; return *(GetInstance()) ; }
  
   // General
 
@@ -71,27 +52,33 @@ public:
 
   static TString Radian(void){ return TString("rad") ; }  // a global for radian (rad)
 
-  Bool_t AbsToRelNumbering(const Int_t AbsId, Int_t * RelId) const ; 
+  Bool_t AbsToRelNumbering(Int_t AbsId, Int_t * RelId) const ; 
                                           // converts the absolute PHOS numbering to a relative 
 
-  void EmcModuleCoverage(const Int_t m, Double_t & tm, Double_t & tM, Double_t & pm, 
+  void EmcModuleCoverage(Int_t m, Double_t & tm, Double_t & tM, Double_t & pm, 
                                          Double_t & pM, Option_t * opt = Radian() ) const ;
                                          // calculates the angular coverage in theta and phi of a EMC module
   void EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt = Radian() ) const ; 
                                          // calculates the angular coverage in theta and phi of a  
                                          // single crystal in a EMC module
-  void ImpactOnEmc(const Double_t theta, const Double_t phi, Int_t & ModuleNumber, 
+  void ImpactOnEmc(Double_t theta, Double_t phi, Int_t & ModuleNumber, 
+                        Double_t & z, Double_t & x) const ; 
+  void ImpactOnEmc(TVector3 vec, Int_t & ModuleNumber, 
+                        Double_t & z, Double_t & x) const ; 
+  void ImpactOnEmc(TParticle p, Int_t & ModuleNumber, 
                         Double_t & z, Double_t & x) const ; 
-                                         // calculates the impact coordinates of a neutral particle  
+                                        // calculates the impact coordinates of a neutral particle  
                                          // emitted in direction theta and phi in ALICE
-  Bool_t IsInEMC(const Int_t id) const { if (id > GetNModules() *  GetNCristalsInModule() ) return kFALSE; return kTRUE; } 
+  Bool_t IsInEMC(Int_t id) const { if (id > GetNModules() *  GetNCristalsInModule() ) return kFALSE; return kTRUE; } 
   void RelPosInModule(const Int_t * RelId, Float_t & y, Float_t & z) const ; 
                                          // gets the position of element (pad or Xtal) relative to 
                                          // center of PHOS module  
-  void RelPosInAlice(const Int_t AbsId, TVector3 &  pos) const ;             
+  void RelPosInAlice(Int_t AbsId, TVector3 &  pos) const ;             
                                          // gets the position of element (pad or Xtal) relative to Alice
   Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) const ;         
                                          // converts the absolute PHOS numbering to a relative 
+  void  RelPosToAbsId(const Int_t module, const Double_t x, const Double_t z, Int_t & AbsId) const; 
+                                         // converts local PHOS-module (x, z) coordinates to absId 
 
   Bool_t IsInitialized(void)                  const { return fgInit ; }  
                                                                        
@@ -102,6 +89,8 @@ public:
   Float_t  GetIPtoUpperCPVsurface(void)         const { return fIPtoUpperCPVsurface ; }
   Float_t  GetOuterBoxSize(Int_t index)         const { return 2.*fPHOSParams[index]; }
   Float_t  GetCrystalSize(Int_t index)          const { return fGeometryEMCA->GetCrystalSize(index) ;  }
+  Float_t  GetCellStep(void)                    const { return 2*(fGeometryEMCA->GetAirCellHalfSize()[0] + 
+                                                                 fGeometryEMCA->GetStripWallWidthOut()) ;}
 
   // Return EMCA geometry parameters
 
@@ -130,6 +119,8 @@ public:
   Float_t GetCPVBoxSize(Int_t index)           const { return fGeometryCPV ->GetCPVBoxSize(index);        } 
   Float_t GetIPtoCPVDistance(void)             const { return  GetIPtoOuterCoverDistance() - 
                                                               GetCPVBoxSize(1) - 1.0; }
+  TVector3 GetModuleCenter(char *det, Int_t module) const;
+  TVector3 Global2Local(TVector3 globalPosition, Int_t module) const;
 
   // Return PHOS' support geometry parameters