X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSGeometry.h;h=6fbcce515294bd7026144d918bcb10c3df49f010;hb=dddc33c571b008eccdc8f659de11ae42fc5a5509;hp=049033a1a7e26999d22e3e5bbac6cd02f0566447;hpb=2685bf0058cf8c070a7216d849987da45460a11b;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSGeometry.h b/PHOS/AliPHOSGeometry.h index 049033a1a7e..6fbcce51529 100644 --- a/PHOS/AliPHOSGeometry.h +++ b/PHOS/AliPHOSGeometry.h @@ -16,80 +16,43 @@ // //*-- Author: Yves Schutz (SUBATECH) -#include - // --- ROOT system --- -#include "TString.h" -#include "TObjArray.h" -#include "TVector3.h" - // --- AliRoot header files --- -#include "AliGeometry.h" - +#include "AliPHOSGeoUtils.h" #include "AliPHOSEMCAGeometry.h" #include "AliPHOSCPVGeometry.h" #include "AliPHOSSupportGeometry.h" +#include +class AliRecPoint ; +class AliPHOSRecPoint; +class TVector3; -class AliPHOSGeometry : public AliGeometry { +class AliPHOSGeometry : public AliPHOSGeoUtils { 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; - fgGeom = 0; - } - - AliPHOSGeometry(const AliPHOSGeometry & geom) { - // cpy ctor requested by Coding Convention but not yet needed - assert(0==1) ; - } + AliPHOSGeometry() ; + AliPHOSGeometry(const AliPHOSGeometry & geom) ; 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 ; - AliPHOSGeometry & operator = (const AliPHOSGeometry & rvalue) const { - // assignement operator requested by coding convention but not needed - assert(0==1) ; - return *(GetInstance()) ; + virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrixF & /* gmat */) const + {GetGlobal(RecPoint,gpos); } + virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) const ; + virtual void GetGlobalPHOS(const AliPHOSRecPoint* RecPoint, TVector3 & gpos) const ; + virtual void GetGlobalPHOS(const AliPHOSRecPoint* RecPoint, TVector3 & gpos, TMatrixF & /* gmat */) const + {GetGlobalPHOS(RecPoint,gpos); } + + AliPHOSGeometry & operator = (const AliPHOSGeometry & /*rvalue*/) { + Fatal("operator =", "not implemented") ; + return *this ; } - // General - - static TString Degre(void) { return TString("deg") ; } // a global for degree (deg) - - static TString Radian(void){ return TString("rad") ; } // a global for radian (rad) - - Bool_t AbsToRelNumbering(const 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, - 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, - Double_t & z, Double_t & x) const ; - // 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; } - 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 ; - // 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 Bool_t IsInitialized(void) const { return fgInit ; } @@ -100,8 +63,15 @@ 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];} - // Return EMCA geometry parameters + Float_t GetModuleCenter(Int_t module, Int_t axis) const { + return fModuleCenter[module][axis];} + Float_t GetModuleAngle(Int_t module, Int_t axis, Int_t angle) const { + return fModuleAngle[module][axis][angle];} + + + // Return ideal EMCA geometry parameters AliPHOSEMCAGeometry * GetEMCAGeometry() const {return fGeometryEMCA ;} Float_t GetIPtoCrystalSurface(void) const { return fGeometryEMCA->GetIPtoCrystalSurface() ; } @@ -110,7 +80,7 @@ public: Int_t GetNZ(void) const { return fGeometryEMCA->GetNZ() ; } Int_t GetNCristalsInModule(void) const { return fGeometryEMCA->GetNPhi() * fGeometryEMCA->GetNZ() ; } - // Return CPV geometry parameters + // Return ideal CPV geometry parameters Int_t GetNumberOfCPVLayers(void) const { return fGeometryCPV ->GetNumberOfCPVLayers(); } Float_t GetCPVActiveSize(Int_t index) const { return fGeometryCPV->GetCPVActiveSize(index); } Int_t GetNumberOfCPVChipsPhi(void) const { return fGeometryCPV->GetNumberOfCPVChipsPhi(); } @@ -129,6 +99,10 @@ public: Float_t GetIPtoCPVDistance(void) const { return GetIPtoOuterCoverDistance() - GetCPVBoxSize(1) - 1.0; } + + // Return real CPV geometry parameters + void GetModuleCenter(TVector3& center, const char *det, Int_t module) const; + // Return PHOS' support geometry parameters Float_t GetRailOuterSize(Int_t index) const { return fGeometrySUPP->GetRailOuterSize(index); } @@ -143,33 +117,31 @@ public: Float_t GetCradleWallThickness(void) const { return fGeometrySUPP->GetCradleWallThickness();} Float_t GetCradleWall (Int_t index) const { return fGeometrySUPP->GetCradleWall (index); } Float_t GetCradleWheel (Int_t index) const { return fGeometrySUPP->GetCradleWheel (index); } + void Init(void) ; // steering method for PHOS and PPSD/CPV -protected: - AliPHOSGeometry(const Text_t* name, const Text_t* title="") : AliGeometry(name, title) { - // ctor only for internal usage (singleton) - Init() ; - } - void Init(void) ; // steering method for PHOS and PPSD/CPV +protected: + AliPHOSGeometry(const Text_t* name, const Text_t* title="") ; private: + void SetPHOSAngles(); // calculates the PHOS modules PHI angle + - Int_t fNModules ; // Number of modules constituing PHOS Float_t fAngle ; // Position angles between modules Float_t *fPHOSAngle ; //[fNModules] Position angles of modules Float_t fPHOSParams[4] ; // Half-sizes of PHOS trapecoid Float_t fIPtoUpperCPVsurface; // Minimal distance from IP to PHOS + Float_t fCrystalShift ; //Distance from crystal center to front surface + Float_t fCryCellShift ; //Distance from crystal center to front surface TObjArray *fRotMatrixArray ; // Liste of rotation matrices (one per phos module) - AliPHOSEMCAGeometry *fGeometryEMCA ; // Geometry object for Electromagnetic calorimeter - AliPHOSCPVGeometry *fGeometryCPV ; // Geometry object for CPV (IHEP) - AliPHOSSupportGeometry *fGeometrySUPP ; // Geometry object for PHOS support + Float_t fModuleCenter[5][3]; // xyz-position of the module center + Float_t fModuleAngle[5][3][2]; // polar and azymuth angles for 3 axes of modules - void SetPHOSAngles(); // calculates the PHOS modules PHI angle static AliPHOSGeometry * fgGeom ; // pointer to the unique instance of the singleton static Bool_t fgInit ; // Tells if geometry has been succesfully set up - ClassDef(AliPHOSGeometry,1) // PHOS geometry class + ClassDef(AliPHOSGeometry,3) // PHOS geometry class } ;