1 #ifndef ALIPHOSGEOUTILS_H
2 #define ALIPHOSGEOUTILS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 //_________________________________________________________________________
7 // class for geometry transformations in PHOS
8 // this class contains AiRoot-independent transformations,
9 // AliRoot part is in AliPHOSGeometry
10 // PHOS consists of the electromagnetic calorimeter (EMCA)
11 // charged particle veto (CPV) and support
13 //*-- Author: Dmitri Peressounko (RRC "KI")
15 // --- ROOT system ---
18 // --- AliRoot header files ---
23 class AliPHOSEMCAGeometry;
24 class AliPHOSCPVGeometry;
25 class AliPHOSSupportGeometry;
27 class AliPHOSGeoUtils : public TNamed {
32 AliPHOSGeoUtils(const Text_t* name, const Text_t* title="") ;
33 AliPHOSGeoUtils(const AliPHOSGeoUtils & geom) ;
35 virtual ~AliPHOSGeoUtils(void) ;
36 AliPHOSGeoUtils & operator = (const AliPHOSGeoUtils & rvalue) ;
38 Bool_t AbsToRelNumbering(Int_t AbsId, Int_t * RelId) const ;
39 // converts the absolute PHOS cell numbering to a relative
40 Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) const ;
41 // converts the absolute PHOS numbering to a relative
43 void RelPosInModule(const Int_t * relId, Float_t & y, Float_t & z) const ;
44 // gets the position of element (pad or Xtal) relative to
45 // center of PHOS module
46 void RelPosToAbsId(Int_t module, Double_t x, Double_t z, Int_t & AbsId) const;
47 // converts local PHOS-module (x, z) coordinates to absId
48 void RelPosToRelId(Int_t module, Double_t x, Double_t z, Int_t * relId) const;
49 // converts local PHOS-module (x, z) coordinates to relId
50 void RelPosInAlice(Int_t AbsId, TVector3 & pos) const ;
51 // gets the position of element (pad or Xtal) relative to Alice
53 void Local2Global(Int_t module, Float_t x, Float_t z, TVector3 &globaPos) const ;
55 void TestSurvey(Int_t module, const Float_t *point, TVector3 &globaPos) const ; //method used in PHOS alignment check
57 void Global2Local(TVector3& localPosition,const TVector3& globalPosition,Int_t module) const ;
59 Bool_t GlobalPos2RelId(TVector3 & global, Int_t * relId) ;
60 //Tranfers global position into numbers in PHOS cols-raws
61 //Returns FALSE if local x,z beyond PHOS. Distance in perpendicular to PHOS direction is not checked.
63 Bool_t ImpactOnEmc(const TParticle * particle,Int_t & ModuleNumber, Double_t & z, Double_t & x) const ;
64 //Checks if NEUTRAL particle hits PHOS
65 Bool_t ImpactOnEmc(const Double_t * vtx, const TVector3& vec,
66 Int_t & ModuleNumber, Double_t & z, Double_t & x) const ;
67 // calculates the impact coordinates of a neutral particle
68 // emitted in direction theta and phi in ALICE
69 Bool_t ImpactOnEmc(const Double_t * vtx, const Double_t theta, const Double_t phi,
70 Int_t & ModuleNumber, Double_t & z, Double_t & x) const ;
71 // calculates the impact coordinates of a neutral particle
72 // emitted in direction theta and phi in ALICE
73 void GetIncidentVector(const TVector3 &vtx, Int_t module, Float_t x, Float_t z, TVector3& vInc) const ;
74 //calculates vector from vertex to current point in module local frame
76 Bool_t IsInEMC(Int_t id) const { if (id > fNModules * fNCristalsInModule ) return kFALSE; return kTRUE; }
78 //Method to set shift-rotational matrixes from ESDHeader
79 void SetMisalMatrix(const TGeoHMatrix * m, Int_t mod) ;
82 //Returns shift-rotational matrixes for different volumes
83 const TGeoHMatrix * GetMatrixForModule(Int_t mod)const ;
84 const TGeoHMatrix * GetMatrixForStrip(Int_t mod, Int_t strip)const ;
85 const TGeoHMatrix * GetMatrixForCPV(Int_t mod)const ;
86 const TGeoHMatrix * GetMatrixForPHOS(Int_t mod)const ;
90 AliPHOSEMCAGeometry *fGeometryEMCA ; // Geometry object for Electromagnetic calorimeter
91 AliPHOSCPVGeometry *fGeometryCPV ; // Geometry object for CPV (IHEP)
92 AliPHOSSupportGeometry *fGeometrySUPP ; // Geometry object for PHOS support
95 Int_t fNModules ; //Maximal designed number of modules in PHOS
96 Int_t fNCristalsInModule ; //Number of crystals in one module
97 Int_t fNPhi ; //Number of crystals along Phi direction
98 Int_t fNZ ; //Number of crystals along Z direction
99 Int_t fNumberOfCPVPadsPhi; //Number of CPV pads along Phi direction
100 Int_t fNumberOfCPVPadsZ ; //Number of CPV pads along Z direction
101 Int_t fNCellsXInStrip ; //Number of crystals in strip
102 Int_t fNCellsZInStrip ; //Number of crystals in strip in Z direction
103 Int_t fNStripZ ; //Number of strips in Z direction
105 Float_t fCrystalShift ; //Distance between center of module and crystal surface
106 Float_t fXtlArrSize[3] ; //Total size of cristals array
107 Float_t fCryCellShift ;
108 Float_t fCryStripShift ;
110 Float_t fPadSizePhi ; //Size of CPV pad in Phi direction
111 Float_t fPadSizeZ ; //Size of CPV pad in Z direction
112 Float_t fCPVBoxSizeY ;
114 TGeoHMatrix* fEMCMatrix[5] ; //Orientations of crystalls array in modules
115 TGeoHMatrix* fStripMatrix[5][224]; //Orientations of strip units
116 TGeoHMatrix* fCPVMatrix[5] ; //Orientations of CPV
117 const TGeoHMatrix* fPHOSMatrix[5] ; //Orientations of PHOS modules
119 TClonesArray * fMisalArray ;
121 ClassDef(AliPHOSGeoUtils,2) // PHOS geometry class
125 #endif // AliPHOSGEOUTILS_H