]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HMPID/AliHMPIDParam.h
fixing comment
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDParam.h
index 3506a580e59f6731cb9e9070318ef515cfe72284..947fa9e0da6cbbff8af393de09ba016eddbd9ae6 100644 (file)
@@ -8,6 +8,7 @@
 #include <TMath.h>
 #include <TNamed.h>        //base class
 #include <TGeoManager.h>   //Instance()
+#include <TGeoMatrix.h>   //Instance()
 #include <TVector3.h>      //Lors2Mars() Mars2Lors()
  
 // Class providing all the needed parametrised information
@@ -18,8 +19,10 @@ class AliHMPIDParam :public TNamed
 {
 public:
 //ctor&dtor    
-  virtual        ~AliHMPIDParam()                                    {for(Int_t i=0;i<7;i++) delete fM[i]; delete fgInstance; fgInstance=0;}
-         void     Print(Option_t *opt="") const;                                         //print current parametrization
+  virtual        ~AliHMPIDParam() {if (fgInstance){for(Int_t i=0;i<7;i++){delete fM[i];fM[i] = 0x0;};fgInstance=0;}}
+  
+  void     Print(Option_t *opt="") const;                                         //print current parametrization
+         
   static inline AliHMPIDParam* Instance();                                //pointer to AliHMPIDParam singleton
   static inline AliHMPIDParam* InstanceNoGeo();                           //pointer to AliHMPIDParam singleton without geometry.root for MOOD, displays, ...
 //geo info
@@ -47,6 +50,7 @@ public:
   inline static void   Lors2Pad(Float_t x,Float_t y,Int_t &pc,Int_t &px,Int_t &py);                                     //(x,y)->(pc,px,py) 
 
   static Int_t   Abs         (Int_t ch,Int_t pc,Int_t x,Int_t y)   {return ch*100000000+pc*1000000+x*1000+y;         }  //(ch,pc,padx,pady)-> abs pad
+  static Int_t   DDL2C       (Int_t ddl                      )     {return ddl/2;                                    }  //ddl -> chamber
   static Int_t   A2C         (Int_t pad                      )     {return pad/100000000;                            }  //abs pad -> chamber
   static Int_t   A2P         (Int_t pad                      )     {return pad%100000000/1000000;                    }  //abs pad -> pc 
   static Int_t   A2X         (Int_t pad                      )     {return pad%1000000/1000;                         }  //abs pad -> pad X 
@@ -54,9 +58,11 @@ public:
 
   static Bool_t  IsOverTh    (Float_t q                      )     {return q >= fgSigmas;                            }  //is digit over threshold?
   
-  Double_t GetRefIdx         (                               )     {return fRadNmean;                                }  //refractive index of freon
+  Double_t GetRefIdx         (                               )const{return fRadNmean;                                }  //refractive index of freon
+  Bool_t  GetInstType        (                               )const{return fgInstanceType;                            }  //return if the instance is from geom or ideal                        
   
   inline static Bool_t IsInDead(Float_t x,Float_t y        );                                                           //is the point in dead area?
+  inline static Int_t  InHVSector(Float_t x, Float_t y     );                                                           //find HV sector
   static Bool_t  IsInside    (Float_t x,Float_t y,Float_t d=0)     {return  x>-d&&y>-d&&x<fgkMaxPcX[kMaxPc]+d&&y<fgkMaxPcY[kMaxPc]+d; } //is point inside chamber boundaries?
 
             Double_t   MeanIdxRad              ()const {return 1.29204;}   //<--TEMPORAR--> to be removed in future. Mean ref index C6F14
@@ -86,22 +92,28 @@ public:
   void     Norm        (Int_t c,Double_t *n                                 )const{Double_t l[3]={0,0,1};fM[c]->LocalToMasterVect(l,n);        }//norm
   void     Point       (Int_t c,Double_t *p,Int_t plane                     )const{Lors2Mars(c,0,0,p,plane);}      //point of given chamber plane
 
-  void     SetRefIdx   (Double_t refRadIdx                                  ) {fRadNmean = refRadIdx;}             //set refractive index of freon
-  
+  void     SetRefIdx      (Double_t refRadIdx                                  ) {fRadNmean = refRadIdx;}             //set refractive index of freon
+  void     SetSigmas      (Int_t sigmas                                        ) {fgSigmas = sigmas;}                 //set sigma cut    
+  void     SetInstanceType(Bool_t inst                                         ) {fgInstanceType = inst;}             //kTRUE if from geomatry kFALSE if from ideal geometry
+  //For PID
+  Double_t SigLoc      (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta);//error due to cathode segmetation
+  Double_t SigGeom     (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta);//error due to unknown photon origin
+  Double_t SigCrom     (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta);//error due to unknonw photon energy
+  Double_t Sigma2      (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh              );//photon candidate sigma^2
   
   enum EPlaneId {kPc,kRad,kAnod};            //3 planes in chamber 
   enum ETrackingFlags {kMipDistCut=-9,kMipQdcCut=-5,kNoPhotAccept=-11};     //flags for Reconstruction
 
-  static Int_t fgSigmas;   //sigma Cut
-
-  
 protected:
   static /*const*/ Float_t fgkMinPcX[6];                                                           //limits PC
   static /*const*/ Float_t fgkMinPcY[6];                                                           //limits PC
   static /*const*/ Float_t fgkMaxPcX[6];                                                           //limits PC
   static /*const*/ Float_t fgkMaxPcY[6]; 
 
-  static Float_t fgCellX, fgCellY, fgPcX, fgPcY, fgAllX, fgAllY;
+  static Int_t    fgSigmas;                                                                        //sigma Cut
+  static Bool_t   fgInstanceType;                                                                  //kTRUE if from geomatry kFALSE if from ideal geometry
+
+  static Float_t fgCellX, fgCellY, fgPcX, fgPcY, fgAllX, fgAllY;                                   //definition of HMPID geometric parameters 
          AliHMPIDParam(Bool_t noGeo);             //default ctor is protected to enforce it to be singleton
 
   static AliHMPIDParam *fgInstance;   //static pointer  to instance of AliHMPIDParam singleton
@@ -111,6 +123,10 @@ protected:
   Float_t fY;                         //y shift of LORS with respect to rotated MARS   
   Double_t fRadNmean;                 //C6F14 mean index as a running parameter
   
+private:
+  AliHMPIDParam(const AliHMPIDParam& r);              //dummy copy constructor
+  AliHMPIDParam &operator=(const AliHMPIDParam& r);   //dummy assignment operator
+      
   ClassDef(AliHMPIDParam,0)           //HMPID main parameters class
 };
 
