First version of the pid code for the balance function (Alis Rodriguez Manso)
authorpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Feb 2012 23:41:33 +0000 (23:41 +0000)
committerpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Feb 2012 23:41:33 +0000 (23:41 +0000)
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBF.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBF.h
PWGCF/EBYE/macros/AddTaskBalanceCentralityTrain.C
PWGCF/EBYE/macros/runBalanceFunction.C

index 56f8374..8d1d9d9 100755 (executable)
 #include "AliStack.h"\r
 #include "AliESDtrackCuts.h"\r
 \r
+#include "TH2D.h"                  \r
+#include "AliPID.h"                \r
+#include "AliPIDResponse.h"        \r
+#include "AliPIDCombined.h"        \r
+\r
 #include "AliAnalysisTaskBF.h"\r
 #include "AliBalance.h"\r
 \r
@@ -43,6 +48,7 @@ AliAnalysisTaskBF::AliAnalysisTaskBF(const char *name)
   fList(0),\r
   fListBF(0),\r
   fListBFS(0),\r
+  fHistListPIDQA(0),\r
   fHistEventStats(0),\r
   fHistCentStats(0),\r
   fHistTriggerStats(0),\r
@@ -60,6 +66,27 @@ AliAnalysisTaskBF::AliAnalysisTaskBF(const char *name)
   fHistPhiAfter(0),\r
   fHistV0M(0),\r
   fHistRefTracks(0),\r
+  fHistdEdxVsPTPCbeforePID(NULL),\r
+  fHistBetavsPTOFbeforePID(NULL), \r
+  fHistProbTPCvsPtbeforePID(NULL), \r
+  fHistProbTOFvsPtbeforePID(NULL), \r
+  fHistNSigmaTPCvsPtbeforePID(NULL), \r
+  fHistNSigmaTOFvsPtbeforePID(NULL), \r
+  fHistdEdxVsPTPCafterPID(NULL),\r
+  fHistBetavsPTOFafterPID(NULL), \r
+  fHistProbTPCvsPtafterPID(NULL), \r
+  fHistProbTOFvsPtafterPID(NULL), \r
+  fHistNSigmaTPCvsPtafterPID(NULL), \r
+  fHistNSigmaTOFvsPtafterPID(NULL),  \r
+  fPIDResponse(0x0),\r
+  fPIDCombined(0x0),\r
+  fParticleOfInterest(kPion),\r
+  fPidDetectorConfig(kTPCTOF),\r
+  fUsePID(kFALSE),\r
+  fUsePIDnSigma(kTRUE),\r
+  fUsePIDPropabilities(kFALSE), \r
+  fPIDNSigma(3.),\r
+  fMinAcceptedPIDProbability(0.8),\r
   fESDtrackCuts(0),\r
   fCentralityEstimator("V0M"),\r
   fUseCentrality(kFALSE),\r
@@ -91,7 +118,6 @@ AliAnalysisTaskBF::AliAnalysisTaskBF(const char *name)
   fUseMCPdgCode(kFALSE),\r
   fPDGCodeToBeAnalyzed(-1) {\r
   // Constructor\r
-\r
   // Define input and output slots here\r
   // Input slot #0 works with a TChain\r
   DefineInput(0, TChain::Class());\r
@@ -99,6 +125,7 @@ AliAnalysisTaskBF::AliAnalysisTaskBF(const char *name)
   DefineOutput(1, TList::Class());\r
   DefineOutput(2, TList::Class());\r
   DefineOutput(3, TList::Class());\r
+  DefineOutput(4, TList::Class());\r
 }\r
 \r
 //________________________________________________________________________\r
@@ -160,6 +187,13 @@ void AliAnalysisTaskBF::UserCreateOutputObjects() {
     fListBFS->SetOwner();\r
   }\r
 \r
+  //PID QA list\r
+  if(fUsePID) {\r
+    fHistListPIDQA = new TList();\r
+    fHistListPIDQA->SetName("listQAPID");\r
+    fHistListPIDQA->SetOwner();\r
+  }\r
+\r
   //Event stats.\r
   TString gCutName[4] = {"Total","Offline trigger",\r
                          "Vertex","Analyzed"};\r
