1 #ifndef AliRICHChamber_h
2 #define AliRICHChamber_h
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 #include <TRotMatrix.h>
10 #include <TRotation.h>
11 #include "AliRICHConst.h"
13 #include "AliRICHTresholdMap.h"
14 #include "AliSegmentation.h"
15 #include "AliRICHGeometry.h"
16 #include "AliRICHResponse.h"
18 class AliRICHClusterFinder;
20 typedef enum {kMip, kPhoton} ResponseType;
23 class AliRICHChamber : public TNamed
27 Int_t fIndexMap[50]; //indeces of tresholds
28 AliRICHTresholdMap* fTresh; //map of tresholds
32 AliRICHChamber(Int_t iModuleN,AliRICHParam *pParam);
33 AliRICHChamber(const AliRICHChamber &chamber):TNamed(chamber) {;}
34 virtual ~AliRICHChamber() {;}
35 AliRICHChamber& operator=(const AliRICHChamber&) {return *this;}
37 TRotMatrix* RotMatrix() const{return fpRotMatrix;}
38 const char* RotMatrixName() const{return "rot"+fName;}
39 TRotation Rot() {return fRot;}
40 Double_t Rho() const{return fCenterV3.Mag();}
41 Double_t ThetaD() const{return fCenterV3.Theta()*kR2d;}
42 Double_t PhiD() const{return fCenterV3.Phi()*kR2d;}
43 Double_t ThetaXd() const{return fRot.ThetaX()*kR2d;}
44 Double_t PhiXd() const{return fRot.PhiX()*kR2d;}
45 Double_t ThetaYd() const{return fRot.ThetaY()*kR2d;}
46 Double_t PhiYd() const{return fRot.PhiY()*kR2d;}
47 Double_t ThetaZd() const{return fRot.ThetaZ()*kR2d;}
48 Double_t PhiZd() const{return fRot.PhiZ()*kR2d;}
49 void RotateX(Double_t a) {fRot.RotateX(a);fCenterV3.RotateX(a);}
50 void RotateY(Double_t a) {fRot.RotateY(a);fCenterV3.RotateY(a);}
51 void RotateZ(Double_t a) {fRot.RotateZ(a);fCenterV3.RotateZ(a);}
52 Double_t X() const{return fCenterV3.X();}
53 Double_t Y() const{return fCenterV3.Y();}
54 Double_t Z() const{return fCenterV3.Z();}
55 TVector3 L2G(TVector3 v3) const{v3.Transform(fRot.Inverse());v3+=fCenterV3;return v3;}
56 TVector3 L2G(Double_t x,Double_t y,Double_t z) const{TVector3 v3(x,y,z);return L2G(v3);}
57 TVector3 G2L(TVector3 v3) const{v3-=fCenterV3; v3.Transform(fRot);return v3;}
58 TVector3 G2L(Double_t x,Double_t y,Double_t z) const{TVector3 v3(x,y,z);return G2L(v3);}
59 // TLorentzVector L2G(TLorentzVector v4) const{v4.Transform(fRot.Inverse());v4+=fCenterV3;return v4;}???
60 void Print(Option_t *sOption)const;//virtual
62 void LocaltoGlobal(Float_t pos[3],Float_t Localpos[3]);//Transformation from local to global coordinates, chamber-dependant
63 void GlobaltoLocal(Float_t pos[3],Float_t localpos[3]);//Transformation from Global to local coordinates, chamber-dependant
64 void GenerateTresholds(); //Generate pad dependent tresholds
65 void DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit, Int_t&x, Float_t newclust[6][500], ResponseType res);// Cluster formation method
66 void Init(Int_t id) {fSegmentation->Init(id);} // Recalculates all the values after some of them have been changed
67 void SetGeometryModel(AliRICHGeometry* pRICHGeometry) {fGeometry=pRICHGeometry;}
68 AliRICHGeometry* GetGeometryModel() const{return fGeometry;}
69 void SetResponseModel(AliRICHResponse* pRICHResponse) {fResponse=pRICHResponse;}
70 AliRICHResponse* GetResponseModel() const{return fResponse;}
71 void SetSegmentationModel(AliSegmentation* pRICHSegmentation) {fSegmentation=pRICHSegmentation;}
72 AliSegmentation* GetSegmentationModel() const{return fSegmentation;}
73 void SetReconstructionModel(AliRICHClusterFinder *pRICHReconstruction) {fReconstruction=pRICHReconstruction;}
74 AliRICHClusterFinder* &GetReconstructionModel() {return fReconstruction;}
75 void SigGenInit(Float_t x, Float_t y, Float_t z) {fSegmentation->SigGenInit(x, y, z) ;}
76 Int_t SigGenCond(Float_t x, Float_t y, Float_t z) {return fSegmentation->SigGenCond(x, y, z);}
77 Int_t Sector(Float_t x, Float_t y) {return fSegmentation->Sector((Int_t)x, (Int_t)y);} // Returns number of sector containing (x,y) position
78 void SetPadSize(Float_t p1, Float_t p2) {fSegmentation->SetPadSize(p1,p2);}
79 Double_t GetX() const{return fX;}
80 Double_t GetY() const{return fY;}
81 Double_t GetZ() const{return fZ;}
82 inline void SetCenter(Double_t x,Double_t y,Double_t z);
83 TRotMatrix *GetRotMatrix() const{return fpRotMatrix;}
84 void SetChamberTransform(Float_t x,Float_t y,Float_t z,TRotMatrix *pRotMatrix) {fX=x; fY=y; fZ=z; fpRotMatrix=pRotMatrix;}
87 Float_t fX,fY,fZ; // Position of the center of the chamber in MRS (cm)
89 AliSegmentation *fSegmentation; //???Segmentation model for each chamber
90 AliRICHResponse *fResponse; //???Response model for each chamber
91 AliRICHGeometry *fGeometry; //???Geometry model for each chamber
92 AliRICHClusterFinder *fReconstruction; //???Reconstruction model for each chamber
94 TVector3 fCenterV3; //chamber center position in MRS (cm)
95 TRotation fRot; //chamber rotation in MRS
96 TRotMatrix *fpRotMatrix; //rotation matrix of the chamber with respect to MRS
97 AliRICHParam *fpParam; //main RICH parameters description
98 ClassDef(AliRICHChamber,2) //single RICH chamber description
99 };//class AliRICHChamber
101 void AliRICHChamber::SetCenter(Double_t x,Double_t y,Double_t z)
103 fCenterV3.SetXYZ(x,y,z);
107 #endif //AliRICHChamber_h