@@ -158,4 +174,21 @@ void AliHMPIDParam::Lors2Pad(Float_t x,Float_t y,Int_t &pc,Int_t &px,Int_t &py)
   else if(y>fgkMinPcY[4] && y<fgkMaxPcY[4]) {pc+=4;py=Int_t((y-fgkMinPcY[4]) / SizePadY());}//PC 4 or 5
   else return;
 }
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Int_t AliHMPIDParam::InHVSector(Float_t x, Float_t y)
+{
+    Int_t hvsec = 0;
+
+    if(x>=fgkMinPcY[0] && x<=(fgkMaxPcY[0]+fgkMinPcY[0])/2 && y>=fgkMinPcY[1] && y<=(fgkMaxPcY[1]+fgkMinPcY[1])/2) hvsec=0;
+    if(x>=(fgkMaxPcY[0]+fgkMinPcY[0])/2 && x<=fgkMaxPcY[0] && y>=(fgkMaxPcY[1]+fgkMinPcY[1])/2 && y<=fgkMaxPcY[1]) hvsec=1;
+    if(x>=fgkMinPcY[2] && x<=(fgkMaxPcY[2]+fgkMinPcY[2])/2 && y>=fgkMinPcY[3] && y<=(fgkMaxPcY[3]+fgkMinPcY[3])/2) hvsec=2;
+    if(x>=(fgkMaxPcY[2]+fgkMinPcY[2])/2 && x<=fgkMaxPcY[2] && y>=(fgkMaxPcY[3]+fgkMinPcY[3])/2 && y<=fgkMaxPcY[3]) hvsec=3;
+    if(x>=fgkMinPcY[4] && x<=(fgkMaxPcY[4]+fgkMinPcY[4])/2 && y>=fgkMinPcY[5] && y<=(fgkMaxPcY[5]+fgkMinPcY[5])/2) hvsec=4;
+    if(x>=(fgkMaxPcY[4]+fgkMinPcY[4])/2 && x<=fgkMaxPcY[4] && y>=(fgkMaxPcY[5]-fgkMinPcY[5])/2 && y<=fgkMaxPcY[5]) hvsec=5;
+
+    return hvsec;
+
+ //in current pc
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 #endif