]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HMPID/AliHMPIDParam.h
option to put flat ref idx
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDParam.h
1 #ifndef AliHMPIDParam_h
2 #define AliHMPIDParam_h
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 #include <TMath.h>
9 #include <TNamed.h>        //base class
10 #include <TGeoManager.h>   //Instance()
11 #include <TVector3.h>      //Lors2Mars() Mars2Lors()
12  
13 // Class providing all the needed parametrised information
14 // to construct the geometry, to define segmentation and to provide response model
15 // In future will also provide all the staff needed for alignment and calibration
16
17 class AliHMPIDParam :public TNamed  
18 {
19 public:
20 //ctor&dtor    
21   virtual        ~AliHMPIDParam()                                    {for(Int_t i=0;i<7;i++) delete fM[i]; delete fgInstance; fgInstance=0;}
22          void     Print(Option_t *opt="") const;                                         //print current parametrization
23   static inline AliHMPIDParam* Instance();                                //pointer to AliHMPIDParam singleton
24   
25                 Double_t   MeanIdxRad              ()const {return 1.29204;}   //<--TEMPORAR--> to be removed in future  Mean ref index C6F14
26                 Double_t   MeanIdxWin              ()const {return 1.57819;}   //<--TEMPORAR--> to be removed in future. Mean ref index quartz
27                 Float_t    DistCut                 ()const {return 1.0;}       //<--TEMPORAR--> to be removed in future. Cut for MIP-TRACK residual 
28                 Float_t    QCut                    ()const {return 100;}       //<--TEMPORAR--> to be removed in future. Separation PHOTON-MIP charge 
29                 Float_t    MultCut                 ()const {return 200;}       //<--TEMPORAR--> to be removed in future. Multiplicity cut to activate WEIGHT procedure 
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  
32   static        void       IdealPosition(Int_t iCh,TGeoHMatrix *m);       //ideal position of given chamber 
33   //trasformation methodes
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
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); 
38                                                                                    Float_t pt=TMath::Sqrt(l[0]*l[0]+l[1]*l[1]); 
39                                                                                            th=TMath::ATan(pt/l[2]); 
40                                                                                            ph=TMath::ATan2(l[1],l[0]);}    
41   TVector3 Norm        (Int_t c                                             )const{Double_t n[3]; Norm(c,n); return TVector3(n);               }//norm 
42   void     Norm        (Int_t c,Double_t *n                                 )const{Double_t l[3]={0,0,1};fM[c]->LocalToMasterVect(l,n);        }//norm
43   void     Point       (Int_t c,Double_t *p,Int_t plane                     )const{Lors2Mars(c,0,0,p,plane);}      //point of given chamber plane
44   enum EPlaneId {kPc,kRad,kAnod};            //3 planes in chamber 
45 protected:
46          AliHMPIDParam();             //default ctor is protected to enforce it to be singleton
47   static AliHMPIDParam *fgInstance;   //static pointer  to instance of AliHMPIDParam singleton
48   TGeoHMatrix *fM[7];                 //pointers to matrices defining HMPID chambers rotations-translations
49   Float_t fX;                         //x shift of LORS with respect to rotated MARS 
50   Float_t fY;                         //y shift of LORS with respect to rotated MARS   
51   ClassDef(AliHMPIDParam,0)           //HMPID main parameters class
52 };
53
54 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
55 AliHMPIDParam* AliHMPIDParam::Instance()
56 {
57 // Return pointer to the AliHMPIDParam singleton. 
58 // Arguments: none
59 //   Returns: pointer to the instance of AliHMPIDParam or 0 if no geometry       
60   if(!fgInstance) new AliHMPIDParam; 
61   return fgInstance;  
62 }//Instance()    
63 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
64
65
66 #endif