]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RICH/AliRICHChamber.h
Obsolete - removed
[u/mrichter/AliRoot.git] / RICH / AliRICHChamber.h
CommitLineData
06b2d19f 1#ifndef AliRICHChamber_h
2#define AliRICHChamber_h
2e5f0f7b 3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
06b2d19f 7#include <TVector3.h>
8#include <TMath.h>
853634d3 9#include <TRotation.h>
c60862bf 10#include <TLorentzVector.h>
c64f7552 11#include "AliRICHParam.h"
a2f7eaf6 12#include "AliSegmentation.h"
53fd478b 13class AliRICHGeometry;
14class AliRICHResponse;
15class TRotMatrix;
2e5f0f7b 16
0ffe413c 17typedef enum {kMip, kPhoton} ResponseType;
853634d3 18class AliRICHParam;
2e5f0f7b 19
853634d3 20class AliRICHChamber : public TNamed
2e5f0f7b 21{
06b2d19f 22public:
3ea9cb08 23 AliRICHChamber();
853634d3 24 AliRICHChamber(Int_t iModuleN,AliRICHParam *pParam);
3ea9cb08 25 AliRICHChamber(const AliRICHChamber &chamber):TNamed(chamber) {;}
26 virtual ~AliRICHChamber() {;}
0ffe413c 27 AliRICHChamber& operator=(const AliRICHChamber&) {return *this;}
28
853634d3 29 TRotMatrix* RotMatrix() const{return fpRotMatrix;}
30 const char* RotMatrixName() const{return "rot"+fName;}
53fd478b 31 TRotation Rot() const{return fRot;}
853634d3 32 Double_t Rho() const{return fCenterV3.Mag();}
c60862bf 33 Double_t ThetaD() const{return fCenterV3.Theta()*TMath::RadToDeg();}
34 Double_t PhiD() const{return fCenterV3.Phi()*TMath::RadToDeg();}
35 Double_t ThetaXd() const{return fRot.ThetaX()*TMath::RadToDeg();}
36 Double_t PhiXd() const{return fRot.PhiX()*TMath::RadToDeg();}
37 Double_t ThetaYd() const{return fRot.ThetaY()*TMath::RadToDeg();}
38 Double_t PhiYd() const{return fRot.PhiY()*TMath::RadToDeg();}
39 Double_t ThetaZd() const{return fRot.ThetaZ()*TMath::RadToDeg();}
53fd478b 40 Double_t PhiZd() const{return fRot.PhiZ()*TMath::RadToDeg();}
c64f7552 41 void RotateX(Double_t a) {fRot.RotateX(a);fCenterV3.RotateX(a);fPcX3.RotateX(a);}
42 void RotateY(Double_t a) {fRot.RotateY(a);fCenterV3.RotateY(a);fPcX3.RotateY(a);}
43 void RotateZ(Double_t a) {fRot.RotateZ(a);fCenterV3.RotateZ(a);fPcX3.RotateZ(a);}
853634d3 44 Double_t X() const{return fCenterV3.X();}
45 Double_t Y() const{return fCenterV3.Y();}
46 Double_t Z() const{return fCenterV3.Z();}
c60862bf 47 TVector3 L2G(TVector3 x3) const{x3.Transform(fRot);x3+=fCenterV3;return x3;}
48 TVector3 G2L(TVector3 x3) const{x3-=fCenterV3;x3.Transform(fRot.Inverse()); return x3;}
c712cb2f 49 inline TVector3 Glob2Loc(TVector3 x3, Bool_t isVector=kFALSE) const;
50 TVector3 Glob2Loc(TLorentzVector x4,Bool_t isVector=kFALSE) const{return Glob2Loc(x4.Vect(),isVector);}
c60862bf 51 TVector3 L2G(Double_t x,Double_t y,Double_t z) const{return L2G(TVector3(x,y,z));}
52 TVector3 G2L(TLorentzVector x4) const{return G2L(x4.Vect());}
53 Float_t G2Ly(TLorentzVector x4) const{TVector3 x3=G2L(x4.Vect()); return x3.Z();}
54 TVector3 G2L(Double_t x,Double_t y,Double_t z) const{return G2L(TVector3(x,y,z));}
55 Float_t G2Lx(Double_t x,Double_t y,Double_t z) const{TVector3 x3=G2L(x,y,z); return x3.X();}
56 Float_t G2Ly(Double_t x,Double_t y,Double_t z) const{TVector3 x3=G2L(x,y,z); return x3.Z();}
0ffe413c 57 void Print(Option_t *sOption)const;//virtual
58
59 void LocaltoGlobal(Float_t pos[3],Float_t Localpos[3]);//Transformation from local to global coordinates, chamber-dependant
60 void GlobaltoLocal(Float_t pos[3],Float_t localpos[3]);//Transformation from Global to local coordinates, chamber-dependant
0ffe413c 61 void DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit, Int_t&x, Float_t newclust[6][500], ResponseType res);// Cluster formation method
62 void Init(Int_t id) {fSegmentation->Init(id);} // Recalculates all the values after some of them have been changed
63 void SetGeometryModel(AliRICHGeometry* pRICHGeometry) {fGeometry=pRICHGeometry;}
64 AliRICHGeometry* GetGeometryModel() const{return fGeometry;}
65 void SetResponseModel(AliRICHResponse* pRICHResponse) {fResponse=pRICHResponse;}
66 AliRICHResponse* GetResponseModel() const{return fResponse;}
67 void SetSegmentationModel(AliSegmentation* pRICHSegmentation) {fSegmentation=pRICHSegmentation;}
68 AliSegmentation* GetSegmentationModel() const{return fSegmentation;}
0ffe413c 69 void SigGenInit(Float_t x, Float_t y, Float_t z) {fSegmentation->SigGenInit(x, y, z) ;}
70 Int_t SigGenCond(Float_t x, Float_t y, Float_t z) {return fSegmentation->SigGenCond(x, y, z);}
71 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
72 void SetPadSize(Float_t p1, Float_t p2) {fSegmentation->SetPadSize(p1,p2);}
853634d3 73 Double_t GetX() const{return fX;}
74 Double_t GetY() const{return fY;}
75 Double_t GetZ() const{return fZ;}
c64f7552 76 inline void SetToZenith();
77 TRotMatrix *GetRotMatrix() const{return fpRotMatrix;}
853634d3 78protected:
853634d3 79 Float_t fX,fY,fZ; // Position of the center of the chamber in MRS (cm)
237c933d 80
0ffe413c 81 AliSegmentation *fSegmentation; //???Segmentation model for each chamber
82 AliRICHResponse *fResponse; //???Response model for each chamber
83 AliRICHGeometry *fGeometry; //???Geometry model for each chamber
06b2d19f 84
853634d3 85 TVector3 fCenterV3; //chamber center position in MRS (cm)
c64f7552 86 TVector3 fPcX3; //PC center position in MRS (cm)
853634d3 87 TRotation fRot; //chamber rotation in MRS
88 TRotMatrix *fpRotMatrix; //rotation matrix of the chamber with respect to MRS
89 AliRICHParam *fpParam; //main RICH parameters description
c64f7552 90 ClassDef(AliRICHChamber,3) //single RICH chamber description
853634d3 91};//class AliRICHChamber
c64f7552 92//__________________________________________________________________________________________________
93void AliRICHChamber::SetToZenith()
06b2d19f 94{
c64f7552 95 fCenterV3.SetXYZ(fX=0,fY=AliRICHParam::Offset()-AliRICHParam::GapThickness()/2,fZ=0);
96 fPcX3.SetXYZ(0,AliRICHParam::Offset()-AliRICHParam::GapThickness()/2+5.276+0.25,0);
853634d3 97}
c64f7552 98//__________________________________________________________________________________________________
c712cb2f 99TVector3 AliRICHChamber::Glob2Loc(TVector3 x3,Bool_t isVector)const
9e23b054 100{
c64f7552 101 if(!isVector) x3-=fPcX3;
9e23b054 102 x3.Transform(fRot.Inverse());
c64f7552 103 Double_t tmp=x3.Y(); x3.SetY(x3.Z()); x3.SetZ(tmp);
9e23b054 104 return x3;
105}
c64f7552 106//__________________________________________________________________________________________________
06b2d19f 107#endif //AliRICHChamber_h