New developments of the analysis framework - selectorised version of the manager...
[u/mrichter/AliRoot.git] / RICH / AliRICHParam.h
d48cca74 1#ifndef AliRICHParam_h
2#define AliRICHParam_h
e30ca504 4#include <TNamed.h> //base class
db910db9 5#include <TGeoManager.h> //Instance()
e30ca504 6#include <TVector3.h> //Lors2Mars() Mars2Lors()
ed3ceb24 8static const int kCerenkov=50000050; //??? go to something more general like TPDGCode
9static const int kFeedback=50000051; //??? go to something more general like TPDGCode
ae754cdf 11// Class providing all the needed parametrised information
12// to construct the geometry, to define segmentation and to provide response model
13// In future will also provide all the staff needed for alignment and calibration
db910db9 15class AliRICHParam :public TNamed
d48cca74 16{
a25b3368 18//ctor&dtor
e30ca504 19 virtual ~AliRICHParam() {for(Int_t i=0;i<7;i++) delete fM[i]; delete fgInstance; fgInstance=0;}
c4a03891 20 void Print(Option_t *opt="") const; //print current parametrization
db910db9 21 static inline AliRICHParam* Instance(); //pointer to AliRICHParam singleton
e30ca504 22
23 Double_t MeanIdxRad () {return 1.29204;}//???????????
24 Double_t MeanIdxWin () {return 1.57819;}//???????????
db910db9 25 static Int_t Stack(Int_t evt=-1,Int_t tid=-1); //Print stack info for event and tid
26 static Int_t StackCount(Int_t pid,Int_t evt); //Counts stack particles of given sort in given event
0422a446 27//trasformation methodes
e30ca504 28 void Lors2Mars (Int_t c,Float_t x,Float_t y,Double_t *m,Int_t pl=kPc)const{Double_t z=0; switch(pl){case kPc:z=8.0;break; case kAnod:z=7.806;break; case kRad:z=-1.25; break;} Double_t l[3]={x-fX,y-fY,z}; fM[c]->LocalToMaster(l,m); }
29 TVector3 Lors2Mars (Int_t c,Float_t x,Float_t y, Int_t pl=kPc)const{Double_t m[3];Lors2Mars(c,x,y,m,pl); return TVector3(m); }//MRS->LRS
30 void Mars2Lors (Int_t c,Double_t *m,Float_t &x,Float_t &y )const{Double_t l[3];fM[c]->MasterToLocal(m,l);x=l[0]+fX;y=l[1]+fY;}//MRS->LRS
31 void Mars2LorsVec(Int_t c,Double_t *m,Float_t &th,Float_t &ph )const{Double_t l[3]; fM[c]->MasterToLocalVect(m,l); Float_t pt=TMath::Sqrt(l[0]*l[0]+l[1]*l[1]); th=TMath::ATan(l[3]/pt); ph=TMath::ATan(l[0]/pt);}
32 TVector3 Norm (Int_t c )const{Double_t n[3]; Norm(c,n); return TVector3(n); }//norm
33 void Norm (Int_t c,Double_t *n )const{Double_t l[3]={0,0,1};fM[c]->LocalToMasterVect(l,n); }//norm
35 enum EPlaneId {kPc,kRad,kAnod}; //3 planes in chamber
db910db9 36protected:
37 AliRICHParam(); //default ctor is protected to enforce it to be singleton
38 static AliRICHParam *fgInstance; //static pointer to instance of AliRICHParam singleton
e30ca504 39 TGeoHMatrix *fM[7]; //poiners to matrices defining RICH chambers rotations-translations
40 Float_t fX; //x shift of LORS with respect to rotated MARS
41 Float_t fY; //y shift of LORS with respect to rotated MARS
cb801d41 42 ClassDef(AliRICHParam,0) //RICH main parameters class
d48cca74 43};
e30ca504 44//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
db910db9 45AliRICHParam* AliRICHParam::Instance()
47// Return pointer to the AliRICHParam singleton.
48// Arguments: none
49// Returns: pointer to the instance of AliRICHParam or 0 if no geometry
e30ca504 50 if(!fgInstance)
51 if(gGeoManager) new AliRICHParam;
52 else Printf("AliRICHParam> Error:: No geometry defined!");
db910db9 53 return fgInstance;
db910db9 55//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
db910db9 56
e30ca504 57#endif