#ifndef ALIPHOSPIDV1_H
#define ALIPHOSPIDV1_H
class TCanvas ;
class TFolder ;
class TFormula;
class TPrincipal ;
class TROOT ;
class TTree ;
#include "TVector3.h"
#include <TMatrixDfwd.h>
class AliPHOSClusterizerv1 ;
class AliPHOSCpvRecPoint ;
class AliPHOSEmcRecPoint ;
class AliPHOSTrackSegment ;
class AliPHOSTrackSegmentMakerv1 ;
#include "AliPHOSPID.h"
#include "AliPID.h"
class AliPHOSPIDv1 : public AliPHOSPID {
public:
AliPHOSPIDv1() ;
AliPHOSPIDv1(AliPHOSGeometry *geom);
AliPHOSPIDv1(const AliPHOSPIDv1 & pid) ;
virtual ~AliPHOSPIDv1() ;
virtual void TrackSegments2RecParticles(Option_t *option);
const TString GetFileNamePrincipal(TString particle) const;
const TString GetFileNameParameters() const {return fFileNameParameters ;}
Float_t GetParameterCalibration (Int_t i) const;
Float_t GetParameterCpv2Emc (Int_t i, TString axis) const;
Float_t GetParameterTimeGate (Int_t i) const;
Float_t GetParameterToCalculateEllipse(TString particle, TString param, Int_t i) const ;
Float_t GetParameterPhotonBoundary (Int_t i) const;
Float_t GetParameterPi0Boundary (Int_t i) const;
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;}
void SetBayesianPID(Bool_t set){ fBayesian = set ;}
void SetParameterCalibration (Int_t i, Float_t param);
void SetParameterCpv2Emc (Int_t i, TString axis, Float_t cut) ;
void SetParameterTimeGate (Int_t i, Float_t gate) ;
void SetParameterToCalculateEllipse(TString particle, TString param, Int_t i, Float_t value) ;
void SetParameterPhotonBoundary(Int_t i, Float_t param);
void SetParameterPi0Boundary (Int_t i, Float_t param);
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;}
void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;}
void Print(const Option_t * = "") const ;
void GetVertex(void) ;
virtual const char * Version() const { return "pid-v1" ; }
AliPHOSPIDv1 & operator = (const AliPHOSPIDv1 & ) { return *this ;}
private:
virtual void InitParameters() ;
void MakeRecParticles(void ) ;
void MakePID(void) ;
Double_t GausF (Double_t x, Double_t y, Double_t *par) ;
Double_t GausPol2(Double_t x, Double_t y, Double_t *par) ;
Double_t LandauF(Double_t x, Double_t y, Double_t *par) ;
Double_t LandauPol2(Double_t x, Double_t y, Double_t *par) ;
Int_t GetCPVBit (AliPHOSTrackSegment * ts, Int_t EffPur, Float_t e) const;
Int_t GetPrincipalBit (TString particle, const Double_t* P, Int_t EffPur, Float_t e)const ;
Int_t GetHardPhotonBit(AliPHOSEmcRecPoint * emc) const;
Int_t GetHardPi0Bit (AliPHOSEmcRecPoint * emc) const;
TVector3 GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv)const ;
void PrintRecParticles(Option_t * option) ;
void SetParameters() ;
void SetInitPID(const Double_t * pid) ;
void GetInitPID(Double_t * pid) const ;
private:
Bool_t fBayesian ;
Bool_t fDefaultInit;
Bool_t fWrite ;
TString fFileNamePrincipalPhoton ;
TString fFileNamePrincipalPi0 ;
TString fFileNameParameters ;
TPrincipal *fPrincipalPhoton ;
TPrincipal *fPrincipalPi0 ;
Double_t *fX ;
Double_t *fPPhoton ;
Double_t *fPPi0 ;
TMatrixF *fParameters;
TVector3 fVtx ;
Double_t fInitPID[AliPID::kSPECIESCN] ;
Double_t fTphoton[3] ;
TFormula * fTFphoton ;
Double_t fTpiong[3] ;
TFormula * fTFpiong ;
Double_t fTkaong[3] ;
TFormula * fTFkaong ;
Double_t fTkaonl[3] ;
TFormula * fTFkaonl ;
Double_t fThhadrong[3] ;
TFormula * fTFhhadrong ;
Double_t fThhadronl[3] ;
TFormula * fTFhhadronl ;
Double_t fDmuon[3] ;
TFormula * fDFmuon ;
Double_t fDphoton[10] ;
Double_t fDpi0[10] ;
Double_t fDhadron[10] ;
Double_t fXelectron[10] ;
Double_t fXcharged[10] ;
Double_t fZelectron[10] ;
Double_t fZcharged[10] ;
Double_t fERecWeightPar[4] ;
TFormula * fERecWeight ;
Double_t fChargedNeutralThreshold ;
Float_t fTOFEnThreshold;
Float_t fDispEnThreshold;
Int_t fDispMultThreshold ;
ClassDef( AliPHOSPIDv1,13)
};
#endif // AliPHOSPIDV1_H