new Draw with gradations in color
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDParam.h
d3da6dc4 1#ifndef AliHMPIDParam_h
2#define AliHMPIDParam_h
3010c308 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
d3da6dc4 5
3010c308 6/* $Id$ */
8#include <TMath.h>
d3da6dc4 9#include <TNamed.h> //base class
10#include <TGeoManager.h> //Instance()
11#include <TVector3.h> //Lors2Mars() Mars2Lors()
13static const int kCerenkov=50000050; //??? go to something more general like TPDGCode
14static const int kFeedback=50000051; //??? go to something more general like TPDGCode
16// Class providing all the needed parametrised information
17// to construct the geometry, to define segmentation and to provide response model
18// In future will also provide all the staff needed for alignment and calibration
20class AliHMPIDParam :public TNamed
24 virtual ~AliHMPIDParam() {for(Int_t i=0;i<7;i++) delete fM[i]; delete fgInstance; fgInstance=0;}
25 void Print(Option_t *opt="") const; //print current parametrization
26 static inline AliHMPIDParam* Instance(); //pointer to AliHMPIDParam singleton
28 Double_t MeanIdxRad () {return 1.29204;}//???????????
29 Double_t MeanIdxWin () {return 1.57819;}//???????????
30 static Int_t Stack(Int_t evt=-1,Int_t tid=-1); //Print stack info for event and tid
31 static Int_t StackCount(Int_t pid,Int_t evt); //Counts stack particles of given sort in given event
1d4857c5 32 static void IdealPosition(Int_t iCh,TGeoHMatrix *m); //ideal position of given chamber
33 //trasformation methodes
d3da6dc4 34 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); }
35 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
36 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
32675400 37 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[2]/pt); ph=TMath::ATan(l[0]/pt);}
d3da6dc4 38 TVector3 Norm (Int_t c )const{Double_t n[3]; Norm(c,n); return TVector3(n); }//norm
39 void Norm (Int_t c,Double_t *n )const{Double_t l[3]={0,0,1};fM[c]->LocalToMasterVect(l,n); }//norm
41 enum EPlaneId {kPc,kRad,kAnod}; //3 planes in chamber
43 AliHMPIDParam(); //default ctor is protected to enforce it to be singleton
44 static AliHMPIDParam *fgInstance; //static pointer to instance of AliHMPIDParam singleton
45 TGeoHMatrix *fM[7]; //poiners to matrices defining HMPID chambers rotations-translations
46 Float_t fX; //x shift of LORS with respect to rotated MARS
47 Float_t fY; //y shift of LORS with respect to rotated MARS
48 ClassDef(AliHMPIDParam,0) //HMPID main parameters class
cf7e313e 50
d3da6dc4 51//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
52AliHMPIDParam* AliHMPIDParam::Instance()
54// Return pointer to the AliHMPIDParam singleton.
55// Arguments: none
56// Returns: pointer to the instance of AliHMPIDParam or 0 if no geometry
1d4857c5 57 if(!fgInstance) new AliHMPIDParam;
d3da6dc4 58 return fgInstance;
1d4857c5 62
d3da6dc4 63#endif