ClassImp(AliFlowBayesianPID)
-TH2D* AliFlowBayesianPID::hPriors[5] = {NULL, NULL, NULL, NULL, NULL}; // histo with priors (hardcoded)
+TH2D* AliFlowBayesianPID::hPriors[fNspecies] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; // histo with priors (hardcoded)
TSpline3* AliFlowBayesianPID::fMism = NULL; // function for mismatch
AliTOFGeometry* AliFlowBayesianPID::fTofGeo = NULL; // TOF geometry needed to reproduce mismatch shape
hPriors[4] = new TH2D("hPriorsPr","Priors as a function of Centrality [p];centrality;p_{t} (GeV/c)",12,-10,110,80,0,20);
redopriors = kTRUE;
}
-
+ if(! hPriors[5]){
+ hPriors[5] = new TH2D("hPriorsDe","Priors as a function of Centrality [p];centrality;p_{t} (GeV/c)",12,-10,110,80,0,20);
+ redopriors = kTRUE;
+ }
+ if(! hPriors[6]){
+ hPriors[6] = new TH2D("hPriorsTr","Priors as a function of Centrality [p];centrality;p_{t} (GeV/c)",12,-10,110,80,0,20);
+ redopriors = kTRUE;
+ }
+ if(! hPriors[7]){
+ hPriors[7] = new TH2D("hPriorsHe","Priors as a function of Centrality [p];centrality;p_{t} (GeV/c)",12,-10,110,80,0,20);
+ redopriors = kTRUE;
+ }
+
if(redopriors) SetPriors();
if(!fMism) fMism = GetMismatch();
fProb[2]=0.0;
fProb[3]=0.0;
fProb[4]=0.0;
+ fProb[5]=0.0;
+ fProb[6]=0.0;
+ fProb[7]=0.0;
fMass[0] = fDB->GetParticle(11)->Mass(); // e mass
fMass[1] = fDB->GetParticle(13)->Mass(); // mu mass
fMass[2] = fDB->GetParticle(211)->Mass(); // pi mass
fMass[3] = fDB->GetParticle(321)->Mass(); // K mass
fMass[4] = fDB->GetParticle(2212)->Mass(); // p mass
+ fMass[5] = fDB->GetParticle(2212)->Mass()+fDB->GetParticle(2112)->Mass(); // p mass
+ fMass[6] = fDB->GetParticle(2212)->Mass()+fDB->GetParticle(2112)->Mass()*2; // p mass
+ fMass[7] = (fDB->GetParticle(2212)->Mass()+fDB->GetParticle(2112)->Mass()*2)*0.5; // p mass
// TOF response
fTOFResponse = new TF1("fTOFprob","[0]*TMath::Exp(-(x-[1])*(x-[1])/2/[2]/[2])* (x < [1]+[3]*[2]) + (x > [1]+[3]*[2])*[0]*TMath::Exp(-(x-[1]-[3]*[2]*0.5)*[3]/[2])",-7,7);
// TPC
Float_t dedx = t->GetTPCsignal();
- if(t->GetStatus() & AliESDtrack::kTPCpid && dedx > 40 && fMaskOR[0]){ // if TPC PID available
- for(Int_t iS=0;iS<5;iS++){
+ if(t->GetStatus() & AliESDtrack::kTPCout && dedx > 40 && fMaskOR[0]){ // if TPC PID available
+ for(Int_t iS=0;iS<fNspecies;iS++){
Float_t dedxExp=0;
if(iS==0) dedxExp = fPIDesd->GetTPCResponse().GetExpectedSignal(momtpc,AliPID::kElectron);
else if(iS==1) dedxExp = fPIDesd->GetTPCResponse().GetExpectedSignal(momtpc,AliPID::kMuon);
else if(iS==2) dedxExp = fPIDesd->GetTPCResponse().GetExpectedSignal(momtpc,AliPID::kPion);
else if(iS==3) dedxExp = fPIDesd->GetTPCResponse().GetExpectedSignal(momtpc,AliPID::kKaon);
else if(iS==4) dedxExp = fPIDesd->GetTPCResponse().GetExpectedSignal(momtpc,AliPID::kProton);
+ else if(iS==5) dedxExp = fPIDesd->GetTPCResponse().GetExpectedSignal(momtpc,AliPID::kDeuteron);
+ else if(iS==6) dedxExp = fPIDesd->GetTPCResponse().GetExpectedSignal(momtpc,AliPID::kTriton);
+ else if(iS==7) dedxExp = fPIDesd->GetTPCResponse().Bethe(momtpc/fMass[7])*5;
Float_t resolutionTPC = 1;
if(iS==0) resolutionTPC = fPIDesd->GetTPCResponse().GetExpectedSigma(momtpc,t->GetTPCsignalN(),AliPID::kElectron);
else if(iS==2) resolutionTPC = fPIDesd->GetTPCResponse().GetExpectedSigma(momtpc,t->GetTPCsignalN(),AliPID::kPion);
else if(iS==3) resolutionTPC = fPIDesd->GetTPCResponse().GetExpectedSigma(momtpc,t->GetTPCsignalN(),AliPID::kKaon);
else if(iS==4) resolutionTPC = fPIDesd->GetTPCResponse().GetExpectedSigma(momtpc,t->GetTPCsignalN(),AliPID::kProton);
+ else if(iS==5) resolutionTPC = fPIDesd->GetTPCResponse().GetExpectedSigma(momtpc,t->GetTPCsignalN(),AliPID::kDeuteron);
+ else if(iS==6) resolutionTPC = fPIDesd->GetTPCResponse().GetExpectedSigma(momtpc,t->GetTPCsignalN(),AliPID::kTriton);
+ else if(iS==7) resolutionTPC = fPIDesd->GetTPCResponse().Bethe(momtpc/fMass[7])*5*0.07;
fWeights[0][iS] = fTPCResponse->Eval((dedx - dedxExp)/resolutionTPC)/resolutionTPC;
}
fMaskCurrent[0] = kTRUE;
}
else{
- for(Int_t iS=0;iS<5;iS++) fWeights[0][iS] = 1;
+ for(Int_t iS=0;iS<fNspecies;iS++) fWeights[0][iS] = 1;
fMaskCurrent[0] = kFALSE;
}
// TOF
fWTofMism = 0;
- if(t->GetStatus() & AliESDtrack::kTOFpid && t->GetIntegratedLength() > 365. && fMaskOR[1]){ // if TOF PID available
+ if((t->GetStatus() & AliESDtrack::kTOFout) && (t->GetStatus() & AliESDtrack::kTIME) && t->GetIntegratedLength() > 365. && fMaskOR[1]){ // if TOF PID available
Float_t invCentr = 0;
if(centr >= 0) invCentr = 1 - centr/100;
Float_t mismfrac = 0.005 + 0.05*invCentr*invCentr*invCentr;
Float_t mismweight = TMath::Max(fMism->Eval(timeTOF - timeextra),0.00001) * ((0.5 + 0.05/pt/pt/pt)*(0.75 + 0.23 * (1.3*dx*dx + 0.7*dz*dz))); // mismatch probabilities
fWTofMism = mismfrac*mismweight;
- Double_t inttimes[5];
+ Double_t inttimes[8];
t->GetIntegratedTimes(inttimes);
- for(Int_t iS=0;iS<5;iS++){
+ inttimes[5] = inttimes[0] / p * fMass[5] * TMath::Sqrt(1+p*p/fMass[5]/fMass[5]);
+ inttimes[6] = inttimes[0] / p * fMass[6] * TMath::Sqrt(1+p*p/fMass[6]/fMass[6]);
+ inttimes[7] = inttimes[0] / p * fMass[7] * TMath::Sqrt(1+p*p/fMass[7]/fMass[7]);
+
+ for(Int_t iS=0;iS<fNspecies;iS++){
Float_t expsigma = fPIDesd->GetTOFResponse().GetExpectedSigma(p, inttimes[iS], fMass[iS]);
Float_t delta = timeTOF - inttimes[iS];
if (TMath::Abs(delta) > 5*expsigma) {
fMaskCurrent[1] = kTRUE;
}
else{
- for(Int_t iS=0;iS<5;iS++) fWeights[1][iS] = 1;
+ for(Int_t iS=0;iS<fNspecies;iS++) fWeights[1][iS] = 1;
fMaskCurrent[1] = kFALSE;
}
for(Int_t j=0;j < 2;j++){
Float_t rcc = 0;
- for(Int_t iS=0;iS<5;iS++) rcc += fWeights[j][iS];
+ for(Int_t iS=0;iS<fNspecies;iS++) rcc += fWeights[j][iS];
if(rcc <=0 ) rcc = 1;
- for(Int_t iS=0;iS<5;iS++) fWeights[j][iS] /= rcc;
+ for(Int_t iS=0;iS<fNspecies;iS++) fWeights[j][iS] /= rcc;
if(j==1) fWTofMism /= rcc;
}
//________________________________________________________________________
void AliFlowBayesianPID::ComputeProb(const AliESDtrack *t,Float_t centr){
ComputeWeights(t,centr);
- Float_t priors[5];
+ Float_t priors[fNspecies];
fProbTofMism = 0;
- for(Int_t iS=0;iS<5;iS++) priors[iS] = hPriors[iS]->GetBinContent(hPriors[iS]->GetXaxis()->FindBin(centr),hPriors[iS]->GetYaxis()->FindBin(t->Pt()));
+ for(Int_t iS=0;iS<fNspecies;iS++) priors[iS] = hPriors[iS]->GetBinContent(hPriors[iS]->GetXaxis()->FindBin(centr),hPriors[iS]->GetYaxis()->FindBin(t->Pt()));
+
if((!fMaskAND[0] || fMaskCurrent[0]) && (!fMaskAND[1] || fMaskCurrent[1])){
Float_t rcc = 0;
- for(Int_t iS=0;iS<5;iS++){
+ for(Int_t iS=0;iS<fNspecies;iS++){
rcc += fWeights[0][iS]*fWeights[1][iS]*priors[iS];
fProbTofMism += fWeights[0][iS]*fWTofMism*priors[iS];
}
if(rcc > 0){
- for(Int_t iS=0;iS<5;iS++){
+ for(Int_t iS=0;iS<fNspecies;iS++){
fProb[iS] = fWeights[0][iS]*fWeights[1][iS]*priors[iS]/rcc;
}
fProbTofMism /=rcc;
}
else{
- for(Int_t iS=0;iS<5;iS++) fProb[iS] = 0;
+ for(Int_t iS=0;iS<fNspecies;iS++) fProb[iS] = 0;
fProbTofMism = 0;
}
}
else{
- for(Int_t iS=0;iS<5;iS++) fProb[iS] = 0;
+ for(Int_t iS=0;iS<fNspecies;iS++) fProb[iS] = 0;
fProbTofMism = 0;
}
else
hPriors[j]->SetBinContent(k1,k2,fC[icentr][ipt][j]);
} // end loop over species
+ hPriors[5]->SetBinContent(k1,k2,0.0001);
+ hPriors[6]->SetBinContent(k1,k2,0.000001);
+ hPriors[7]->SetBinContent(k1,k2,0.000001);
} // end loop on pt
} // end loop on centrality bins
void SetPriors();
static const Int_t fNdetectors = 2;
- static TH2D* hPriors[5]; // histo with priors (hardcoded)
+ static const Int_t fNspecies = 8;// 0=el, 1=mu, 2=pi, 3=ka, 4=pr, 5=deuteron, 6=triton, 7=He3
+ static TH2D* hPriors[fNspecies]; // histo with priors (hardcoded)
static TSpline3 *fMism; // function for mismatch
static AliTOFGeometry *fTofGeo; // TOF geometry needed to reproduce mismatch shape
AliESDpid *fPIDesd;//ESDpid object
TDatabasePDG *fDB; // Database pdg
- Double_t fMass[5]; // mass for el(0),mu(1),pi(2),K(3),p(4)
+ Double_t fMass[fNspecies]; // mass for el(0),mu(1),pi(2),K(3),p(4)
Bool_t fNewTrackParam; // switch for new tracking resolution TOF parameterization
Bool_t fIsMC; // switch if MC data
AliTOFT0maker *fTOFmaker; //TOF-T0 maker object
- Float_t fWeights[fNdetectors][5]; // weights: 0=tpc,1=tof
- Float_t fProb[5],fWTofMism,fProbTofMism; // Bayesian Combined PID + mismatch weights and probability
+ Float_t fWeights[fNdetectors][fNspecies]; // weights: 0=tpc,1=tof
+ Float_t fProb[fNspecies],fWTofMism,fProbTofMism; // Bayesian Combined PID + mismatch weights and probability
Float_t fZ,fMassTOF; //measured charge(Z) and mass/Z
TF1 *fBBdata; // Bethe Bloch function (needed to compute the charge of the particle)
Bool_t fMaskAND[fNdetectors],fMaskOR[fNdetectors],fMaskCurrent[fNdetectors]; // mask detector should be used
- ClassDef(AliFlowBayesianPID, 3); // example of analysis
+ ClassDef(AliFlowBayesianPID, 4); // example of analysis
};
#endif
fAllowTOFmismatchFlag(kFALSE),
fRequireStrictTOFTPCagreement(kFALSE),
fCutRejectElectronsWithTPCpid(kFALSE),
+ fProbBayes(0.0),
fCurrCentr(0.0)
{
//io constructor
- for ( Int_t i=0; i<5; i++ ) { fProbBayes[i]=0.0; }
SetPriors(); //init arrays
// New PID procedure (Bayesian Combined PID)
fAllowTOFmismatchFlag(kFALSE),
fRequireStrictTOFTPCagreement(kFALSE),
fCutRejectElectronsWithTPCpid(kFALSE),
+ fProbBayes(0.0),
fCurrCentr(0.0)
{
//constructor
5.04114e-11,
2.12543e+00,
4.88663e+00 );
- for ( Int_t i=0; i<5; i++ ) { fProbBayes[i]=0.0; }
SetPriors(); //init arrays
// New PID procedure (Bayesian Combined PID)
fAllowTOFmismatchFlag(that.fAllowTOFmismatchFlag),
fRequireStrictTOFTPCagreement(that.fRequireStrictTOFTPCagreement),
fCutRejectElectronsWithTPCpid(that.fCutRejectElectronsWithTPCpid),
+ fProbBayes(0.0),
fCurrCentr(0.0)
{
//copy constructor
if (that.fTPCpidCuts) fTPCpidCuts = new TMatrixF(*(that.fTPCpidCuts));
if (that.fTOFpidCuts) fTOFpidCuts = new TMatrixF(*(that.fTOFpidCuts));
if (that.fAliESDtrackCuts) fAliESDtrackCuts = new AliESDtrackCuts(*(that.fAliESDtrackCuts));
- memcpy(fProbBayes,that.fProbBayes,sizeof(fProbBayes));
SetPriors(); //init arrays
if (that.fQA) DefineHistograms();
fAllowTOFmismatchFlag=that.fAllowTOFmismatchFlag;
fRequireStrictTOFTPCagreement=that.fRequireStrictTOFTPCagreement;
fCutRejectElectronsWithTPCpid=that.fCutRejectElectronsWithTPCpid;
- memcpy(fProbBayes,that.fProbBayes,sizeof(fProbBayes));
-
+ fProbBayes = that.fProbBayes;
fCurrCentr = that.fCurrCentr;
// New PID procedure (Bayesian Combined PID)
Bool_t AliFlowTrackCuts::PassesTOFbetaSimpleCut(const AliESDtrack* track )
{
//check if passes PID cut using timing in TOF
- Bool_t goodtrack = (track->GetStatus() & AliESDtrack::kTOFpid) &&
+ Bool_t goodtrack = (track->GetStatus() & AliESDtrack::kTOFpid) &&
(track->GetTOFsignal() > 12000) &&
(track->GetTOFsignal() < 100000) &&
(track->GetIntegratedLength() > 365);
Bool_t AliFlowTrackCuts::PassesTPCbayesianCut(const AliESDtrack* track)
{
//cut on TPC bayesian pid
- //TODO: maybe join all bayesian methods, make GetESDPdg aware of pid mode selected
//if (! fAllowTOFmismatchFlag) {if (track->GetStatus() & AliESDtrack::kTOFmismatch) return kFALSE;}
//Bool_t statusMatchingHard = TPCTOFagree(track);
//if (fRequireStrictTOFTPCagreement && (!statusMatchingHard))
// return kFALSE;
+ fBayesianResponse->ComputeProb(track,fCurrCentr); // fCurrCentr is needed for mismatch fraction
Int_t kTPC = fBayesianResponse->GetCurrentMask(0); // is TPC on
Int_t kTOF = fBayesianResponse->GetCurrentMask(1); // is TOF on
if (fRequireStrictTOFTPCagreement && (!statusMatchingHard))
return kFALSE;
- fBayesianResponse->ComputeProb(track,fCurrCentr); // fCurrCentr is needed for mismatch fraction
Float_t *probabilities = fBayesianResponse->GetProb(); // Bayesian Probability (from 0 to 4) (Combined TPC || TOF) including a tuning of priors and TOF mismatch parameterization
- fProbBayes[0] = probabilities[0];
- fProbBayes[1] = probabilities[1];
- fProbBayes[2] = probabilities[2];
- fProbBayes[3] = probabilities[3];
- fProbBayes[4] = probabilities[4];
+ fProbBayes = 0.0;
- Float_t prob = 0;
switch (fParticleID)
{
case AliPID::kPion:
- prob = fProbBayes[2];
+ fProbBayes = probabilities[2];
break;
case AliPID::kKaon:
- prob = fProbBayes[3];
+ fProbBayes = probabilities[3];
break;
case AliPID::kProton:
- prob = fProbBayes[4];
+ fProbBayes = probabilities[4];
break;
case AliPID::kElectron:
- prob = fProbBayes[0];
+ fProbBayes = probabilities[0];
+ break;
+ case AliPID::kMuon:
+ fProbBayes = probabilities[1];
+ break;
+ case AliPID::kDeuteron:
+ fProbBayes = probabilities[5];
+ break;
+ case AliPID::kTriton:
+ fProbBayes = probabilities[6];
+ break;
+ case AliPID::kHe3:
+ fProbBayes = probabilities[7];
break;
default:
return kFALSE;
}
- if(prob > fParticleProbability && mismProb < 0.5)
+ if(fProbBayes > fParticleProbability && mismProb < 0.5)
{
if(!fCutCharge)
return kTRUE;
Bool_t AliFlowTrackCuts::PassesTOFbayesianCut(const AliESDtrack* track)
{
//check is track passes bayesian combined TOF+TPC pid cut
- Bool_t goodtrack = (track->GetStatus() & AliESDtrack::kTOFpid) &&
+ Bool_t goodtrack = (track->GetStatus() & AliESDtrack::kTOFout) &&
+ (track->GetStatus() & AliESDtrack::kTIME) &&
(track->GetTOFsignal() > 12000) &&
(track->GetTOFsignal() < 100000) &&
(track->GetIntegratedLength() > 365);
fBayesianResponse->ComputeProb(track,fCurrCentr); // fCurrCentr is needed for mismatch fraction
Float_t *probabilities = fBayesianResponse->GetProb(); // Bayesian Probability (from 0 to 4) (Combined TPC || TOF) including a tuning of priors and TOF mismatch parameterization
- fProbBayes[0] = probabilities[0];
- fProbBayes[1] = probabilities[1];
- fProbBayes[2] = probabilities[2];
- fProbBayes[3] = probabilities[3];
- fProbBayes[4] = probabilities[4];
Float_t mismProb = fBayesianResponse->GetTOFMismProb(); // mismatch Bayesian probabilities
- Float_t prob = 0;
+ fProbBayes = 0.0;
+
switch (fParticleID)
{
case AliPID::kPion:
- prob = fProbBayes[2];
+ fProbBayes = probabilities[2];
break;
case AliPID::kKaon:
- prob = fProbBayes[3];
+ fProbBayes = probabilities[3];
break;
case AliPID::kProton:
- prob = fProbBayes[4];
+ fProbBayes = probabilities[4];
break;
case AliPID::kElectron:
- prob = fProbBayes[0];
+ fProbBayes = probabilities[0];
break;
- default:
+ case AliPID::kMuon:
+ fProbBayes = probabilities[1];
+ break;
+ case AliPID::kDeuteron:
+ fProbBayes = probabilities[5];
+ break;
+ case AliPID::kTriton:
+ fProbBayes = probabilities[6];
+ break;
+ case AliPID::kHe3:
+ fProbBayes = probabilities[7];
+ break;
+ default:
return kFALSE;
}
// printf("pt = %f -- all prob = [%4.2f,%4.2f,%4.2f,%4.2f,%4.2f] -- prob = %f\n",track->Pt(),fProbBayes[0],fProbBayes[1],fProbBayes[2],fProbBayes[3],fProbBayes[4],prob);
- if(prob > fParticleProbability && mismProb < 0.5){
+ if(fProbBayes > fParticleProbability && mismProb < 0.5){
if(!fCutCharge)
return kTRUE;
else if (fCutCharge && fCharge * track->GetSign() > 0)
return select;
}
// end part added by Natasha
-
-
-
-//-----------------------------------------------------------------------
-Int_t AliFlowTrackCuts::GetESDPdg(const AliESDtrack *track,Option_t *option,Int_t ipart,Float_t cPi,Float_t cKa,Float_t cPr)
-{
- //Get ESD Pdg
- Int_t pdg = 0;
- Int_t pdgvalues[5] = {-11,-13,211,321,2212};
- Float_t mass[5] = {5.10998909999999971e-04,1.05658000000000002e-01,1.39570000000000000e-01,4.93676999999999977e-01,9.38271999999999995e-01};
-
- if(strstr(option,"bayesianTOF")){ // Bayesian TOF PID
- Double_t c[5]={0.01, 0.01, 0.85, 0.1, 0.05};
- Double_t rcc=0.;
-
- Float_t pt = track->Pt();
-
- Int_t iptesd = 0;
- while(pt > fBinLimitPID[iptesd] && iptesd < fgkPIDptBin-1) iptesd++;
-
- if(cPi < 0){
- c[0] = fC[iptesd][0];
- c[1] = fC[iptesd][1];
- c[2] = fC[iptesd][2];
- c[3] = fC[iptesd][3];
- c[4] = fC[iptesd][4];
- }
- else{
- c[0] = 0.0;
- c[1] = 0.0;
- c[2] = cPi;
- c[3] = cKa;
- c[4] = cPr;
- }
-
- Double_t r1[10]; track->GetTOFpid(r1);
-
- Int_t i;
- for (i=0; i<5; i++) rcc+=(c[i]*r1[i]);
-
- Double_t w[10];
- for (i=0; i<5; i++){
- w[i]=c[i]*r1[i]/rcc;
- fProbBayes[i] = w[i];
- }
- if (w[2]>=w[3] && w[2]>=w[4] && w[2]>=w[1] && w[2]>=w[0]) {//pion
- pdg = 211*Int_t(track->GetSign());
- }
- else if (w[4]>=w[3] && w[4]>=w[1] && w[4]>=w[0]) {//proton
- pdg = 2212*Int_t(track->GetSign());
- }
- else if (w[3]>=w[1] && w[3]>=w[0]){//kaon
- pdg = 321*Int_t(track->GetSign());
- }
- else if (w[0]>=w[1]) { //electrons
- pdg = -11*Int_t(track->GetSign());
- }
- else{ // muon
- pdg = -13*Int_t(track->GetSign());
- }
- }
-
- else if(strstr(option,"bayesianTPC")){ // Bayesian TPC PID
- Double_t c[5]={0.01, 0.01, 0.85, 0.1, 0.05};
- Double_t rcc=0.;
-
- Float_t pt = track->Pt();
-
- Int_t iptesd = 0;
- while(pt > fBinLimitPID[iptesd] && iptesd < fgkPIDptBin-1) iptesd++;
-
- if(cPi < 0){
- c[0] = fC[iptesd][0];
- c[1] = fC[iptesd][1];
- c[2] = fC[iptesd][2];
- c[3] = fC[iptesd][3];
- c[4] = fC[iptesd][4];
- }
- else{
- c[0] = 0.0;
- c[1] = 0.0;
- c[2] = cPi;
- c[3] = cKa;
- c[4] = cPr;
- }
-
- Double_t r1[10]; track->GetTPCpid(r1);
-
- Int_t i;
- for (i=0; i<5; i++) rcc+=(c[i]*r1[i]);
-
- Double_t w[10];
- for (i=0; i<5; i++){
- w[i]=c[i]*r1[i]/rcc;
- fProbBayes[i] = w[i];
- }
- if (w[2]>=w[3] && w[2]>=w[4] && w[2]>=w[1] && w[2]>=w[0]) {//pion
- pdg = 211*Int_t(track->GetSign());
- }
- else if (w[4]>=w[3] && w[4]>=w[1] && w[4]>=w[0]) {//proton
- pdg = 2212*Int_t(track->GetSign());
- }
- else if (w[3]>=w[1] && w[3]>=w[0]){//kaon
- pdg = 321*Int_t(track->GetSign());
- }
- else if (w[0]>=w[1]) { //electrons
- pdg = -11*Int_t(track->GetSign());
- }
- else{ // muon
- pdg = -13*Int_t(track->GetSign());
- }
- }
-
- else if(strstr(option,"bayesianALL")){
- Double_t c[5]={0.01, 0.01, 0.85, 0.1, 0.05};
- Double_t rcc=0.;
-
- Float_t pt = track->Pt();
-
- Int_t iptesd = 0;
- while(pt > fBinLimitPID[iptesd] && iptesd < fgkPIDptBin-1) iptesd++;
-
- if(cPi < 0){
- c[0] = fC[iptesd][0];
- c[1] = fC[iptesd][1];
- c[2] = fC[iptesd][2];
- c[3] = fC[iptesd][3];
- c[4] = fC[iptesd][4];
- }
- else{
- c[0] = 0.0;
- c[1] = 0.0;
- c[2] = cPi;
- c[3] = cKa;
- c[4] = cPr;
- }
-
- Double_t r1[10]; track->GetTOFpid(r1);
- Double_t r2[10]; track->GetTPCpid(r2);
-
- r1[0] = TMath::Min(r1[2],r1[0]);
- r1[1] = TMath::Min(r1[2],r1[1]);
-
- Int_t i;
- for (i=0; i<5; i++) rcc+=(c[i]*r1[i]*r2[i]);
-
-
- Double_t w[10];
- for (i=0; i<5; i++){
- w[i]=c[i]*r1[i]*r2[i]/rcc;
- fProbBayes[i] = w[i];
- }
-
- if (w[2]>=w[3] && w[2]>=w[4] && w[2]>=w[1] && w[2]>=w[0]) {//pion
- pdg = 211*Int_t(track->GetSign());
- }
- else if (w[4]>=w[3] && w[4]>=w[1] && w[4]>=w[0]) {//proton
- pdg = 2212*Int_t(track->GetSign());
- }
- else if (w[3]>=w[1] && w[3]>=w[0]){//kaon
- pdg = 321*Int_t(track->GetSign());
- }
- else if (w[0]>=w[1]) { //electrons
- pdg = -11*Int_t(track->GetSign());
- }
- else{ // muon
- pdg = -13*Int_t(track->GetSign());
- }
- }
-
- else if(strstr(option,"sigmacutTOF")){
- printf("PID not implemented yet: %s\nNO PID!!!!\n",option);
- Float_t p = track->P();
-
- // Take expected times
- Double_t exptimes[5];
- track->GetIntegratedTimes(exptimes);
-
- // Take resolution for TOF response
- // like fESDpid.GetTOFResponse().GetExpectedSigma(p, exptimes[ipart], mass[ipart]);
- Float_t resolution = fESDpid.GetTOFResponse().GetExpectedSigma(p, exptimes[ipart], mass[ipart]);
-
- if(TMath::Abs(exptimes[ipart] - track->GetTOFsignal()) < 3 * resolution){
- pdg = pdgvalues[ipart] * Int_t(track->GetSign());
- }
- }
-
- else{
- printf("Invalid PID option: %s\nNO PID!!!!\n",option);
- }
-
- return pdg;
-}
-
//-----------------------------------------------------------------------
void AliFlowTrackCuts::SetPriors(Float_t centrCur){
fCurrCentr = centrCur;
Float_t GetPmdNcell() const {return fPmdNcell; }
Float_t GetBeta(const AliESDtrack* t);
Float_t Getdedx(const AliESDtrack* t) const;
- Float_t GetBayesianProb() const {return TMath::MaxElement(5,fProbBayes);};
+ Float_t GetBayesianProb() const {return fProbBayes;};
void SetQA(Bool_t b=kTRUE) {if (b) DefineHistograms();}
TList* GetQA() const {return fQA;}
// part added by F. Noferini
Bool_t PassesTOFbayesianCut(const AliESDtrack* track);
Bool_t PassesNucleiSelection(const AliESDtrack* track); // added by Natasha
- Int_t GetESDPdg(const AliESDtrack *track,Option_t *option="bayesianTOF",Int_t ipart=2,Float_t cPi=-1.0,Float_t cKa=0.0,Float_t cPr=0.0); // 3sigma cut ipart=0(el),1(mu),2(pi),3(K),4(p)
Bool_t TPCTOFagree(const AliESDtrack *track);
// end part added by F. Noferini
// part added by F. Noferini
static const Int_t fgkPIDptBin = 20; // pT bins for priors
Float_t fC[fgkPIDptBin][5],fBinLimitPID[fgkPIDptBin]; // pt bin limit and priors
- Float_t fProbBayes[5]; // bayesian probability
+ Float_t fProbBayes; // bayesian probability
Float_t fCurrCentr; // current centrality used for set the priors
// end part added by F. Noferini
static const Int_t fgkNumberOfV0tracks=64; //number of V0 channels
- ClassDef(AliFlowTrackCuts,10)
+ ClassDef(AliFlowTrackCuts,11)
};
#endif