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 */
10 #include <TLorentzVector.h>
11 #include "AliRICHParam.h"
15 class AliRICHChamber : public TNamed
18 AliRICHChamber():TNamed(),fpRotMatrix(0) {;}
19 AliRICHChamber(Int_t iChamberN);
20 AliRICHChamber(const AliRICHChamber &chamber):TNamed(chamber) {;}
21 virtual ~AliRICHChamber() {;}
22 AliRICHChamber& operator=(const AliRICHChamber&) {return *this;}
24 TRotMatrix* RotMatrix() const{return fpRotMatrix;}
25 TString RotMatrixName() const{return "rot"+fName;}
26 TRotation Rot() const{return fRot;}
27 Double_t Rho() const{return fCenterV3.Mag();} //gives distance to chamber center in MRS
28 Double_t ThetaD() const{return fCenterV3.Theta()*TMath::RadToDeg();} //gives polar angle of chamber center in MRS
29 Double_t PhiD() const{return fCenterV3.Phi() *TMath::RadToDeg();} //gives azimuthal angle of chamber center in MRS
30 Double_t ThetaXd() const{return fRot.ThetaX() *TMath::RadToDeg();}
31 Double_t PhiXd() const{return fRot.PhiX() *TMath::RadToDeg();}
32 Double_t ThetaYd() const{return fRot.ThetaY() *TMath::RadToDeg();}
33 Double_t PhiYd() const{return fRot.PhiY() *TMath::RadToDeg();}
34 Double_t ThetaZd() const{return fRot.ThetaZ() *TMath::RadToDeg();}
35 Double_t PhiZd() const{return fRot.PhiZ() *TMath::RadToDeg();}
36 void RotateX(Double_t a) {fRot.RotateX(a);fCenterV3.RotateX(a);fPcX3.RotateX(a);} //rotate chamber around X by "a" degrees
37 void RotateY(Double_t a) {fRot.RotateY(a);fCenterV3.RotateY(a);fPcX3.RotateY(a);} //rotate chamber around Y by "a" degrees
38 void RotateZ(Double_t a) {fRot.RotateZ(a);fCenterV3.RotateZ(a);fPcX3.RotateZ(a);} //rotate chamber around Z by "a" degrees
39 Double_t X() const{return fCenterV3.X();}
40 Double_t Y() const{return fCenterV3.Y();}
41 Double_t Z() const{return fCenterV3.Z();}
42 TVector2 Glob2Loc(TVector3 x3)const{x3-=fPcX3;x3.Transform(fRot.Inverse());return TVector2(x3.Z()+0.5*AliRICHParam::PcSizeX(),-x3.X()+0.5*AliRICHParam::PcSizeY());}//Y and Z are misplaced?????
43 TVector3 Loc2Glob(TVector2 x2)const{TVector3 x3(-x2.Y()+0.5*AliRICHParam::PcSizeY(),0,x2.X()-0.5*AliRICHParam::PcSizeX());x3.Transform(fRot); x3+=fPcX3;return x3;}
45 TVector2 Glob2Loc(TLorentzVector x4) const{return Glob2Loc(x4.Vect());}
47 void Print(Option_t *sOption)const;//virtual
50 inline void SetToZenith();
51 TRotMatrix *GetRotMatrix() const{return fpRotMatrix;}
53 TVector3 fCenterV3; //chamber center position in MRS (cm)
54 TVector3 fPcX3; //PC center position in MRS (cm)
55 TRotation fRot; //chamber rotation in MRS
56 TRotMatrix *fpRotMatrix; //rotation matrix of the chamber with respect to MRS
57 ClassDef(AliRICHChamber,6) //single RICH chamber description
58 };//class AliRICHChamber
59 //__________________________________________________________________________________________________
60 void AliRICHChamber::SetToZenith()
62 //Put the chamber to zenith. Position of PC is shifted in X-Z plane since the origin of chamber local system is in
63 //left hand down coner.
64 fCenterV3.SetXYZ(0,AliRICHParam::Offset()-AliRICHParam::GapThickness()/2 ,0);
65 fPcX3.SetXYZ(0,AliRICHParam::Offset()-AliRICHParam::GapThickness()/2+5.276+0.25,0);
67 //__________________________________________________________________________________________________
68 #endif //AliRICHChamber_h