]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSPIDv1.h
Fix compiler problems
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPIDv1.h
index a04a35dea0f5331ce3c4132b5c4e10b63b19d01c..5192cf6f2866dc46e2590432bd7f6e38f56687fc 100644 (file)
@@ -5,6 +5,10 @@
 
 /* $Id$ */
 
+/* History of cvs commits:
+ *
+ * $Log$
+ */
 
 //_________________________________________________________________________
 // Implementation version v1 of the PHOS particle identifier 
 class TVector3 ;
 class TMatrix ;
 class TPrincipal ;
-
+class TROOT ;
+class TTree ;
+class TCanvas ;
+class TFolder ;
+class TMatrixD ;
+class TFormula;
 // --- Standard library ---
-
 // --- AliRoot header files ---
 class AliPHOSEmcRecPoint ;
 class AliPHOSCpvRecPoint ;
+class AliPHOSClusterizerv1 ;
+class AliPHOSTrackSegmentMakerv1 ;
 
 #include "AliPHOSPID.h"
-
+#include "AliPID.h"
 class  AliPHOSPIDv1 : public AliPHOSPID {
   
 public:
@@ -46,6 +56,7 @@ public:
   // Get number of rec.particles in this run
   virtual Int_t GetRecParticlesInRun() const {return fRecParticlesInRun ;}  
 
+
   // Get PID parameters as they are defined in fParameters
   Float_t GetParameterCalibration    (Int_t i)               const;
   Float_t GetParameterCpv2Emc        (Int_t i, TString axis) const;
@@ -59,6 +70,14 @@ public:
   Float_t GetCpv2EmcDistanceCut  (TString axis, Float_t e)   const ;
   Float_t GetEllipseParameter    (TString particle, TString param, Float_t e) const;
 
+  Double_t GetThresholdChargedNeutral () const {return  fChargedNeutralThreshold;}
+  Float_t GetTOFEnergyThreshold () const {return  fTOFEnThreshold;}
+  Float_t GetDispersionEnergyThreshold () const {return  fDispEnThreshold;}
+  Int_t   GetDispersionMultiplicityThreshold () const {return  fDispMultThreshold;}
+
+  //Do bayesian PID
+  void SetBayesianPID(Bool_t set){ fBayesian = set ;}
+
   // Set PID parameters to change appropriate element of fParameters
   void SetParameterCalibration   (Int_t i, Float_t param);
   void SetParameterCpv2Emc       (Int_t i, TString axis, Float_t cut)  ; 
@@ -67,7 +86,14 @@ public:
   void SetParameterPhotonBoundary(Int_t i, Float_t param);
   void SetParameterPi0Boundary   (Int_t i, Float_t param);
 
-  void Print() const ; 
+  void SetThresholdChargedNeutral (Double_t th) {fChargedNeutralThreshold = th;}
+  void SetTOFEnergyThreshold (Float_t th)  {fTOFEnThreshold = th;}
+  void SetDispersionEnergyThreshold (Float_t th) {fDispEnThreshold = th;}
+  void SetDispersionMultiplicityThreshold (Int_t th)  {fDispMultThreshold = th;}
+
+  //Switch to "on flyght" mode, without writing to TreeR and file  
+  void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;} 
+  void Print(const Option_t * = "") const ; 
 
   virtual const char * Version() const { return "pid-v1" ; }  
 
@@ -79,7 +105,14 @@ private:
   virtual void  Init() ;
   virtual void  InitParameters() ;
   void          MakeRecParticles(void ) ;
