/* Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-/* $Id$ */
+/* $Id$ */
//***********************************************************
//// Class AliAODPidHF
-//// class for PID with AliAODRecoDecayHF
-//// Authors: D. Caffarri caffarri@pd.infn.it, A.Dainese andrea.dainese@pd.infn.it, S. Dash dash@to.infn.it, F. Prino prino@to.infn.it, R. Romita r.romita@gsi.de, Y. Wang yifei@pi0.physi.uni-heidelberg.de
+//// class for PID with AliAODRecoDecayHF
+//// Authors: D. Caffarri caffarri@pd.infn.it, A.Dainese andrea.dainese@pd.infn.it, S. Dash dash@to.infn.it, F. Prino prino@to.infn.it, R. Romita r.romita@gsi.de, Y. Wang yifei@pi0.physi.uni-heidelberg.de, J. van der Maarel j.vandermaarel@cern.ch
////***********************************************************
#include <TString.h>
#include "AliPID.h"
class AliAODPidHF : public TObject{
-
- public:
-
+
+public:
+
enum ECombDetectors {
kTPC,
kTOF,
kTPCTOF,
- kTPCITS,
- kTPCAndTOF
+ kTPCITS
};
-
+
AliAODPidHF();
AliAODPidHF(const AliAODPidHF& pid);
- AliAODPidHF& operator=(const AliAODPidHF& pid);
virtual ~AliAODPidHF();
-
+
//Setters
void SetSigma(Double_t *sigma){
for(Int_t i=0; i<fnNSigma; i++) fnSigma[i]=sigma[i];
void SetSigmaForTOF(Double_t sigma){fnSigma[3]=sigma;return;}
void SetSigmaForITS(Double_t sigma){fnSigma[4]=sigma;return;}
void SetTofSigma(Double_t sigma){fTOFSigma=sigma;return;}
-
+
void SetCutOnTOFmismatchProb(Double_t cut=0.01){fCutTOFmismatch=cut;}
void DisableCutOnTOFmismatchProb(){fCutTOFmismatch=999.;}
-
+
void SetMinNClustersTPCPID(Int_t minc) {fMinNClustersTPCPID=minc;}
-
+
void SetCombinednSigmaCutForPiKP(Float_t sigpi, Float_t sigk, Float_t sigp){
- fMaxnSigmaCombined[0]=sigpi;
+ fMaxnSigmaCombined[0]=sigpi;
fMaxnSigmaCombined[1]=sigk;
fMaxnSigmaCombined[2]=sigp;
}
fMinnSigmaTOF[2]=smin;
fMaxnSigmaTOF[2]=smax;
}
-
+
void SetPriors(Double_t *priors){fPriors=priors;return;}
void SetPLimit(Double_t *plim){for(Int_t i=0;i<fnPLimit;i++) fPLimit[i]=plim[i];return;}
void SetPLimit(Double_t *plim,Int_t npLim){fnPLimit=npLim;for(Int_t i=0;i<fnPLimit;i++) fPLimit[i]=plim[i];return;}
void SetAsym(Bool_t asym){fAsym=asym;return;}
+ void SetUseAsymmnSigmaTOF(Double_t nsmin, Double_t nsmax, Double_t nscompmin, Double_t nscompmax){
+ fUseAsymTOF=kTRUE;
+ fLownSigmaTOF=nsmin; fUpnSigmaTOF=nsmax;
+ fLownSigmaCompatTOF=nscompmin; fUpnSigmaCompatTOF=nscompmax;
+ }
void SetTPC(Bool_t tpc){fTPC=tpc;return;}
void SetTOF(Bool_t tof){fTOF=tof;return;}
void SetITS(Bool_t its){fITS=its;return;}
void SetTRD(Bool_t trd){fTRD=trd;return;}
void SetMatch(Int_t match){fMatch=match;return;}
+ void SetForceTOFforKaons(Bool_t forceTOF){fForceTOFforKaons=forceTOF;return;}
void SetCompat(Bool_t comp){fCompat=comp;return;}
void SetMC(Bool_t mc){fMC=mc;return;}
void SetMClowenpp2011(Bool_t mc){fMCLowEn2011=mc;return;}
if(fPriorsH[AliPID::kProton]) delete fPriorsH[AliPID::kProton];
fPriorsH[AliPID::kProton] = new TH1F(*histo);
}
-
-
+
+
//Getters
-
+
Int_t GetnSigmaTPC(AliAODTrack *track, Int_t species, Double_t &sigma) const;
Int_t GetnSigmaTOF(AliAODTrack *track, Int_t species, Double_t &sigma) const;
Int_t GetnSigmaITS(AliAODTrack *track, Int_t species, Double_t &sigma) const;
Bool_t GetITS() const{return fITS;}
Bool_t GetTRD() const{return fTRD;}
Int_t GetMatch() const{return fMatch;}
+ Bool_t GetForceTOFforKaons() const{return fForceTOFforKaons;}
Bool_t GetCompat() const{return fCompat;}
Bool_t GetMC() const{return fMC;}
Bool_t GetOnePad() const{return fOnePad;}
}
Bool_t GetUseCombined() {return fUseCombined;}
Bool_t GetDefaultPriors() {return fDefaultPriors;}
-
+
Int_t RawSignalPID (AliAODTrack *track, TString detector) const;
Bool_t IsKaonRaw (AliAODTrack *track, TString detector) const;
Bool_t IsPionRaw (AliAODTrack *track, TString detector) const;
Bool_t IsElectronRaw (AliAODTrack *track, TString detector) const;
void CombinedProbability(AliAODTrack *track,Bool_t *type) const; //0 = pion, 1 = kaon, 2 = proton
Bool_t CheckStatus(AliAODTrack *track,TString detectors) const;
-
+
Bool_t CheckITSPIDStatus(AliAODTrack *track) const;
Bool_t CheckTPCPIDStatus(AliAODTrack *track) const;
Bool_t CheckTOFPIDStatus(AliAODTrack *track) const;
Bool_t CheckTRDPIDStatus(AliAODTrack *track) const;
-
+
Bool_t TPCRawAsym(AliAODTrack* track,Int_t specie) const;
Int_t MatchTPCTOF(AliAODTrack *track,Int_t specie);
-
+
Int_t MakeRawPid(AliAODTrack *track,Int_t specie); //general method to perform PID using raw signals
-
+
Bool_t IsTOFPiKexcluded(AliAODTrack *track,Double_t nsigmaK);
-
+
Bool_t IsExcluded(AliAODTrack *track, Int_t labelTrack, Double_t nsigmaCut, TString detector);
-
+
void GetTPCBetheBlochParams(Double_t alephParameters[5]) const;
void SetBetheBloch();
// method for AliPIDCombined object
Int_t ApplyPidTPCRaw(AliAODTrack *track,Int_t specie) const;
Int_t ApplyPidTOFRaw(AliAODTrack *track,Int_t specie) const;
Int_t ApplyPidITSRaw(AliAODTrack *track,Int_t specie) const;
+ Int_t ApplyTOFCompatibilityBand(AliAODTrack *track,Int_t specie) const;
+
+ void PrintAll() const;
+
+ //Assymetric PID using histograms
+ void SetIdBand(AliPID::EParticleType specie, AliPIDResponse::EDetector detector, TH1F *min, TH1F *max);
+ void SetIdBand(AliPID::EParticleType specie, AliPIDResponse::EDetector detector, TF1 *min, TF1 *max);
+ void SetCompBand(AliPID::EParticleType specie, AliPIDResponse::EDetector detector, TH1F *min, TH1F *max);
+ void SetCompBand(AliPID::EParticleType specie, AliPIDResponse::EDetector detector, TF1 *min, TF1 *max);
+ Bool_t CheckDetectorPIDStatus(AliPIDResponse::EDetector detector, AliAODTrack *track);
+ Float_t NumberOfSigmas(AliPID::EParticleType specie, AliPIDResponse::EDetector detector, AliAODTrack *track);
+ Int_t CheckBands(AliPID::EParticleType specie, AliPIDResponse::EDetector detector, AliAODTrack *track);
+ TF1 *GetIdBandMin(AliPID::EParticleType specie, AliPIDResponse::EDetector detector) { return fIdBandMin[((int) specie)][((int) detector)]; }
+ TF1 *GetIdBandMax(AliPID::EParticleType specie, AliPIDResponse::EDetector detector) { return fIdBandMax[((int) specie)][((int) detector)]; }
+ TF1 *GetCompBandMin(AliPID::EParticleType specie, AliPIDResponse::EDetector detector) { return fCompBandMin[((int) specie)][((int) detector)]; }
+ TF1 *GetCompBandMax(AliPID::EParticleType specie, AliPIDResponse::EDetector detector) { return fCompBandMax[((int) specie)][((int) detector)]; }
- protected:
+ //Some suggested asymmetric PID
+ void SetShiftedAsymmetricPID();
+ void SetIdAsymmetricPID();
+ void SetIdCompAsymmetricPID();
+
+protected:
+
+
+private:
+ AliAODPidHF& operator=(const AliAODPidHF& pid);
- private:
Int_t fnNSigma; // number of sigmas
Double_t *fnSigma; // [fnNSigma], sigma for the raw signal PID: 0-2 for TPC, 3 for TOF, 4 for ITS
- Double_t fTOFSigma; // TOF precision
+ Double_t fTOFSigma; // TOF precision
Double_t fCutTOFmismatch; // Cut of TOF mismatch probability
UInt_t fMinNClustersTPCPID; // Minimum TPC PID clusters cut
Int_t fnPriors; //number of priors
Int_t fnPLimit; //number of Plimit
Double_t *fPLimit; // [fnPLimit], limit of p intervals for asimmetric PID: fPLimit<p[0], fPLimit[0]<p<fPLimit[1], p>fPLimit[1]
Bool_t fAsym; // asimmetric PID required
- Bool_t fTPC; //switch to include or exclude TPC
+ Bool_t fTPC; //switch to include or exclude TPC
Bool_t fTOF; // switch to include or exclude TOF
Bool_t fITS; //switch to include or exclude ITS
Bool_t fTRD; // switch to include or exclude TRD
Int_t fMatch; //switch to combine the info from more detectors: 1 = || , 2 = &, 3 = p region
+ Bool_t fForceTOFforKaons; // force TOF for kaons in mode fMatch==5
Bool_t fCompat; // compatibility region : useful only if fMatch=1
- Double_t fPCompatTOF; // compatibility p limit for TOF
+ Double_t fPCompatTOF; // compatibility p limit for TOF
+ Bool_t fUseAsymTOF; // flag for using asymmetrig nSigmaCut in TOF for fMatch==1
+ Double_t fLownSigmaTOF; // lower nsigma TOF (for fUseAsymTOF)
+ Double_t fUpnSigmaTOF; // upper nsigma TOF (for fUseAsymTOF)
+ Double_t fLownSigmaCompatTOF; // lower nsigma TOF (for fUseAsymTOF)
+ Double_t fUpnSigmaCompatTOF; // upper nsigma TOF (for fUseAsymTOF)
Int_t fnNSigmaCompat; // number of sigmas
- Double_t *fnSigmaCompat; //[fnNSigmaCompat] 0: n sigma for TPC compatibility band, 1: for TOF
+ Double_t *fnSigmaCompat; //[fnNSigmaCompat] 0: n sigma for TPC compatibility band, 1: for TOF
Double_t fMaxnSigmaCombined[3]; // nSigma cut for pi,K,p (TPC^2+TOF^2)
Double_t fMinnSigmaTPC[3]; //min. of nSigma range for pi,K,p in TPC (match==5)
Double_t fMaxnSigmaTPC[3]; //max. of nSigma range for pi,K,p in TPC (match==5)
Double_t fMinnSigmaTOF[3]; //min. of nSigma range for pi,K,p in TOF (match==5)
Double_t fMaxnSigmaTOF[3]; //max. of nSigma range for pi,K,p in TOF (match==5)
Bool_t fMC; // MC(kTRUE) or real data (kFALSE, default option)
- Bool_t fOnePad; // real data with one pad clusters
+ Bool_t fOnePad; // real data with one pad clusters
Bool_t fMCLowEn2011; // MC for low energy MC
Bool_t fppLowEn2011; // Data for low energy pp 2011
- Bool_t fPbPb; // real data PbPb
- Bool_t fTOFdecide; // real data PbPb
+ Bool_t fPbPb; // real data PbPb
+ Bool_t fTOFdecide; // real data PbPb
Bool_t fOldPid; // old PID method implemented
Double_t fPtThresholdTPC; // pT threshold to use TPC PID
Double_t fMaxTrackMomForCombinedPID; // momentum threshold to use PID
AliPIDResponse *fPidResponse; //! pid response
- AliPIDCombined* fPidCombined; //! combined PID object
-
- AliTPCPIDResponse* fTPCResponse; //! TPC response
-
+ AliPIDCombined* fPidCombined; //! combined PID object
+
+ AliTPCPIDResponse* fTPCResponse; //! TPC response
+
TH1F* fPriorsH[AliPID::kSPECIES]; // priors histos
ECombDetectors fCombDetectors; // detectors to be involved for combined PID
Bool_t fUseCombined; // detectors to be involved for combined PID
Bool_t fDefaultPriors; // use default priors for combined PID
- ClassDef(AliAODPidHF,21) // AliAODPid for heavy flavor PID
+ //Storage of identification/compatibility band for different species and detectors:
+ TF1 *fIdBandMin[AliPID::kSPECIES][4];
+ TF1 *fIdBandMax[AliPID::kSPECIES][4];
+ TF1 *fCompBandMin[AliPID::kSPECIES][4];
+ TF1 *fCompBandMax[AliPID::kSPECIES][4];
+
+ ClassDef(AliAODPidHF,24) // AliAODPid for heavy flavor PID
+
+};
+
+struct HistFunc {
+ HistFunc(TH1F *f): fHist(f) {}
+ double operator() (double *x, double * ) const {
+ TAxis *axis = fHist->GetXaxis();
+ Int_t bin = axis->FindBin(x[0]);
+ if (x[0] == axis->GetXmax()) {
+ bin = axis->GetNbins();
+ }
+ return fHist->GetBinContent(bin);
- };
+ }
+ TH1F *fHist;
+};
#endif