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