]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSGeoUtils.h
Library with PHOS geometry transformations for AliRoot-independent analysis
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGeoUtils.h
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
8 // PHOS consists of the electromagnetic calorimeter (EMCA)
9 // and a charged particle veto (CPV)
10 // 
11 //*-- Author: Dmitri Peressounko (RRC "KI")
12
13 // --- ROOT system ---
14 #include "TNamed.h"
15
16 // --- AliRoot header files ---
17
18 class TVector3;
19 class TParticle ;
20
21 class AliPHOSGeoUtils : public TNamed {
22
23 public: 
24
25   AliPHOSGeoUtils() ;
26   AliPHOSGeoUtils(const Text_t* name, const Text_t* title="") ;
27   AliPHOSGeoUtils(const AliPHOSGeoUtils & geom) ;
28   
29   virtual ~AliPHOSGeoUtils(void) ; 
30   AliPHOSGeoUtils & operator = (const AliPHOSGeoUtils  & rvalue) ;
31
32   Bool_t AbsToRelNumbering(Int_t AbsId, Int_t * RelId) const ; 
33                                          // converts the absolute PHOS cell numbering to a relative 
34   Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) const ; 
35                                          // converts the absolute PHOS numbering to a relative         
36                                          
37   void RelPosInModule(const Int_t * relId, Float_t & y, Float_t & z) const ; 
38                                          // gets the position of element (pad or Xtal) relative to 
39                                          // center of PHOS module  
40   void RelPosToAbsId(Int_t module, Double_t x, Double_t z, Int_t & AbsId) const; 
41                                          // converts local PHOS-module (x, z) coordinates to absId 
42   void RelPosToRelId(Int_t module, Double_t x, Double_t z, Int_t * relId) const; 
43                                          // converts local PHOS-module (x, z) coordinates to relId 
44   void RelPosInAlice(Int_t AbsId, TVector3 &  pos) const ;             
45                                          // gets the position of element (pad or Xtal) relative to Alice
46
47   void Local2Global(Int_t module, Float_t x, Float_t z, TVector3 &globaPos) const ;
48               
49   void Global2Local(TVector3& localPosition,const TVector3& globalPosition,Int_t module) const ;
50
51   Bool_t ImpactOnEmc(const TParticle * particle,Int_t & ModuleNumber, Double_t & z, Double_t & x) const ;
52                                          //Checks if NEUTRAL particle hits PHOS
53   Bool_t ImpactOnEmc(const Double_t * vtx, const TVector3& vec,                
54                    Int_t & ModuleNumber, Double_t & z, Double_t & x) const ; 
55                                          // calculates the impact coordinates of a neutral particle  
56                                          // emitted in direction theta and phi in ALICE
57   Bool_t ImpactOnEmc(const Double_t * vtx, const Double_t theta, const Double_t phi, 
58                    Int_t & ModuleNumber, Double_t & z, Double_t & x) const ; 
59                                          // calculates the impact coordinates of a neutral particle  
60                                          // emitted in direction theta and phi in ALICE
61   void  GetIncidentVector(const TVector3 &vtx, Int_t module, Float_t x, Float_t z, TVector3& vInc) const ;
62                                          //calculates vector from vertex to current point in module local frame
63
64   Bool_t IsInEMC(Int_t id) const { if (id > fNModules *  fNCristalsInModule ) return kFALSE; return kTRUE; } 
65
66
67 private:
68  
69   void Init(void) ;  //Read all sizes etc. for EMC and CPV geometries
70
71 private:
72
73   Int_t fNModules ;          // Maximal designed number of modules in PHOS
74   Int_t fNCristalsInModule ; //Number of crystals in one module
75   Int_t fNPhi ;              //Number of crystals along Phi direction
76   Int_t fNZ ;                //Number of crystals along Z direction
77   Int_t fNumberOfCPVPadsPhi; //Number of CPV pads along Phi direction
78   Int_t fNumberOfCPVPadsZ ;  //Number of CPV pads along Z direction
79   Int_t fNCellsXInStrip ;    //Number of crystals in strip
80   Int_t fNCellsZInStrip ;    //Number of crystals in strip in Z direction 
81   Int_t fNStripZ ;           //Number of strips in Z direction
82
83   Float_t fCrystalShift ;    //Distance between center of module and crystal surface
84   Float_t fXtlArrSize[3] ;   //Total size of cristals array
85   Float_t fCryCellShift ; 
86   Float_t fCellStep ; 
87   Float_t fPadSizePhi ;      //Size of CPV pad in Phi direction
88   Float_t fPadSizeZ ;        //Size of CPV pad in Z direction
89   Float_t fCPVBoxSizeY ;
90
91   ClassDef(AliPHOSGeoUtils,1)       // PHOS geometry class 
92
93 } ;
94
95 #endif // AliPHOSGEOUTILS_H