-  void          MakePID(void ) ;
+  void          MakePID(void) ;
+
+  //Functions to calculate the PID probability 
+  //  Double_t ChargedHadronDistProb(Double_t  x, Double_t y, Double_t * parg, Double_t * parl) ;
+  Double_t GausF   (Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence a+b/(x*x)+c/x
+  Double_t GausPol2(Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence a+b*x+c*x*x
+  Double_t LandauF(Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence  a+b/(x*x)+c/x
+  Double_t LandauPol2(Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence a+b*x+c*x*x
  // Relative Distance CPV-EMC
   Float_t GetDistance     (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Option_t * axis)const ; 
   Int_t   GetCPVBit       (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Int_t EffPur, Float_t e) const;
@@ -90,11 +123,16 @@ private:
   void          PrintRecParticles(Option_t * option) ;
   virtual void  WriteRecParticles() ; 
   void          SetParameters() ; //Fills the matrix of parameters
-  void Unload(); 
+  void          Unload(); 
 
-private:
+  //PID population
+  void SetInitPID(const Double_t * pid) ;
+  void GetInitPID(Double_t * pid) const ;
 
+private:
+  Bool_t      fBayesian ;                 //  Do PID bayesian
   Bool_t      fDefaultInit;              //! kTRUE if the task was created by defaut ctor (only parameters are initialized)
+  Bool_t      fWrite ;                   //! To write result to file 
   Int_t       fNEvent ;                  //! current event number
   TString     fFileNamePrincipalPhoton ; //  File name of the photon principals
   TString     fFileNamePrincipalPi0 ;    //  File name of the pi0 principals
@@ -107,8 +145,44 @@ private:
   Int_t       fRecParticlesInRun ;       //! Total number of recparticles in one run
   TMatrix    *fParameters;               //! Matrix of identification Parameters
 
-
-  ClassDef( AliPHOSPIDv1,9)  // Particle identifier implementation version 1
+  //Initial pid population
+  Double_t fInitPID[AliPID::kSPECIESN] ; // Initial population to do bayesian PID
+  // pid probability function parameters
+  // ToF
+  Double_t fTphoton[3] ;       // gaussian tof response for photon
+  TFormula * fTFphoton ;       // the formula   
+  Double_t fTpiong[3] ;        // gaussian tof response for pions
+  TFormula * fTFpiong ;        // the formula
+  Double_t fTkaong[3] ;        // landau tof response for kaons
+  TFormula * fTFkaong ;        // the formula
+  Double_t fTkaonl[3] ;        // landau tof response for kaons
+  TFormula * fTFkaonl ;        // the formula
+  Double_t fThhadrong[3] ;     // gaus   tof response for heavy hadrons
+  TFormula * fTFhhadrong ;     // the formula
+  Double_t fThhadronl[3] ;     // landau   tof response for heavy hadrons
+  TFormula * fTFhhadronl ;     // the formula
+
+  //Shower dispersion
+  Double_t fDmuon[3]    ;     // gaussian ss response for muon 
+  TFormula * fDFmuon    ;     // the formula 
+  Double_t fDphoton[10] ;     // gaussian ss response for EM
+  Double_t fDpi0[10]    ;     // gaussian ss response for pi0
+  Double_t fDhadron[10] ;     // gaussian ss response for hadrons
+
+  Double_t fXelectron[10] ;   // gaussian emc-cpv distance response for electron
+  Double_t fXcharged[10]  ;   // landau emc-cpv distance response for charged part (no elect) */
+  Double_t fZelectron[10] ;   // gaussian emc-cpv distance response for electron
+  Double_t fZcharged[10]  ;   // landau emc-cpv distance response for charged part (no elect) */
+
+
+  Double_t fERecWeightPar[4] ;  // gaussian tof response for photon
+  TFormula * fERecWeight ;      // the formula   
+  Double_t fChargedNeutralThreshold ; //Threshold to differentiate between charged and neutral
+  Float_t  fTOFEnThreshold;           //Maximum energy to use TOF
+  Float_t  fDispEnThreshold;          //Minimum energy to use shower shape
+  Int_t    fDispMultThreshold ;       //Minimum multiplicity to use shower shape
+
+  ClassDef( AliPHOSPIDv1,12)  // Particle identifier implementation version 1
 
 };