@@ -220,9 +254,7 @@ void AliAnalysisTaskBF::UserCreateOutputObjects() {
     fHistRefTracks->GetXaxis()->SetBinLabel(i,gRefTrackName[i-1].Data());\r
   fList->Add(fHistRefTracks);\r
 \r
-\r
   // Balance function histograms\r
-\r
   // Initialize histograms if not done yet\r
   if(!fBalance->GetHistNp(0)){\r
     AliWarning("Histograms not yet initialized! --> Will be done now");\r
@@ -258,10 +290,51 @@ void AliAnalysisTaskBF::UserCreateOutputObjects() {
 \r
   if(fESDtrackCuts) fList->Add(fESDtrackCuts);\r
 \r
+  //====================PID========================//\r
+  if(fUsePID) {\r
+    fHistdEdxVsPTPCbeforePID = new TH2D ("dEdxVsPTPCbefore","dEdxVsPTPCbefore", 1000, -50, 50, 1000, 0, 100); \r
+    fHistListPIDQA->Add(fHistdEdxVsPTPCbeforePID); //addition \r
+    \r
+    fHistBetavsPTOFbeforePID = new TH2D ("BetavsPTOFbefore","BetavsPTOFbefore", 1000, -50, 50, 1000, 0, 1.2); \r
+    fHistListPIDQA->Add(fHistBetavsPTOFbeforePID); //addition\r
+    \r
+    fHistProbTPCvsPtbeforePID = new TH2D ("ProbTPCvsPtbefore","ProbTPCvsPtbefore", 1000, -50, 50, 1000, 0, 100); \r
+    fHistListPIDQA->Add(fHistProbTPCvsPtbeforePID); //addition \r
+    \r
+    fHistProbTOFvsPtbeforePID = new TH2D ("ProbTOFvsPtbefore","ProbTOFvsPtbefore", 1000, -50, 50, 1000, 0, 100); \r
+    fHistListPIDQA->Add(fHistProbTOFvsPtbeforePID); //addition \r
+    \r
+    fHistNSigmaTPCvsPtbeforePID = new TH2D ("NSigmaTPCvsPtbefore","NSigmaTPCvsPtbefore", 1000, -50, 50, 1000, 0, 100); \r
+    fHistListPIDQA->Add(fHistNSigmaTPCvsPtbeforePID); //addition \r
+    \r
+    fHistNSigmaTOFvsPtbeforePID = new TH2D ("NSigmaTOFvsPtbefore","NSigmaTOFvsPtbefore", 1000, -50, 50, 1000, 0, 100); \r
+    fHistListPIDQA->Add(fHistNSigmaTOFvsPtbeforePID); //addition \r
+    \r
+    fHistdEdxVsPTPCafterPID = new TH2D ("dEdxVsPTPCafter","dEdxVsPTPCafter", 1000, -50, 50, 1000, 0, 100); \r
+    fHistListPIDQA->Add(fHistdEdxVsPTPCafterPID); //addition \r
+    \r
+    fHistBetavsPTOFafterPID = new TH2D ("BetavsPTOFafter","BetavsPTOFafter", 1000, -50, 50, 1000, 0, 1.2); \r
+    fHistListPIDQA->Add(fHistBetavsPTOFafterPID); //addition \r
+    \r
+    fHistProbTPCvsPtafterPID = new TH2D ("ProbTPCvsPtafter","ProbTPCvsPtafter", 1000, -50, 50, 1000, 0, 100); \r
+    fHistListPIDQA->Add(fHistProbTPCvsPtafterPID); //addition \r
+  \r
+    fHistProbTOFvsPtafterPID = new TH2D ("ProbTOFvsPtafter","ProbTOFvsPtafter", 1000,  -50, 50, 1000, 0, 100); \r
+    fHistListPIDQA->Add(fHistProbTOFvsPtafterPID); //addition  \r
+    \r
+    fHistNSigmaTPCvsPtafterPID = new TH2D ("NSigmaTPCvsPtafter","NSigmaTPCvsPtafter", 1000, -50, 50, 1000, 0, 100); \r
+    fHistListPIDQA->Add(fHistNSigmaTPCvsPtafterPID); //addition  \r
+    \r
+    fHistNSigmaTOFvsPtafterPID = new TH2D ("NSigmaTOFvsPtafter","NSigmaTOFvsPtafter", 1000, -50, 50, 1000, 0, 100); \r
+    fHistListPIDQA->Add(fHistNSigmaTOFvsPtafterPID); //addition \r
+  }\r
+  //====================PID========================//\r
+\r
   // Post output data.\r
   PostData(1, fList);\r
   PostData(2, fListBF);\r
   if(fRunShuffling) PostData(3, fListBFS);\r
+  if(fUsePID) PostData(4, fHistListPIDQA);       //PID\r
 }\r
 \r
 //________________________________________________________________________\r
@@ -374,6 +447,88 @@ void AliAnalysisTaskBF::UserExec(Option_t *) {
                      //chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);     // global track\r
                    }\r
 \r
+                   //===========================PID===============================//               \r
+                   if(fUsePID) {\r
+                     Double_t prob[AliPID::kSPECIES]={0.};\r
+                     Double_t nSigma = 0.;\r
+                     //Decide what detector configuration we want to use\r
+                     switch(fPidDetectorConfig) {\r
+                     case AliPIDResponse::kDetTPC:\r
+                       fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC);\r
+                       nSigma = fPIDResponse->NumberOfSigmasTPC(track,(AliPID::EParticleType)fParticleOfInterest);\r
+                       break;\r
+                     case AliPIDResponse::kDetTOF:\r
+                       fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTOF);\r
+                       nSigma = fPIDResponse->NumberOfSigmasTOF(track,(AliPID::EParticleType)fParticleOfInterest);\r
+                       break;\r
+                     case AliPIDResponse::AliPIDResponse::kDetTOF|AliPIDResponse::kDetTPC:\r
+                       fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTOF|AliPIDResponse::kDetTPC);\r
+                       break;\r
+                     default:\r
+                       break;\r
+                     }//end switch: define detector mask\r
+                     \r
+                     UInt_t detUsed = fPIDCombined->ComputeProbabilities(track, fPIDResponse, prob);\r
+                     \r
+                     //Filling the PID QA\r
+                     Double_t tofTime = -999., length = 999., tof = -999.;\r
+                     Double_t c = TMath::C()*1.E-9;// m/ns\r
+                     Double_t beta = -999.;\r
+                     Double_t  nSigmaTOFForParticleOfInterest = -999.;\r
+                     if ( (track->IsOn(AliESDtrack::kTOFin)) &&\r
+                          (track->IsOn(AliESDtrack::kTIME))  ) { \r
+                       tofTime = track->GetTOFsignal();//in ps\r
+                       length = track->GetIntegratedLength();\r
+                       tof = tofTime*1E-3; // ns       \r
+                       \r
+                       if (tof <= 0) {\r
+                         //Printf("WARNING: track with negative TOF time found! Skipping this track for PID checks\n");\r
+                         continue;\r
+                       }\r
+                       if (length <= 0){\r
+                         //printf("WARNING: track with negative length found!Skipping this track for PID checks\n");\r
+                         continue;\r
+                       }\r
+                       \r
+                       length = length*0.01; // in meters\r
+                       tof = tof*c;\r
+                       beta = length/tof;\r
+                       \r
+                       nSigmaTOFForParticleOfInterest = fPIDResponse->NumberOfSigmasTOF(track,(AliPID::EParticleType)fParticleOfInterest);\r
+                       fHistBetavsPTOFbeforePID ->Fill(track->P()*track->Charge(),beta);\r
+                       fHistProbTOFvsPtbeforePID ->Fill(track->Pt(),prob[fParticleOfInterest]);\r
+                       fHistNSigmaTOFvsPtbeforePID ->Fill(track->Pt(),nSigmaTOFForParticleOfInterest);\r
+                     }//TOF signal \r
+                     \r
+                     \r
+                     Double_t  nSigmaTPCForParticleOfInterest = fPIDResponse->NumberOfSigmasTPC(track,(AliPID::EParticleType)fParticleOfInterest);\r
+                     fHistdEdxVsPTPCbeforePID -> Fill(track->P()*track->Charge(),track->GetTPCsignal());\r
+                     fHistProbTPCvsPtbeforePID -> Fill(track->Pt(),prob[fParticleOfInterest]); \r
+                     fHistNSigmaTPCvsPtbeforePID -> Fill(track->Pt(),nSigmaTPCForParticleOfInterest); \r
+                     //end of QA-before pid\r
+                     \r
+                     //Make the decision based on the n-sigma\r
+                     if(fUsePIDnSigma) {\r
+                       if(nSigma > fPIDNSigma) continue;}\r
+                     \r
+                     //Make the decision based on the bayesian\r
+                     else if(fUsePIDPropabilities) {\r
+                       if(fParticleOfInterest != TMath::LocMax(AliPID::kSPECIES,prob)) continue;\r
+                       if (prob[fParticleOfInterest]< fMinAcceptedPIDProbability) continue;      \r
+                     }\r
+                     \r
+                     //Fill QA after the PID\r
+                     fHistBetavsPTOFafterPID ->Fill(track->P()*track->Charge(),beta);\r
+                     fHistProbTOFvsPtafterPID ->Fill(track->Pt(),prob[fParticleOfInterest]);\r
+                     fHistNSigmaTOFvsPtafterPID ->Fill(track->Pt(),nSigmaTOFForParticleOfInterest);\r
+                     \r
+                     fHistdEdxVsPTPCafterPID -> Fill(track->P()*track->Charge(),track->GetTPCsignal());\r
+                     fHistProbTPCvsPtafterPID -> Fill(track->Pt(),prob[fParticleOfInterest]); \r
+                     fHistNSigmaTPCvsPtafterPID -> Fill(track->Pt(),nSigmaTPCForParticleOfInterest); \r
+                     \r
+                     PostData(4, fHistListPIDQA);\r
+                   }\r
+                    //===========================PID===============================//\r
                    v_charge = track_TPC->Charge();\r
                    v_y      = track_TPC->Y();\r
                    v_eta    = track_TPC->Eta();\r
