1 /**************************************************************************
2 * Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 * *************************************************************************/
19 //***********************************************************
21 // class for PID with AliAODRecoDecayHF
22 // 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 P. Antonioli pietro.antonioli@bo.infn.it
23 //***********************************************************
24 #include "AliAODPidHF.h"
25 #include "AliAODPid.h"
27 #include "AliPIDResponse.h"
28 #include "AliAODpidUtil.h"
29 #include "AliESDtrack.h"
34 //------------------------------
35 AliAODPidHF::AliAODPidHF():
60 fPtThresholdTPC(999999.),
64 // Default constructor
66 fPLimit=new Double_t[fnPLimit];
67 fnSigma=new Double_t[fnNSigma];
68 fPriors=new Double_t[fnPriors];
69 fnSigmaCompat=new Double_t[fnNSigmaCompat];
71 for(Int_t i=0;i<fnNSigma;i++){
74 for(Int_t i=0;i<fnPriors;i++){
77 for(Int_t i=0;i<fnPLimit;i++){
80 for(Int_t i=0;i<fnNSigmaCompat;i++){
85 //----------------------
86 AliAODPidHF::~AliAODPidHF()
89 // if(fPLimit) delete fPLimit;
90 // if(fnSigma) delete fnSigma;
91 // if(fPriors) delete fPriors;
93 //------------------------
94 AliAODPidHF::AliAODPidHF(const AliAODPidHF& pid) :
96 fnNSigma(pid.fnNSigma),
98 fTOFSigma(pid.fTOFSigma),
99 fnPriors(pid.fnPriors),
100 fPriors(pid.fPriors),
101 fnPLimit(pid.fnPLimit),
102 fPLimit(pid.fPLimit),
109 fCompat(pid.fCompat),
110 fPCompatTOF(pid.fPCompatTOF),
111 fnNSigmaCompat(pid.fnNSigmaCompat),
112 fnSigmaCompat(pid.fnSigmaCompat),
114 fOnePad(pid.fOnePad),
115 fMCLowEn2011(pid.fMCLowEn2011),
117 fTOFdecide(pid.fTOFdecide),
118 fOldPid(pid.fOldPid),
119 fPtThresholdTPC(pid.fPtThresholdTPC),
120 fPidResponse(pid.fPidResponse)
123 for(Int_t i=0;i<5;i++){
124 fPriors[i]=pid.fPriors[i];
129 //----------------------
130 Int_t AliAODPidHF::RawSignalPID(AliAODTrack *track, TString detector) const{
131 // raw PID for single detectors, returns the particle type with smaller sigma
133 if(detector.Contains("ITS")) return ApplyPidITSRaw(track,specie);
134 if(detector.Contains("TPC")) return ApplyPidTPCRaw(track,specie);
135 if(detector.Contains("TOF")) return ApplyPidTOFRaw(track,specie);
140 //---------------------------
141 Bool_t AliAODPidHF::IsKaonRaw(AliAODTrack *track, TString detector) const{
142 // checks if the track can be a kaon, raw PID applied for single detectors
145 if(detector.Contains("ITS")) specie=ApplyPidITSRaw(track,3);
146 if(detector.Contains("TPC")) specie=ApplyPidTPCRaw(track,3);
147 if(detector.Contains("TOF")) specie=ApplyPidTOFRaw(track,3);
149 if(specie==3) return kTRUE;
152 //---------------------------
153 Bool_t AliAODPidHF::IsPionRaw (AliAODTrack *track, TString detector) const{
154 // checks if the track can be a pion, raw PID applied for single detectors
158 if(detector.Contains("ITS")) specie=ApplyPidITSRaw(track,2);
159 if(detector.Contains("TPC")) specie=ApplyPidTPCRaw(track,2);
160 if(detector.Contains("TOF")) specie=ApplyPidTOFRaw(track,2);
162 if(specie==2) return kTRUE;
165 //---------------------------
166 Bool_t AliAODPidHF::IsProtonRaw (AliAODTrack *track, TString detector) const{
167 // checks if the track can be a proton raw PID applied for single detectors
170 if(detector.Contains("ITS")) specie=ApplyPidITSRaw(track,4);
171 if(detector.Contains("TPC")) specie=ApplyPidTPCRaw(track,4);
172 if(detector.Contains("TOF")) specie=ApplyPidTOFRaw(track,4);
174 if(specie==4) return kTRUE;
178 //--------------------------
179 Bool_t AliAODPidHF::IsElectronRaw(AliAODTrack *track, TString detector) const{
180 // checks if the track can be an electron raw PID applied for single detectors
183 if(detector.Contains("ITS")) specie=ApplyPidITSRaw(track,0);
184 if(detector.Contains("TPC")) specie=ApplyPidTPCRaw(track,0);
185 if(detector.Contains("TOF")) specie=ApplyPidTOFRaw(track,0);
187 if(specie==0) return kTRUE;
191 //--------------------------
192 Int_t AliAODPidHF::ApplyPidTPCRaw(AliAODTrack *track,Int_t specie) const{
193 // n-sigma cut, TPC PID
195 if(!CheckStatus(track,"TPC")) return 0;
198 AliAODPid *pidObj = track->GetDetPid();
200 Double_t dedx=pidObj->GetTPCsignal();
201 Double_t mom = pidObj->GetTPCmomentum();
202 if(mom>fPtThresholdTPC) return 0;
203 AliTPCPIDResponse tpcResponse;
204 SetBetheBloch(tpcResponse);
205 UShort_t nTPCClus=pidObj->GetTPCsignalN();
206 if(nTPCClus==0) {nTPCClus=track->GetTPCNcls();}
208 if(specie<0){ // from RawSignalPID : should return the particle specie to wich the de/dx is closer to the bethe-block curve -> performance to be checked
209 Double_t nsigmaMax=fnSigma[0];
210 for(Int_t ipart=0;ipart<5;ipart++){
211 AliPID::EParticleType type=AliPID::EParticleType(ipart);
212 Double_t nsigma = TMath::Abs(tpcResponse.GetNumberOfSigmas(mom,dedx,nTPCClus,type));
213 if((nsigma<nsigmaMax) && (nsigma<fnSigma[0])) {
218 }else{ // asks only for one particle specie
219 AliPID::EParticleType type=AliPID::EParticleType(specie);
220 Double_t nsigma = TMath::Abs(tpcResponse.GetNumberOfSigmas(mom,dedx,nTPCClus,type));
221 if (nsigma>fnSigma[0]) {
228 if(specie<0){ // from RawSignalPID : should return the particle specie to wich the de/dx is closer to the bethe-block curve -> performance to be checked
229 Double_t nsigmaMax=fnSigma[0];
230 for(Int_t ipart=0;ipart<5;ipart++){
231 AliPID::EParticleType type=AliPID::EParticleType(ipart);
232 Double_t nsigma = TMath::Abs(fPidResponse->NumberOfSigmasTPC(track,type));
233 if((nsigma<nsigmaMax) && (nsigma<fnSigma[0])) {
238 }else{ // asks only for one particle specie
239 AliPID::EParticleType type=AliPID::EParticleType(specie);
240 Double_t nsigma = TMath::Abs(fPidResponse->NumberOfSigmasTPC(track,type));
241 if (nsigma>fnSigma[0]) {
253 //----------------------------
254 Int_t AliAODPidHF::ApplyPidITSRaw(AliAODTrack *track,Int_t specie) const{
255 // truncated mean, ITS PID
257 if(!CheckStatus(track,"ITS")) return 0;
261 Double_t mom=track->P();
262 AliAODPid *pidObj = track->GetDetPid();
264 Double_t dedx=pidObj->GetITSsignal();
265 UChar_t clumap=track->GetITSClusterMap();
266 Int_t nPointsForPid=0;
267 for(Int_t i=2; i<6; i++){
268 if(clumap&(1<<i)) ++nPointsForPid;
272 if(track->GetStatus() & AliESDtrack::kTPCin) isSA = kFALSE;
274 AliITSPIDResponse itsResponse;
275 if(specie<0){ // from RawSignalPID : should return the particle specie to wich the de/dx is closer to the bethe-block curve -> performance to be checked
276 Double_t nsigmaMax=fnSigma[4];
277 for(Int_t ipart=0;ipart<5;ipart++){
278 AliPID::EParticleType type=AliPID::EParticleType(ipart);
279 Double_t nsigma = TMath::Abs(itsResponse.GetNumberOfSigmas(mom,dedx,type,nPointsForPid,isSA));
280 if((nsigma<nsigmaMax) && (nsigma<fnSigma[4])) {
285 }else{ // asks only for one particle specie
286 AliPID::EParticleType type=AliPID::EParticleType(specie);
287 Double_t nsigma = TMath::Abs(itsResponse.GetNumberOfSigmas(mom,dedx,type));
288 if (nsigma>fnSigma[4]) {
296 if(specie<0){ // from RawSignalPID : should return the particle specie to wich the de/dx is closer to the bethe-block curve -> performance to be checked
297 Double_t nsigmaMax=fnSigma[4];
298 for(Int_t ipart=0;ipart<5;ipart++){
299 AliPID::EParticleType type=AliPID::EParticleType(ipart);
300 Double_t nsigma = TMath::Abs(fPidResponse->NumberOfSigmasITS(track,type));
301 if((nsigma<nsigmaMax) && (nsigma<fnSigma[4])) {
306 }else{ // asks only for one particle specie
307 AliPID::EParticleType type=AliPID::EParticleType(specie);
308 Double_t nsigma = TMath::Abs(fPidResponse->NumberOfSigmasITS(track,type));
309 if (nsigma>fnSigma[4]) {
319 //----------------------------
320 Int_t AliAODPidHF::ApplyPidTOFRaw(AliAODTrack *track,Int_t specie) const{
321 // n-sigma cut, TOF PID
323 if(!CheckStatus(track,"TOF")) return 0;
325 Double_t time[AliPID::kSPECIESN];
326 Double_t sigmaTOFPid[AliPID::kSPECIES];
327 AliAODPid *pidObj = track->GetDetPid();
328 pidObj->GetIntegratedTimes(time);
329 Double_t sigTOF=pidObj->GetTOFsignal();
330 pidObj->GetTOFpidResolution(sigmaTOFPid);
335 Double_t sigmaTOFtrack;
336 if (sigmaTOFPid[4]>0) sigmaTOFtrack=sigmaTOFPid[4];
337 else sigmaTOFtrack=fTOFSigma;
338 Double_t nsigmaMax=sigmaTOFtrack*fnSigma[3];
339 for(Int_t ipart=0;ipart<5;ipart++){
340 Double_t nsigma=TMath::Abs(sigTOF-time[ipart]);
341 if (sigmaTOFPid[ipart]>0) sigmaTOFtrack=sigmaTOFPid[ipart];
342 else sigmaTOFtrack=fTOFSigma; // backward compatibility for old AODs
343 if((nsigma<nsigmaMax) && (nsigma<fnSigma[3]*sigmaTOFtrack)) {
348 }else{ // asks only for one particle specie
349 Double_t nsigma=TMath::Abs(sigTOF-time[specie]);
350 Double_t sigmaTOFtrack;
351 if (sigmaTOFPid[specie]>0) sigmaTOFtrack=sigmaTOFPid[specie];
352 else sigmaTOFtrack=fTOFSigma; // backward compatibility for old AODs
353 if (nsigma>fnSigma[3]*sigmaTOFtrack) {
362 //------------------------------
363 void AliAODPidHF::CombinedProbability(AliAODTrack *track,Bool_t *type) const{
364 // combined PID stored inside the AOD track
366 const Double_t *pid=track->PID();
369 for (Int_t i=0; i<10; i++) {
370 if (pid[i]>max) {k=i; max=pid[i];}
373 if(k==2) type[0]=kTRUE;
374 if(k==3) type[1]=kTRUE;
375 if(k==4) type[2]=kTRUE;
379 //--------------------
380 void AliAODPidHF::BayesianProbability(AliAODTrack *track,Double_t *pid) const{
381 // bayesian PID for single detectors or combined
383 if(fITS && !fTPC && !fTOF) {BayesianProbabilityITS(track,pid);return;}
384 if(fTPC && !fITS && !fTOF) {BayesianProbabilityTPC(track,pid);return;}
385 if(fTOF && !fITS && !fTPC) {BayesianProbabilityTOF(track,pid);return;}
387 Double_t probITS[5]={1.,1.,1.,1.,1.};
388 Double_t probTPC[5]={1.,1.,1.,1.,1.};
389 Double_t probTOF[5]={1.,1.,1.,1.,1.};
390 if(fITS) BayesianProbabilityITS(track,probITS);
391 if(fTPC) BayesianProbabilityTPC(track,probTPC);
392 if(fTOF) BayesianProbabilityTOF(track,probTOF);
393 Double_t probTot[5]={0.,0.,0.,0.,0.};
394 for(Int_t i=0;i<5;i++){
395 probTot[i]=probITS[i]*probTPC[i]*probTOF[i];
397 for(Int_t i2=0;i2<5;i2++){
398 pid[i2]=probTot[i2]*fPriors[i2]/(probTot[0]*fPriors[0]+probTot[1]*fPriors[1]+probTot[2]*fPriors[2]+probTot[3]*fPriors[3]+probTot[4]*fPriors[4]);
404 //------------------------------------
405 void AliAODPidHF::BayesianProbabilityITS(AliAODTrack *track,Double_t *prob) const{
407 // bayesian PID for ITS
409 Double_t itspid[AliPID::kSPECIES];
410 pid.MakeITSPID(track,itspid);
411 for(Int_t ind=0;ind<AliPID::kSPECIES;ind++){
412 if(fTOF || fTPC || fTRD){
413 prob[ind]=itspid[ind];
415 prob[ind]=itspid[ind]*fPriors[ind]/(itspid[0]*fPriors[0]+itspid[1]*fPriors[1]+itspid[2]*fPriors[2]+itspid[3]*fPriors[3]+itspid[4]*fPriors[4]);
421 //------------------------------------
422 void AliAODPidHF::BayesianProbabilityTPC(AliAODTrack *track,Double_t *prob) const{
423 // bayesian PID for TPC
426 Double_t tpcpid[AliPID::kSPECIES];
427 pid.MakeTPCPID(track,tpcpid);
428 for(Int_t ind=0;ind<AliPID::kSPECIES;ind++){
429 if(fTOF || fITS || fTRD){
430 prob[ind]=tpcpid[ind];
432 prob[ind]=tpcpid[ind]*fPriors[ind]/(tpcpid[0]*fPriors[0]+tpcpid[1]*fPriors[1]+tpcpid[2]*fPriors[2]+tpcpid[3]*fPriors[3]+tpcpid[4]*fPriors[4]);
438 //------------------------------------
439 void AliAODPidHF::BayesianProbabilityTOF(AliAODTrack *track,Double_t *prob) const{
440 // bayesian PID for TOF
443 Double_t tofpid[AliPID::kSPECIES];
444 pid.MakeTOFPID(track,tofpid);
445 for(Int_t ind=0;ind<AliPID::kSPECIES;ind++){
446 if(fTPC || fITS || fTRD){
447 prob[ind]=tofpid[ind];
449 prob[ind]=tofpid[ind]*fPriors[ind]/(tofpid[0]*fPriors[0]+tofpid[1]*fPriors[1]+tofpid[2]*fPriors[2]+tofpid[3]*fPriors[3]+tofpid[4]*fPriors[4]);
455 //---------------------------------
456 void AliAODPidHF::BayesianProbabilityTRD(AliAODTrack *track,Double_t *prob) const{
457 // bayesian PID for TRD
460 Double_t trdpid[AliPID::kSPECIES];
461 pid.MakeTRDPID(track,trdpid);
462 for(Int_t ind=0;ind<AliPID::kSPECIES;ind++){
463 if(fTPC || fITS || fTOF){
464 prob[ind]=trdpid[ind];
466 prob[ind]=trdpid[ind]*fPriors[ind]/(trdpid[0]*fPriors[0]+trdpid[1]*fPriors[1]+trdpid[2]*fPriors[2]+trdpid[3]*fPriors[3]+trdpid[4]*fPriors[4]);
472 //--------------------------------
473 Bool_t AliAODPidHF::CheckStatus(AliAODTrack *track,TString detectors) const{
475 // Quality cuts on the tracks, detector by detector
477 if(detectors.Contains("ITS")){
478 if ((track->GetStatus()&AliESDtrack::kITSin)==0) return kFALSE;
479 UChar_t clumap=track->GetITSClusterMap();
480 Int_t nPointsForPid=0;
481 for(Int_t i=2; i<6; i++){
482 if(clumap&(1<<i)) ++nPointsForPid;
484 if(nPointsForPid<3) return kFALSE;
487 if(detectors.Contains("TPC")){
488 if ((track->GetStatus()&AliESDtrack::kTPCin )==0) return kFALSE;
489 UShort_t nTPCClus=track->GetTPCClusterMap().CountBits();
490 if (nTPCClus<70) return kFALSE;
493 if(detectors.Contains("TOF")){
494 if ((track->GetStatus()&AliESDtrack::kTOFout )==0) return kFALSE;
495 if ((track->GetStatus()&AliESDtrack::kTIME )==0) return kFALSE;
496 if ((track->GetStatus()&AliESDtrack::kTOFpid )==0) return kFALSE;
497 if (!(track->GetStatus()&AliESDtrack::kTOFmismatch)==0) return kFALSE;
501 if(detectors.Contains("TRD")){
502 if ((track->GetStatus()&AliESDtrack::kTRDout )==0) return kFALSE;
503 AliAODPid *pidObj = track->GetDetPid();
504 Float_t *mom=pidObj->GetTRDmomentum();
506 for(Int_t iPl=0;iPl<6;iPl++){
507 if(mom[iPl]>0.) ntracklets++;
509 if(ntracklets<4) return kFALSE;
514 //--------------------------------------------
515 Bool_t AliAODPidHF::TPCRawAsym(AliAODTrack* track,Int_t specie) const{
516 // TPC nsigma cut PID, different sigmas in different p bins
518 if(!CheckStatus(track,"TPC")) return kFALSE;
519 AliAODPid *pidObj = track->GetDetPid();
520 Double_t mom = pidObj->GetTPCmomentum();
521 if(mom>fPtThresholdTPC) return 0;
522 Double_t nsigma=999.;
524 Double_t dedx=pidObj->GetTPCsignal();
525 UShort_t nTPCClus=pidObj->GetTPCsignalN();
526 if(nTPCClus==0) {nTPCClus=track->GetTPCNcls();}
528 AliTPCPIDResponse tpcResponse;
529 SetBetheBloch(tpcResponse);
530 AliPID::EParticleType type=AliPID::EParticleType(specie);
531 nsigma = TMath::Abs(tpcResponse.GetNumberOfSigmas(mom,dedx,nTPCClus,type));
534 AliPID::EParticleType type=AliPID::EParticleType(specie);
535 nsigma = TMath::Abs(fPidResponse->NumberOfSigmasTPC(track,type));
538 if(mom<fPLimit[0] && nsigma<fnSigma[0]) return kTRUE;
539 if(mom<fPLimit[1] && mom>fPLimit[0] && nsigma<fnSigma[1]) return kTRUE;
540 if(mom>fPLimit[1] && nsigma<fnSigma[2]) return kTRUE;
545 Int_t AliAODPidHF::MatchTPCTOF(AliAODTrack *track,Int_t mode,Int_t specie,Bool_t compat){
546 // combination of the PID info coming from TPC and TOF
548 //TOF || TPC (a la' Andrea R.)
550 // for the single detectors: -1 = kFALSE, 1 = kTRUE, 0 = compatible
551 // the method returns the sum of the response of the 2 detectors
552 if(fTPC && fTOF) {if(!CheckStatus(track,"TPC") && !CheckStatus(track,"TOF")) return 0;}
557 if(CheckStatus(track,"TPC")) {
559 if(TPCRawAsym(track,specie)) {
565 if(specie==2 && IsPionRaw(track,"TPC")) {
570 if(specie==3 && IsKaonRaw(track,"TPC")) {
575 if(specie==4 && IsProtonRaw(track,"TPC")) {
584 if(compat && tTPCinfo<0){
585 Double_t sig0tmp=fnSigma[0];
586 SetSigma(0,fnSigmaCompat[0]);
587 if(specie==2 && IsPionRaw(track,"TPC")) tTPCinfo=0;
588 if(specie==3 && IsKaonRaw(track,"TPC")) tTPCinfo=0;
589 if(specie==4 && IsProtonRaw(track,"TPC")) tTPCinfo=0;
598 if(!CheckStatus(track,"TOF") && fTPC) return tTPCinfo;
602 if(specie==2 && IsPionRaw(track,"TOF")) tTOFinfo=1;
603 if(specie==3 && IsKaonRaw(track,"TOF")) tTOFinfo=1;
604 if(specie==4 && IsProtonRaw(track,"TOF")) tTOFinfo=1;
606 if(compat && tTOFinfo>0){
607 Double_t ptrack=track->P();
608 if(ptrack>fPCompatTOF) {
609 Double_t sig0tmp=fnSigma[3];
610 SetSigma(3,fnSigmaCompat[1]);
611 if(specie==2 && IsPionRaw(track,"TOF")) tTOFinfo=0;
612 if(specie==3 && IsKaonRaw(track,"TOF")) tTOFinfo=0;
613 if(specie==4 && IsProtonRaw(track,"TOF")) tTOFinfo=0;
620 if(tTPCinfo+tTOFinfo==0 && fTOFdecide){
621 if(!CheckStatus(track,"TOF")) return tTPCinfo;
625 if(tTPCinfo+tTOFinfo==0 && fITS){
626 if(!CheckStatus(track,"ITS")) return tTPCinfo+tTOFinfo;
628 if(specie==2 && IsPionRaw(track,"ITS")) tITSinfo=1;
629 if(specie==3 && IsKaonRaw(track,"ITS")) tITSinfo=1;
630 if(specie==4 && IsProtonRaw(track,"ITS")) tITSinfo=1;
634 return tTPCinfo+tTOFinfo;
637 //TPC & TOF (a la' Yifei)
638 // convention: -1 = kFALSE, 1 = kTRUE, 0 = not identified
641 if(fTPC && CheckStatus(track,"TPC")) {
644 if(!TPCRawAsym(track,specie)) tTPCinfo=-1;
646 if(specie==2 && !IsPionRaw(track,"TPC")) tTPCinfo=-1;
647 if(specie==3 && !IsKaonRaw(track,"TPC")) tTPCinfo=-1;
648 if(specie==4 && !IsProtonRaw(track,"TPC")) tTPCinfo=-1;
654 if(fTPC && !CheckStatus(track,"TOF")) return tTPCinfo;
656 if(specie==2 && !IsPionRaw(track,"TOF")) tTOFinfo=-1;
657 if(specie==3 && !IsKaonRaw(track,"TOF")) tTOFinfo=-1;
658 if(specie==4 && !IsProtonRaw(track,"TOF")) tTOFinfo=-1;
661 if(tTOFinfo==1 && tTPCinfo==1) return 1;
663 if(tTPCinfo+tTOFinfo==0 && fITS){
664 if(!CheckStatus(track,"ITS")) return tTPCinfo+tTOFinfo;
666 if(specie==2 && IsPionRaw(track,"ITS")) tITSinfo=1;
667 if(specie==3 && IsKaonRaw(track,"ITS")) tITSinfo=1;
668 if(specie==4 && IsProtonRaw(track,"ITS")) tITSinfo=1;
677 //TPC for p<fPLimit[0], TOF for p>=fPLimit[0] (a la' Andrea A.)
678 // convention (temporary): -1 = kFALSE, 1 = kTRUE, 0 = not identified
680 if(fTPC && fTOF) if(!CheckStatus(track,"TPC") && !CheckStatus(track,"TOF")) return 0;
682 Double_t ptrack=track->P();
687 if(ptrack>=fPLimit[0] && ptrack<fPLimit[1] && fTPC) {
688 if(!CheckStatus(track,"TPC")) return 0;
690 if(TPCRawAsym(track,specie)) tTPCinfo=1;
692 if(specie==2 && IsPionRaw(track,"TPC")) tTPCinfo=1;
693 if(specie==3 && IsKaonRaw(track,"TPC")) tTPCinfo=1;
694 if(specie==4 && IsProtonRaw(track,"TPC")) tTPCinfo=1;
700 if(ptrack>=fPLimit[1] && fTOF){
701 if(!CheckStatus(track,"TOF")) return 0;
702 if(specie==2 && IsPionRaw(track,"TOF")) tTOFinfo=1;
703 if(specie==3 && IsKaonRaw(track,"TOF")) tTOFinfo=1;
704 if(specie==4 && IsProtonRaw(track,"TOF")) tTOFinfo=1;
709 if(ptrack<fPLimit[0] && fITS){
710 if(!CheckStatus(track,"ITS")) return 0;
711 if(specie==2 && IsPionRaw(track,"ITS")) tITSinfo=1;
712 if(specie==3 && IsKaonRaw(track,"ITS")) tITSinfo=1;
713 if(specie==4 && IsProtonRaw(track,"ITS")) tITSinfo=1;
722 //----------------------------------
723 Int_t AliAODPidHF::MakeRawPid(AliAODTrack *track, Int_t specie){
724 // general method to compute PID
726 return MatchTPCTOF(track,fMatch,specie,fCompat);
728 if(fTPC && !fTOF && !fITS) {
731 tTPCres=ApplyPidTPCRaw(track,specie);
733 if(TPCRawAsym(track,specie)) {
739 if(tTPCres==specie){return 1;}else{return tTPCres;};
741 AliError("You should enable just one detector if you don't want to match");
744 if(fTOF && !fTPC && !fITS) {
745 Int_t tTOFres=ApplyPidTOFRaw(track,specie);
746 if(tTOFres==specie){return 1;}else{return tTOFres;};
748 AliError("You should enable just one detector if you don't want to match");
752 if(fITS && !fTPC && !fTOF) {
753 Int_t tITSres=ApplyPidITSRaw(track,specie);
754 if(tITSres==specie){return 1;}else{return tITSres;};
756 AliError("You should enable just one detector if you don't want to match");
762 //--------------------------------------------
763 void AliAODPidHF::SetBetheBloch(AliTPCPIDResponse &tpcResp) const{
765 Double_t alephParameters[5];
769 if(fPbPb) { // PbPb MC
771 alephParameters[0] = 1.44405/50.;
772 alephParameters[1] = 2.35409e+01;
773 alephParameters[2] = TMath::Exp(-2.90330e+01);
774 alephParameters[3] = 2.10681e+00;
775 alephParameters[4] = 4.62254e+00;
779 alephParameters[0]=0.0207667;
780 alephParameters[1]=29.9936;
781 alephParameters[2]=3.87866e-11;
782 alephParameters[3]=2.17291;
783 alephParameters[4]=7.1623;
785 alephParameters[0]=0.029021;
786 alephParameters[1]=25.4181;
787 alephParameters[2]=4.66596e-08;
788 alephParameters[3]=1.90008;
789 alephParameters[4]=4.63783;
791 alephParameters[0] = 2.15898/50.;
792 alephParameters[1] = 1.75295e+01;
793 alephParameters[2] = 3.40030e-09;
794 alephParameters[3] = 1.96178e+00;
795 alephParameters[4] = 3.91720e+00;
799 } else { // Real Data
801 if(fOnePad) { // pp 1-pad (since LHC10d)
803 alephParameters[0] =1.34490e+00/50.;
804 alephParameters[1] = 2.69455e+01;
805 alephParameters[2] = TMath::Exp(-2.97552e+01);
806 alephParameters[3] = 2.35339e+00;
807 alephParameters[4] = 5.98079e+00;
809 } else if(fPbPb) { // PbPb
811 // alephParameters[0] = 1.25202/50.;
812 // alephParameters[1] = 2.74992e+01;
813 // alephParameters[2] = TMath::Exp(-3.31517e+01);
814 // alephParameters[3] = 2.46246;
815 // alephParameters[4] = 6.78938;
817 alephParameters[0] = 5.10207e+00/50.;
818 alephParameters[1] = 7.94982e+00;
819 alephParameters[2] = TMath::Exp(-9.07942e+00);
820 alephParameters[3] = 2.38808e+00;
821 alephParameters[4] = 1.68165e+00;
823 } else { // pp no 1-pad (LHC10bc)
825 alephParameters[0] = 0.0283086/0.97;
826 alephParameters[1] = 2.63394e+01;
827 alephParameters[2] = 5.04114e-11;
828 alephParameters[3] = 2.12543e+00;
829 alephParameters[4] = 4.88663e+00;
835 tpcResp.SetBetheBlochParameters(alephParameters[0],alephParameters[1],alephParameters[2],alephParameters[3],alephParameters[4]);
841 //-----------------------
842 Bool_t AliAODPidHF::IsTOFPiKexcluded(AliAODTrack *track,Double_t nsigmaK){
845 if(!CheckStatus(track,"TOF")) return 0;
847 Double_t time[AliPID::kSPECIESN];
848 Double_t sigmaTOFPid[AliPID::kSPECIES];
849 AliAODPid *pidObj = track->GetDetPid();
850 pidObj->GetIntegratedTimes(time);
851 Double_t sigTOF=pidObj->GetTOFsignal();
852 pidObj->GetTOFpidResolution(sigmaTOFPid);
853 Double_t sigmaTOFtrack;
854 if (sigmaTOFPid[3]>0) sigmaTOFtrack=sigmaTOFPid[3];
855 else sigmaTOFtrack=fTOFSigma; // backward compatibility for old AODs
857 if((sigTOF-time[3])>nsigmaK*sigmaTOFtrack)return kTRUE;// K, Pi excluded (->LIKELY A PROTON)