make sure EMCal trigger-cluster matching is done when event is EMCal triggered, in...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGeoUtils.h
CommitLineData
70a0fabe 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 */
5
6//_________________________________________________________________________
7// class for geometry transformations in PHOS
bcc9e89e 8// this class contains AiRoot-independent transformations,
9// AliRoot part is in AliPHOSGeometry
70a0fabe 10// PHOS consists of the electromagnetic calorimeter (EMCA)
bcc9e89e 11// charged particle veto (CPV) and support
70a0fabe 12//
13//*-- Author: Dmitri Peressounko (RRC "KI")
14
15// --- ROOT system ---
16#include "TNamed.h"
17
18// --- AliRoot header files ---
19
bb5c37a5 20class TGeoHMatrix ;
70a0fabe 21class TVector3;
22class TParticle ;
bcc9e89e 23class AliPHOSEMCAGeometry;
24class AliPHOSCPVGeometry;
25class AliPHOSSupportGeometry;
70a0fabe 26
27class AliPHOSGeoUtils : public TNamed {
28
29public:
30
31 AliPHOSGeoUtils() ;
32 AliPHOSGeoUtils(const Text_t* name, const Text_t* title="") ;
33 AliPHOSGeoUtils(const AliPHOSGeoUtils & geom) ;
34
35 virtual ~AliPHOSGeoUtils(void) ;
36 AliPHOSGeoUtils & operator = (const AliPHOSGeoUtils & rvalue) ;
37
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
42
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
52
53 void Local2Global(Int_t module, Float_t x, Float_t z, TVector3 &globaPos) const ;
54
55 void Global2Local(TVector3& localPosition,const TVector3& globalPosition,Int_t module) const ;
56
f4aea312 57 Bool_t GlobalPos2RelId(TVector3 & global, Int_t * relId) ;
58 //Tranfers global position into numbers in PHOS cols-raws
59 //Returns FALSE if local x,z beyond PHOS. Distance in perpendicular to PHOS direction is not checked.
60
70a0fabe 61 Bool_t ImpactOnEmc(const TParticle * particle,Int_t & ModuleNumber, Double_t & z, Double_t & x) const ;
62 //Checks if NEUTRAL particle hits PHOS
63 Bool_t ImpactOnEmc(const Double_t * vtx, const TVector3& vec,
64 Int_t & ModuleNumber, Double_t & z, Double_t & x) const ;
65 // calculates the impact coordinates of a neutral particle
66 // emitted in direction theta and phi in ALICE
67 Bool_t ImpactOnEmc(const Double_t * vtx, const Double_t theta, const Double_t phi,
68 Int_t & ModuleNumber, Double_t & z, Double_t & x) const ;
69 // calculates the impact coordinates of a neutral particle
70 // emitted in direction theta and phi in ALICE
71 void GetIncidentVector(const TVector3 &vtx, Int_t module, Float_t x, Float_t z, TVector3& vInc) const ;
72 //calculates vector from vertex to current point in module local frame
73
74 Bool_t IsInEMC(Int_t id) const { if (id > fNModules * fNCristalsInModule ) return kFALSE; return kTRUE; }
75
bb5c37a5 76 //Method to set shift-rotational matrixes from ESDHeader
98082233 77 void SetMisalMatrix(const TGeoHMatrix * m, Int_t mod) ;
bb5c37a5 78
79protected:
80 //Returns shift-rotational matrixes for different volumes
98082233 81 const TGeoHMatrix * GetMatrixForModule(Int_t mod)const ;
82 const TGeoHMatrix * GetMatrixForStrip(Int_t mod, Int_t strip)const ;
83 const TGeoHMatrix * GetMatrixForCPV(Int_t mod)const ;
84 const TGeoHMatrix * GetMatrixForPHOS(Int_t mod)const ;
70a0fabe 85
bcc9e89e 86protected:
70a0fabe 87
bcc9e89e 88 AliPHOSEMCAGeometry *fGeometryEMCA ; // Geometry object for Electromagnetic calorimeter
89 AliPHOSCPVGeometry *fGeometryCPV ; // Geometry object for CPV (IHEP)
90 AliPHOSSupportGeometry *fGeometrySUPP ; // Geometry object for PHOS support
91
70a0fabe 92
bcc9e89e 93 Int_t fNModules ; //Maximal designed number of modules in PHOS
70a0fabe 94 Int_t fNCristalsInModule ; //Number of crystals in one module
95 Int_t fNPhi ; //Number of crystals along Phi direction
96 Int_t fNZ ; //Number of crystals along Z direction
97 Int_t fNumberOfCPVPadsPhi; //Number of CPV pads along Phi direction
98 Int_t fNumberOfCPVPadsZ ; //Number of CPV pads along Z direction
99 Int_t fNCellsXInStrip ; //Number of crystals in strip
100 Int_t fNCellsZInStrip ; //Number of crystals in strip in Z direction
101 Int_t fNStripZ ; //Number of strips in Z direction
102
103 Float_t fCrystalShift ; //Distance between center of module and crystal surface
104 Float_t fXtlArrSize[3] ; //Total size of cristals array
105 Float_t fCryCellShift ;
bb5c37a5 106 Float_t fCryStripShift ;
70a0fabe 107 Float_t fCellStep ;
108 Float_t fPadSizePhi ; //Size of CPV pad in Phi direction
109 Float_t fPadSizeZ ; //Size of CPV pad in Z direction
110 Float_t fCPVBoxSizeY ;
111
bb5c37a5 112 TGeoHMatrix* fEMCMatrix[5] ; //Orientations of crystalls array in modules
113 TGeoHMatrix* fStripMatrix[5][224]; //Orientations of strip units
114 TGeoHMatrix* fCPVMatrix[5] ; //Orientations of CPV
98082233 115 const TGeoHMatrix* fPHOSMatrix[5] ; //Orientations of PHOS modules
bb5c37a5 116
117 TClonesArray * fMisalArray ;
118
bcc9e89e 119 ClassDef(AliPHOSGeoUtils,2) // PHOS geometry class
70a0fabe 120
121} ;
122
123#endif // AliPHOSGEOUTILS_H