@@ -381,7 +536,6 @@ void AliAnalysisTaskBF::UserExec(Option_t *) {
                    v_E      = track_TPC->E();\r
                    v_pt     = track_TPC->Pt();\r
                    track_TPC->PxPyPz(v_p);\r
-\r
                    fHistClus->Fill(track_TPC->GetITSclusters(0),nClustersTPC);\r
                    fHistDCA->Fill(b[1],b[0]);\r
                    fHistChi2->Fill(chi2PerClusterTPC);\r
@@ -858,8 +1012,6 @@ void AliAnalysisTaskBF::UserExec(Option_t *) {
 \r
              Double_t phi0 = v_phi;\r
              Double_t gV2 = fDifferentialV2->Eval(v_pt);\r
-             fHistPhiBefore->Fill(v_phi);\r
-             gReactionPlane = 0.0;\r
 \r
              for (Int_t j = 0; j < maxNumberOfIterations; j++) {\r
                Double_t phiprev = v_phi;\r
@@ -869,7 +1021,13 @@ void AliAnalysisTaskBF::UserExec(Option_t *) {
                if (TMath::AreEqualAbs(phiprev,v_phi,precisionPhi)) break;\r
              }\r
              //Printf("phi (after): %lf\n",v_phi);\r
-             fHistPhiAfter->Fill(v_phi);\r
+                     Double_t v_DeltaphiBefore = phi0 - gReactionPlane;\r
+             if(v_DeltaphiBefore < 0) v_DeltaphiBefore += 2*TMath::Pi();\r
+             fHistPhiBefore->Fill(v_DeltaphiBefore);\r
+\r
+             Double_t v_DeltaphiAfter = v_phi - gReactionPlane;\r
+             if(v_DeltaphiAfter < 0) v_DeltaphiAfter += 2*TMath::Pi();\r
+             fHistPhiAfter->Fill(v_DeltaphiAfter);\r
            }\r
            \r
            v_phi *= TMath::RadToDeg();\r
index 1e8aefc..f87258a 100755 (executable)
@@ -15,6 +15,12 @@ class AliESDtrackCuts;
 #include "AliAnalysisTaskSE.h"\r
 #include "AliBalance.h"\r
 \r
+#include "AliPID.h"  \r
+#include "AliPIDResponse.h"\r
+#include "AliPIDCombined.h"\r
\r
+enum kDetectorUsedForPID { kTPCpid, kTOFpid, kTPCTOF }; // default TPC & TOF pid (via GetTPCpid & GetTOFpid)  \r
+enum kParticleOfInterest { kMuon, kElectron, kPion, kKaon, kProton };  \r
 \r
 class AliAnalysisTaskBF : public AliAnalysisTaskSE {\r
  public:\r
@@ -108,6 +114,20 @@ class AliAnalysisTaskBF : public AliAnalysisTaskSE {
   void SetAcceptanceParameterization(TF1 *parameterization) {\r
     fAcceptanceParameterization = parameterization;}\r
 \r
+  //pid\r
+  void SetUseBayesianPID(Double_t gMinProbabilityValue) {\r
+    fUsePID = kTRUE; fUsePIDPropabilities = kTRUE;\r
+    fMinAcceptedPIDProbability = gMinProbabilityValue; }\r
+\r
+  void SetUseNSigmaPID(Double_t gMaxNSigma) {\r
+    fUsePID = kTRUE; fUsePIDnSigma = kTRUE;\r
+    fPIDNSigma = gMaxNSigma; }\r
+\r
+  void SetParticleOfInterest(kParticleOfInterest poi) {\r
+    fParticleOfInterest = poi;}\r
+  void SetDetectorUsedForPID(kDetectorUsedForPID detConfig) {\r
+    fPidDetectorConfig = detConfig;}\r
+\r
  private:\r
   AliBalance *fBalance; //BF object\r
   Bool_t fRunShuffling;//run shuffling or not\r
@@ -115,6 +135,7 @@ class AliAnalysisTaskBF : public AliAnalysisTaskSE {
   TList *fList; //fList object\r
   TList *fListBF; //fList object\r
   TList *fListBFS; //fList object\r
+  TList *fHistListPIDQA;  //! list of histograms\r
 \r
   TH1F *fHistEventStats; //event stats\r
   TH2F *fHistCentStats; //centrality stats\r
@@ -135,6 +156,33 @@ class AliAnalysisTaskBF : public AliAnalysisTaskSE {
   TH2F *fHistV0M;//\r
   TH2F *fHistRefTracks;//\r
 \r
+  //============PID============//\r
+  TH2D *fHistdEdxVsPTPCbeforePID;//\r
+  TH2D *fHistBetavsPTOFbeforePID;//\r
+  TH2D *fHistProbTPCvsPtbeforePID; //\r
+  TH2D *fHistProbTOFvsPtbeforePID;//\r
+  TH2D *fHistNSigmaTPCvsPtbeforePID;//\r
+  TH2D *fHistNSigmaTOFvsPtbeforePID;//\r
+  TH2D *fHistdEdxVsPTPCafterPID;//\r
+  TH2D *fHistBetavsPTOFafterPID;//\r
+  TH2D *fHistProbTPCvsPtafterPID;//\r
+  TH2D *fHistProbTOFvsPtafterPID;//\r
+  TH2D *fHistNSigmaTPCvsPtafterPID;//\r
+  TH2D *fHistNSigmaTOFvsPtafterPID; //\r
+\r
+  AliPIDResponse *fPIDResponse;     //! PID response object\r
+  AliPIDCombined       *fPIDCombined;     //! combined PID object\r
+  \r
+  kParticleOfInterest  fParticleOfInterest;\r
+  kDetectorUsedForPID   fPidDetectorConfig;\r
+\r
+  Bool_t fUsePID; //\r
+  Bool_t fUsePIDnSigma;//\r
+  Bool_t fUsePIDPropabilities;//\r
+  Double_t fPIDNSigma;//\r
+  Double_t fMinAcceptedPIDProbability;//\r
+  //============PID============//\r
+\r
   AliESDtrackCuts *fESDtrackCuts; //ESD track cuts\r
 \r
   TString fCentralityEstimator;      //"V0M","TRK","TKL","ZDC","FMD"\r
@@ -177,6 +225,8 @@ class AliAnalysisTaskBF : public AliAnalysisTaskSE {
   Bool_t fUseMCPdgCode; //Boolean to analyze a set of particles in MC\r
   Int_t fPDGCodeToBeAnalyzed; //Analyze a set of particles in MC\r
 \r
+  \r
+\r
   AliAnalysisTaskBF(const AliAnalysisTaskBF&); // not implemented\r
   AliAnalysisTaskBF& operator=(const AliAnalysisTaskBF&); // not implemented\r
   \r
index de2c56f..801fd04 100644 (file)
@@ -7,6 +7,15 @@
 //Bool_t gRunShuffling = kFALSE;\r
 //Bool_t gRunShuffling = kTRUE;\r
 //=============================================//\r
+\r
+//PID config\r
+Bool_t kUseNSigmaPID = kFALSE;\r
+Double_t nSigmaMax = 3.0;\r
+Bool_t kUseBayesianPID = kTRUE;\r
+Double_t gMinAcceptedProbability = 0.7;\r
+kDetectorUsedForPID pidMethod = AliAnalysisTaskBF::kTPCTOF;\r
+kParticleOfInterest particleOfInterest = AliAnalysisTaskBF::kPion;\r
+\r
 //_________________________________________________________//\r
 AliAnalysisTaskBF *AddTaskBalanceCentralityTrain(Double_t centrMin=0.,\r
                                                 Double_t centrMax=100.,\r
@@ -21,6 +30,7 @@ AliAnalysisTaskBF *AddTaskBalanceCentralityTrain(Double_t centrMin=0.,
                                                 Double_t etaMax=0.8,\r
                                                 Double_t maxTPCchi2 = -1, \r
                                                 Int_t minNClustersTPC = -1,\r
+                                                Bool_t kUsePID = kFALSE,\r
                                                 Int_t AODfilterBit = 128,\r
                                                 TString fileNameBase="AnalysisResults") {\r
 \r
@@ -108,7 +118,14 @@ AliAnalysisTaskBF *AddTaskBalanceCentralityTrain(Double_t centrMin=0.,
   if(analysisType == "ESD") {\r
     AliESDtrackCuts *trackCuts = GetTrackCutsObject(ptMin,ptMax,etaMin,etaMax,maxTPCchi2,DCAxy,DCAz,minNClustersTPC);\r
     taskBF->SetAnalysisCutObject(trackCuts);\r
-    \r
+    if(kUsePID) {\r
+      if(kUseBayesianPID)\r
+       taskBF->SetUseBayesianPID(gMinAcceptedProbability);\r
+      else if(kUseNSigmaPID)\r
+       taskBF->SetUseNSigmaPID(nSigmaMax);\r
+      taskBF->SetParticleOfInterest(particleOfInterest);\r
+      taskBF->SetDetectorUsedForPID(pidMethod);\r
+    }\r
   }\r
   else if(analysisType == "AOD") {\r
     // pt and eta cut (pt_min, pt_max, eta_min, eta_max)\r
index b943398..82076d6 100755 (executable)
@@ -25,6 +25,8 @@ Float_t ptMax[numberOfSyst]  = {1.5,1.5,1.5,1.5,1.5,1.5,1.5,5.0,10.0,10.0,1.5,1.
 Float_t etaMin[numberOfSyst] = {-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-1.0,-0.6,-0.4}; // eta cuts\r
 Float_t etaMax[numberOfSyst] = {0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,1.0,0.6,0.4};   // eta cuts\r
 \r
+Bool_t kUsePID = kFALSE;\r
+\r
 //______________________________________________________________________________\r
 void runBalanceFunction(\r
          const char* runtype = "local", // local, proof or grid\r
@@ -153,11 +155,16 @@ void runBalanceFunction(
       gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");\r
       AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(bMCphyssel);\r
 \r
+      //Add the PID response\r
+      if(kUsePID) {\r
+       gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");\r
+       AddTaskPIDResponse(bMCphyssel); \r
+      }\r
     }\r
 \r
     //Add the BF task (all centralities)\r
     gROOT->LoadMacro("AddTaskBalanceCentralityTrain.C"); \r
-    AliAnalysisTaskBF *task = AddTaskBalanceCentralityTrain(0,100,0,"V0M",vZ[0],DCAxy[0],DCAz[0],ptMin[0],ptMax[0],etaMin[0],etaMax[0],-1,-1);\r
+    AliAnalysisTaskBF *task = AddTaskBalanceCentralityTrain(0,100,0,"V0M",vZ[0],DCAxy[0],DCAz[0],ptMin[0],ptMax[0],etaMin[0],etaMax[0],-1,-1,kUsePID);\r
     \r
     // enable debug printouts\r
     //mgr->SetDebugLevel(2);\r