Added the possibility to the user to manage own PID
authorfnoferin <fnoferin@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Jul 2013 11:42:43 +0000 (11:42 +0000)
committerfnoferin <fnoferin@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Jul 2013 11:42:43 +0000 (11:42 +0000)
14 files changed:
PWGPP/PWGPPpidLinkDef.h
PWGPP/pid/AddTaskK0sBayes.C
PWGPP/pid/AddTaskLambdaBayes.C
PWGPP/pid/AddTaskPhiBayes.C
PWGPP/pid/AliAnalysisTaskK0sBayes.cxx
PWGPP/pid/AliAnalysisTaskK0sBayes.h
PWGPP/pid/AliAnalysisTaskLambdaBayes.cxx
PWGPP/pid/AliAnalysisTaskLambdaBayes.h
PWGPP/pid/AliAnalysisTaskPhiBayes.cxx
PWGPP/pid/AliAnalysisTaskPhiBayes.h
PWGPP/pid/AliPIDmaxProb.cxx [new file with mode: 0644]
PWGPP/pid/AliPIDmaxProb.h [new file with mode: 0644]
PWGPP/pid/AliPIDperfCut.cxx [new file with mode: 0644]
PWGPP/pid/AliPIDperfCut.h [new file with mode: 0644]

index 7ca2b73..ae8ed3c 100644 (file)
@@ -6,6 +6,8 @@
 
 // pid
 #pragma link C++ class AliPIDperfContainer+;
+#pragma link C++ class AliPIDperfCut+;
+#pragma link C++ class AliPIDmaxProb+;
 #pragma link C++ class AliAnalysisTaskK0sBayes+;
 #pragma link C++ class AliAnalysisTaskLambdaBayes+;
 #pragma link C++ class AliAnalysisTaskPhiBayes+;
index b9a5b65..520d700 100644 (file)
@@ -23,6 +23,9 @@ AliAnalysisTask *AddTaskK0sBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filter
   task->SetFilterBit(filterbit);
   task->SetTypeCollisions(typeCol);
 
+  AliPIDmaxProb *userCut = new AliPIDmaxProb("maxProbPion");
+  task->SetPIDuserCut(userCut);
+
   mgr->AddTask(task);
 
   //Attach input to my tasks
index 289bbaf..32f9f6c 100644 (file)
@@ -23,6 +23,9 @@ AliAnalysisTask *AddTaskLambdaBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t fil
   task->SetFilterBit(filterbit);
   task->SetTypeCollisions(typeCol);
 
+  AliPIDmaxProb *userCut = new AliPIDmaxProb("maxProbProton");
+  task->SetPIDuserCut(userCut);
+
   mgr->AddTask(task);
 
   //Attach input to my tasks
index ccf1cb9..c8887c7 100644 (file)
@@ -23,6 +23,9 @@ AliAnalysisTask *AddTaskPhiBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filter
   task->SetFilterBit(filterbit);
   task->SetTypeCollisions(typeCol);
 
+  AliPIDmaxProb *userCut = new AliPIDmaxProb("maxProbKaon");
+  task->SetPIDuserCut(userCut);
+
   mgr->AddTask(task);
 
   //Attach input to my tasks
index 898b917..78262f8 100644 (file)
@@ -69,12 +69,15 @@ AliAnalysisTaskK0sBayes::AliAnalysisTaskK0sBayes():
   fPIDCombined(NULL),
   fContPid(NULL),
   fContPid2(NULL),
+  fContUser(NULL),
+  fContUser2(NULL),
   fNK0s(0),
   fNpiPos(0),
   fNpiNeg(0),
   fHmismTOF(0),
   fHchannelTOFdistr(0),
-  fTypeCol(2)
+  fTypeCol(2),
+  fPIDuserCut(NULL)
 {
   // Default constructor (should not be used)
   fList->SetName("contKsBayes1");
@@ -149,12 +152,15 @@ AliAnalysisTaskK0sBayes::AliAnalysisTaskK0sBayes(const char *name):
   fPIDCombined(NULL),
   fContPid(NULL),
   fContPid2(NULL),
+  fContUser(NULL),
+  fContUser2(NULL),
   fNK0s(0),
   fNpiPos(0),
   fNpiNeg(0),
   fHmismTOF(0),
   fHchannelTOFdistr(0),
-  fTypeCol(2)
+  fTypeCol(2),
+  fPIDuserCut(NULL)
 {
 
   DefineOutput(1, TList::Class());
@@ -288,8 +294,6 @@ void AliAnalysisTaskK0sBayes::UserCreateOutputObjects()
   fContPid2->SetVarName(13,"#Psi");
   fContPid2->SetVarRange(13,-TMath::Pi()/2,TMath::Pi()/2);
 
-
-
   const Int_t nDETsignal = 100; // mass
   Double_t binDETsignal[nDETsignal+1];
   for(Int_t i=0;i<nDETsignal+1;i++){
@@ -306,6 +310,46 @@ void AliAnalysisTaskK0sBayes::UserCreateOutputObjects()
   fList->Add(fContPid);
   fList->Add(fContPid2);
 
+  const Int_t nBinUser = 6;
+  Int_t binUser[nBinUser] = {8/*Eta*/,20/*pt*/,2/*istrue*/,4/*whatSelection*/,1/*DeltaPhi*/,1/*Psi*/};
+  fContUser = new AliPIDperfContainer("contUserPID",nBinUser,binUser);
+  fContUser->SetTitleX("M_{K^{0}_{s}}");
+  fContUser->SetTitleY("centrality (%)");
+  fContUser->SetVarName(0,"#eta^{K^{0}_{s}}");
+  fContUser->SetVarRange(0,-0.8,0.8);
+  fContUser->SetVarName(1,"p_{T}");
+  fContUser->SetVarRange(1,0.3,4.3);
+  fContUser->SetVarName(2,"isKsTrue^{Kn}");
+  fContUser->SetVarRange(2,-0.5,1.5);
+  fContUser->SetVarName(3,"whatSelected"); // 0=no, 1=pi, 2=K, 3=p
+  fContUser->SetVarRange(3,-0.5,3.5);
+  fContUser->SetVarName(4,"#Delta#phi");
+  fContUser->SetVarRange(4,-TMath::Pi(),TMath::Pi());
+  fContUser->SetVarName(5,"#Psi");
+  fContUser->SetVarRange(5,-TMath::Pi()/2,TMath::Pi()/2);
+
+  fContUser2 = new AliPIDperfContainer("contUserPID2",nBinUser,binUser);
+  fContUser2->SetTitleX("M_{K^{0}_{s}}");
+  fContUser2->SetTitleY("centrality (%)");
+  fContUser2->SetVarName(0,"#eta^{K^{0}_{s}}");
+  fContUser2->SetVarRange(0,-0.8,0.8);
+  fContUser2->SetVarName(1,"p_{T}");
+  fContUser2->SetVarRange(1,0.3,4.3);
+  fContUser2->SetVarName(2,"isKsTrue^{Kn}");
+  fContUser2->SetVarRange(2,-0.5,1.5);
+  fContUser2->SetVarName(3,"whatSelected");
+  fContUser2->SetVarRange(3,-0.5,3.5);
+  fContUser2->SetVarName(4,"#Delta#phi");
+  fContUser2->SetVarRange(4,-TMath::Pi(),TMath::Pi());
+  fContUser2->SetVarName(5,"#Psi");
+  fContUser2->SetVarRange(5,-TMath::Pi()/2,TMath::Pi()/2);
+
+  fContUser->AddSpecies("K0s",nDETsignal,binDETsignal,nDETsignal2,binDETsignal2);
+  fContUser2->AddSpecies("K0s2",nDETsignal,binDETsignal,nDETsignal2,binDETsignal2);
+
+  fList->Add(fContUser);
+  fList->Add(fContUser2);
+
   hMatching[0] = new TH2F("hMatchAll","TOF matched (all);p_{T} (GeV/#it{c});centrality (%)",50,0,10,nDETsignal2,0,100);
   hMatching[1] = new TH2F("hMatchPi","TOF matched (#pi);p_{T} (GeV/#it{c});centrality (%)",50,0,10,nDETsignal2,0,100);
   hMatching[2] = new TH2F("hMatchKa","TOF matched (K);p_{T} (GeV/#it{c});centrality (%)",50,0,10,nDETsignal2,0,100);
@@ -852,6 +896,29 @@ void AliAnalysisTaskK0sBayes::Analyze(AliAODEvent* aodEvent)
        fContPid->Fill(0,fMassV0,fCentrality,xTOfill);
         xTOfill[1] = KnTrack->Eta();
        fContPid2->Fill(0,fMassV0,fCentrality,xTOfill);
+
+       if(fPIDuserCut){
+         Float_t xUser[] = {KpTrack->Eta(),fPtKp,isTrue,0,deltaphi1,fPsi};
+         Float_t xUser2[] = {KnTrack->Eta(),fPtKn,isTrue,0,deltaphi2,fPsi};
+
+         if(fPIDuserCut->IsSelected(KpTrack,AliPID::kPion)){ // to be filled for positive
+           xUser[3] = 1;
+         } else if(fPIDuserCut->IsSelected(KpTrack,AliPID::kKaon)){
+           xUser[3] = 2;
+         } else if(fPIDuserCut->IsSelected(KpTrack,AliPID::kProton)){
+           xUser[3] = 3;
+         }
+         if(fPIDuserCut->IsSelected(KnTrack,AliPID::kPion)){ // to be filled for negative
+           xUser2[3] = 1;
+         } else if(fPIDuserCut->IsSelected(KnTrack,AliPID::kKaon)){
+           xUser2[3] = 2;
+         } else if(fPIDuserCut->IsSelected(KnTrack,AliPID::kProton)){
+           xUser2[3] = 3;
+         }
+         fContUser->Fill(0,fMassV0,fCentrality,xUser);
+         fContUser2->Fill(0,fMassV0,fCentrality,xUser2);
+       }
+
       }
 
 
index 7e81d0c..ce16efe 100644 (file)
@@ -13,6 +13,7 @@
 #include <AliAnalysisTaskSE.h>
 #include <AliAODEvent.h>
 #include "AliPIDperfContainer.h"
+#include "AliPIDperfCut.h"
 
 class TH1F;
 class TH2F;
@@ -50,6 +51,8 @@ class AliAnalysisTaskK0sBayes : public AliAnalysisTaskSE {
   void SetTypeCollisions(Int_t type){fTypeCol = type;}; // 0=pp, 1=pPb, 2=PbPb
   Int_t GetTypeCollisions() const {return fTypeCol;}; 
 
+  void SetPIDuserCut(AliPIDperfCut *usercut){fPIDuserCut = usercut;};
+
  private:
   AliAnalysisTaskK0sBayes(const AliAnalysisTaskK0sBayes &old); 
   AliAnalysisTaskK0sBayes& operator=(const AliAnalysisTaskK0sBayes &source); 
@@ -123,6 +126,8 @@ class AliAnalysisTaskK0sBayes : public AliAnalysisTaskSE {
   AliPIDCombined *fPIDCombined;  //! PID combined object
   AliPIDperfContainer* fContPid;      //! results for positive
   AliPIDperfContainer* fContPid2;     //! results for negative
+  AliPIDperfContainer* fContUser;     //! results for positive user cut
+  AliPIDperfContainer* fContUser2;    //! results for negative user cut
 
   Int_t fNK0s; //! number of K0s in my private selection
   Float_t fPhiK0s[1000]; //! phi of K0s in my private selection
@@ -139,8 +144,9 @@ class AliAnalysisTaskK0sBayes : public AliAnalysisTaskSE {
   TH1D *fHchannelTOFdistr; //! TOF channel distance w.r.t. IP
 
   Int_t fTypeCol; // type of collision system (0=pp, 1=pPb, 2=PbPb)
+  AliPIDperfCut *fPIDuserCut;  // pid user cut to be cheked
 
-  ClassDef(AliAnalysisTaskK0sBayes, 2);    //Analysis task for bayesian (K0s)
+  ClassDef(AliAnalysisTaskK0sBayes, 3);    //Analysis task for bayesian (K0s)
 };
 
 #endif
index 2366c3c..75917eb 100644 (file)
@@ -69,12 +69,15 @@ AliAnalysisTaskLambdaBayes::AliAnalysisTaskLambdaBayes():
   fPIDCombined(NULL),
   fContPid(NULL),
   fContPid2(NULL),
+  fContUser(NULL),
+  fContUser2(NULL),
   fNLambda(0),
   fNpPos(0),
   fNpNeg(0),
   fHmismTOF(0),
   fHchannelTOFdistr(0),
-  fTypeCol(2)
+  fTypeCol(2),
+  fPIDuserCut(NULL)
 {
   // Default constructor (should not be used)
   fList->SetName("contLambdaBayes1");
@@ -150,12 +153,15 @@ AliAnalysisTaskLambdaBayes::AliAnalysisTaskLambdaBayes(const char *name):
   fPIDCombined(NULL),
   fContPid(NULL),
   fContPid2(NULL),
+  fContUser(NULL),
+  fContUser2(NULL),
   fNLambda(0),
   fNpPos(0),
   fNpNeg(0),
   fHmismTOF(0),
   fHchannelTOFdistr(0),
-  fTypeCol(2)
+  fTypeCol(2),
+  fPIDuserCut(NULL)
 {
 
   DefineOutput(1, TList::Class());
@@ -308,6 +314,46 @@ void AliAnalysisTaskLambdaBayes::UserCreateOutputObjects()
   fList->Add(fContPid);
   fList->Add(fContPid2);
 
+  const Int_t nBinUser = 6;
+  Int_t binUser[nBinUser] = {8/*Eta*/,20/*pt*/,2/*istrue*/,4/*whatSelection*/,1/*DeltaPhi*/,1/*Psi*/};
+  fContUser = new AliPIDperfContainer("contUserPID",nBinUser,binUser);
+  fContUser->SetTitleX("M_{#Lambda}");
+  fContUser->SetTitleY("centrality (%)");
+  fContUser->SetVarName(0,"#eta");
+  fContUser->SetVarRange(0,-0.8,0.8);
+  fContUser->SetVarName(1,"p_{T}");
+  fContUser->SetVarRange(1,0.3,4.3);
+  fContUser->SetVarName(2,"isLambdaTrue");
+  fContUser->SetVarRange(2,-0.5,1.5);
+  fContUser->SetVarName(3,"whatSelected"); // 0=no, 1=pi, 2=K, 3=p
+  fContUser->SetVarRange(3,-0.5,3.5);
+  fContUser->SetVarName(4,"#Delta#phi");
+  fContUser->SetVarRange(4,-TMath::Pi(),TMath::Pi());
+  fContUser->SetVarName(5,"#Psi");
+  fContUser->SetVarRange(5,-TMath::Pi()/2,TMath::Pi()/2);
+
+  fContUser2 = new AliPIDperfContainer("contUserPID2",nBinUser,binUser);
+  fContUser2->SetTitleX("M_{#Lambda}");
+  fContUser2->SetTitleY("centrality (%)");
+  fContUser2->SetVarName(0,"#eta");
+  fContUser2->SetVarRange(0,-0.8,0.8);
+  fContUser2->SetVarName(1,"p_{T}");
+  fContUser2->SetVarRange(1,0.3,4.3);
+  fContUser2->SetVarName(2,"isLambdaTrue");
+  fContUser2->SetVarRange(2,-0.5,1.5);
+  fContUser2->SetVarName(3,"whatSelected");
+  fContUser2->SetVarRange(3,-0.5,3.5);
+  fContUser2->SetVarName(4,"#Delta#phi");
+  fContUser2->SetVarRange(4,-TMath::Pi(),TMath::Pi());
+  fContUser2->SetVarName(5,"#Psi");
+ fContUser2->SetVarRange(5,-TMath::Pi()/2,TMath::Pi()/2);
+
+  fContUser->AddSpecies("Lambda",nDETsignal,binDETsignal,nDETsignal2,binDETsignal2);
+  fContUser2->AddSpecies("Lambda2",nDETsignal,binDETsignal,nDETsignal2,binDETsignal2);
+
+  fList->Add(fContUser);
+  fList->Add(fContUser2);
+
   hMatching[0] = new TH2F("hMatchAll","TOF matched (all);p_{T} (GeV/#it{c});centrality (%)",50,0,10,nDETsignal2,0,100);
   hMatching[1] = new TH2F("hMatchPi","TOF matched (#pi);p_{T} (GeV/#it{c});centrality (%)",50,0,10,nDETsignal2,0,100);
   hMatching[2] = new TH2F("hMatchKa","TOF matched (K);p_{T} (GeV/#it{c});centrality (%)",50,0,10,nDETsignal2,0,100);
@@ -833,6 +879,23 @@ void AliAnalysisTaskLambdaBayes::Analyze(AliAODEvent* aodEvent)
       if(TMath::Abs(fEtaLambda) < 0.8 && fPtKp > 0.3 && fPtKn > 0.3){
        if(isLambda) fContPid->Fill(0,fMassV0,fCentrality,xTOfill);
        else fContPid2->Fill(0,fMassV0,fCentrality,xTOfill2);
+
+
+
+       if(fPIDuserCut){
+         Float_t xUser[] = {KpTrack->Eta(),fPtKp,isTrue,0,deltaphi1,fPsi};
+         
+         if(fPIDuserCut->IsSelected(KpTrack,AliPID::kPion)){ // to be filled
+           xUser[3] = 1;
+         } else if(fPIDuserCut->IsSelected(KpTrack,AliPID::kKaon)){
+           xUser[3] = 2;
+         } else if(fPIDuserCut->IsSelected(KpTrack,AliPID::kProton)){
+           xUser[3] = 3;
+         }
+         
+        if(isLambda) fContUser->Fill(0,fMassV0,fCentrality,xUser);
+         else fContUser2->Fill(0,fMassV0,fCentrality,xUser);
+       }
       }
 
 
index ca54979..017ef28 100644 (file)
@@ -13,6 +13,7 @@
 #include <AliAnalysisTaskSE.h>
 #include <AliAODEvent.h>
 #include "AliPIDperfContainer.h"
+#include "AliPIDperfCut.h"
 
 class TH1F;
 class TH2F;
@@ -50,6 +51,8 @@ class AliAnalysisTaskLambdaBayes : public AliAnalysisTaskSE {
   void SetTypeCollisions(Int_t type){fTypeCol = type;}; // 0=pp, 1=pPb, 2=PbPb
   Int_t GetTypeCollisions() const {return fTypeCol;}; 
 
+  void SetPIDuserCut(AliPIDperfCut *usercut){fPIDuserCut = usercut;};
+
  private:
   AliAnalysisTaskLambdaBayes(const AliAnalysisTaskLambdaBayes &old); 
   AliAnalysisTaskLambdaBayes& operator=(const AliAnalysisTaskLambdaBayes &source); 
@@ -123,6 +126,8 @@ class AliAnalysisTaskLambdaBayes : public AliAnalysisTaskSE {
   AliPIDCombined *fPIDCombined;  //! PID combined object
   AliPIDperfContainer* fContPid;      //! results for positive
   AliPIDperfContainer* fContPid2;     //! results for negative
+  AliPIDperfContainer* fContUser;     //! results for positive user cut
+  AliPIDperfContainer* fContUser2;    //! results for negative user cut
 
   Int_t fNLambda; //! number of Lambda in my private selection
   Float_t fPhiLambda[1000]; //! phi of Lambda in my private selection
@@ -139,8 +144,9 @@ class AliAnalysisTaskLambdaBayes : public AliAnalysisTaskSE {
   TH1D *fHchannelTOFdistr; //! TOF channel distance w.r.t. IP
 
   Int_t fTypeCol; // type of collision system (0=pp, 1=pPb, 2=PbPb)
+  AliPIDperfCut *fPIDuserCut;  // pid user cut to be cheked
 
-  ClassDef(AliAnalysisTaskLambdaBayes, 2);    //Analysis task for Bayesian (Lambda)
+  ClassDef(AliAnalysisTaskLambdaBayes, 3);    //Analysis task for Bayesian (Lambda)
 };
 
 #endif
index 6224755..9d53ce2 100644 (file)
@@ -69,9 +69,12 @@ AliAnalysisTaskPhiBayes::AliAnalysisTaskPhiBayes():
   fPIDCombined(NULL),
   fContPid(NULL),
   fContPid2(NULL),
+  fContUser(NULL),
+  fContUser2(NULL),
   fHmismTOF(0),
   fHchannelTOFdistr(0),
-  fTypeCol(2)
+  fTypeCol(2),
+  fPIDuserCut(NULL)
 {
   // Default constructor (should not be used)
   fList->SetName("contPhiBayes1");
@@ -137,9 +140,12 @@ AliAnalysisTaskPhiBayes::AliAnalysisTaskPhiBayes(const char *name):
   fPIDCombined(NULL),
   fContPid(NULL),
   fContPid2(NULL),
+  fContUser(NULL),
+  fContUser2(NULL),
   fHmismTOF(0),
   fHchannelTOFdistr(0),
-  fTypeCol(2)
+  fTypeCol(2),
+  fPIDuserCut(NULL)
 {
 
   DefineOutput(1, TList::Class());
@@ -282,6 +288,46 @@ void AliAnalysisTaskPhiBayes::UserCreateOutputObjects()
   fList->Add(fContPid);
   fList->Add(fContPid2);
 
+  const Int_t nBinUser = 6;
+  Int_t binUser[nBinUser] = {8/*Eta*/,20/*pt*/,2/*istrue*/,4/*whatSelection*/,1/*DeltaPhi*/,1/*Psi*/};
+  fContUser = new AliPIDperfContainer("contUserPID",nBinUser,binUser);
+  fContUser->SetTitleX("M_{#phi}");
+  fContUser->SetTitleY("centrality (%)");
+  fContUser->SetVarName(0,"#eta^{K^{0}_{s}}");
+  fContUser->SetVarRange(0,-0.8,0.8);
+  fContUser->SetVarName(1,"p_{T}");
+  fContUser->SetVarRange(1,0.3,4.3);
+  fContUser->SetVarName(2,"isKsTrue^{Kn}");
+  fContUser->SetVarRange(2,-0.5,1.5);
+  fContUser->SetVarName(3,"whatSelected"); // 0=no, 1=pi, 2=K, 3=p
+  fContUser->SetVarRange(3,-0.5,3.5);
+  fContUser->SetVarName(4,"#Delta#phi");
+  fContUser->SetVarRange(4,-TMath::Pi(),TMath::Pi());
+  fContUser->SetVarName(5,"#Psi");
+  fContUser->SetVarRange(5,-TMath::Pi()/2,TMath::Pi()/2);
+
+  fContUser2 = new AliPIDperfContainer("contUserPID2",nBinUser,binUser);
+  fContUser2->SetTitleX("M_{#phi}");
+  fContUser2->SetTitleY("centrality (%)");
+  fContUser2->SetVarName(0,"#eta^{K^{0}_{s}}");
+  fContUser2->SetVarRange(0,-0.8,0.8);
+  fContUser2->SetVarName(1,"p_{T}");
+  fContUser2->SetVarRange(1,0.3,4.3);
+  fContUser2->SetVarName(2,"isKsTrue^{Kn}");
+  fContUser2->SetVarRange(2,-0.5,1.5);
+  fContUser2->SetVarName(3,"whatSelected");
+  fContUser2->SetVarRange(3,-0.5,3.5);
+  fContUser2->SetVarName(4,"#Delta#phi");
+  fContUser2->SetVarRange(4,-TMath::Pi(),TMath::Pi());
+  fContUser2->SetVarName(5,"#Psi");
+  fContUser2->SetVarRange(5,-TMath::Pi()/2,TMath::Pi()/2);
+
+  fContUser->AddSpecies("Phi",nDETsignal,binDETsignal,nDETsignal2,binDETsignal2);
+  fContUser2->AddSpecies("Phi2",nDETsignal,binDETsignal,nDETsignal2,binDETsignal2);
+
+  fList->Add(fContUser);
+  fList->Add(fContUser2);
+
   hMatching[0] = new TH2F("hMatchAll","TOF matched (all);p_{T} (GeV/#it{c});centrality (%)",50,0,10,nDETsignal2,0,100);
   hMatching[1] = new TH2F("hMatchPi","TOF matched (#pi);p_{T} (GeV/#it{c});centrality (%)",50,0,10,nDETsignal2,0,100);
   hMatching[2] = new TH2F("hMatchKa","TOF matched (K);p_{T} (GeV/#it{c});centrality (%)",50,0,10,nDETsignal2,0,100);
@@ -809,7 +855,6 @@ void AliAnalysisTaskPhiBayes::Analyze(AliAODEvent* aodEvent)
 
       Float_t xTOfill[] = {fPtPhi,KpTrack->Eta(),fPtKp,fPtKn,(fPidKp%128)*0.01,(fPidKn%128)*0.01,tofMatch1,tofMatch2,isTrue,nSigmaComb,nSigmaComb2,deltaphi1,deltaphi2,fPsi};
       
-
       Int_t ipt = 0;
       while(fPtPhiMin[ipt] < fPtPhi && ipt < nPtBin){
        ipt++;
@@ -822,9 +867,29 @@ void AliAnalysisTaskPhiBayes::Analyze(AliAODEvent* aodEvent)
         xTOfill[1] = KnTrack->Eta();
        if((fPidKp%128) > 80) fContPid2->Fill(0,fMassV0,fCentrality,xTOfill);// use tagging on positive track
 
+       if(fPIDuserCut){
+         Float_t xUser[] = {KpTrack->Eta(),fPtKp,isTrue,0,deltaphi1,fPsi};
+         Float_t xUser2[] = {KnTrack->Eta(),fPtKn,isTrue,0,deltaphi2,fPsi};
+         
+         if(fPIDuserCut->IsSelected(KpTrack,AliPID::kPion)){ // to be filled for positive
+           xUser[3] = 1;
+         } else if(fPIDuserCut->IsSelected(KpTrack,AliPID::kKaon)){
+           xUser[3] = 2;
+         } else if(fPIDuserCut->IsSelected(KpTrack,AliPID::kProton)){
+           xUser[3] = 3;
+         }
+         if(fPIDuserCut->IsSelected(KnTrack,AliPID::kPion)){ // to be filled for negative
+           xUser2[3] = 1;
+         } else if(fPIDuserCut->IsSelected(KnTrack,AliPID::kKaon)){
+           xUser2[3] = 2;
+         } else if(fPIDuserCut->IsSelected(KnTrack,AliPID::kProton)){
+           xUser2[3] = 3;
+         }
+         if((fPidKn%128) > 80) fContUser->Fill(0,fMassV0,fCentrality,xUser);
+         if((fPidKp%128) > 80) fContUser2->Fill(0,fMassV0,fCentrality,xUser2);
+       }
+  
       }
-
-
     }
   } // end analysi phi
 
index f89a6bb..2f20503 100644 (file)
@@ -13,6 +13,7 @@
 #include <AliAnalysisTaskSE.h>
 #include <AliAODEvent.h>
 #include "AliPIDperfContainer.h"
+#include "AliPIDperfCut.h"
 
 class TH1F;
 class TH2F;
@@ -50,6 +51,8 @@ class AliAnalysisTaskPhiBayes : public AliAnalysisTaskSE {
   void SetTypeCollisions(Int_t type){fTypeCol = type;}; // 0=pp, 1=pPb, 2=PbPb
   Int_t GetTypeCollisions() const {return fTypeCol;}; 
 
+  void SetPIDuserCut(AliPIDperfCut *usercut){fPIDuserCut = usercut;};
+
  private:
   AliAnalysisTaskPhiBayes(const AliAnalysisTaskPhiBayes &old); 
   AliAnalysisTaskPhiBayes& operator=(const AliAnalysisTaskPhiBayes &source); 
@@ -119,13 +122,16 @@ class AliAnalysisTaskPhiBayes : public AliAnalysisTaskSE {
   AliPIDCombined *fPIDCombined;  //! PID combined object
   AliPIDperfContainer* fContPid;      //! results for positive
   AliPIDperfContainer* fContPid2;     //! results for negative
+  AliPIDperfContainer* fContUser;     //! results for positive user cut
+  AliPIDperfContainer* fContUser2;    //! results for negative user cut
 
   TH1F *fHmismTOF;         //! TOF mismatch distribution
   TH1D *fHchannelTOFdistr; //! TOF channel distance w.r.t. IP
 
   Int_t fTypeCol; // type of collision system (0=pp, 1=pPb, 2=PbPb)
+  AliPIDperfCut *fPIDuserCut;  // pid user cut to be cheked
 
-  ClassDef(AliAnalysisTaskPhiBayes, 2);    //Analysis task for bayesian (K0s)
+  ClassDef(AliAnalysisTaskPhiBayes, 3);    //Analysis task for bayesian (K0s)
 };
 
 #endif
diff --git a/PWGPP/pid/AliPIDmaxProb.cxx b/PWGPP/pid/AliPIDmaxProb.cxx
new file mode 100644 (file)
index 0000000..474a7ec
--- /dev/null
@@ -0,0 +1,49 @@
+#include"AliPIDmaxProb.h"
+#include"AliPIDResponse.h"
+#include"AliAnalysisManager.h"
+#include"AliInputEventHandler.h"
+
+ClassImp(AliPIDmaxProb);
+
+AliPIDmaxProb::AliPIDmaxProb(const char *name):
+  AliPIDperfCut(name),
+  fPIDCombined(NULL),
+  fMaskPID(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF)
+{
+  fPIDCombined=new AliPIDCombined;
+  fPIDCombined->SetDefaultTPCPriors();
+}
+//--------------------------------------------------------------------
+AliPIDmaxProb::AliPIDmaxProb():
+  AliPIDperfCut("AliPIDmaxProb"),
+  fPIDCombined(NULL),
+  fMaskPID(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF)
+{
+  fPIDCombined=new AliPIDCombined;
+  fPIDCombined->SetDefaultTPCPriors();
+}
+//--------------------------------------------------------------------
+Bool_t AliPIDmaxProb::IsSelected(AliVTrack *track,AliPID::EParticleType type) const{
+  Int_t nspecies = AliPID::kSPECIES;
+  if(type >= nspecies || type < 0) return 0; // type has not a proper value
+
+  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
+  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
+  AliPIDResponse *PIDResponse=inputHandler->GetPIDResponse();
+
+  fPIDCombined->SetDetectorMask(fMaskPID);
+
+  Double_t prob[10] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+
+  /* UInt_t detUsed = */fPIDCombined->ComputeProbabilities(track, PIDResponse, prob);
+
+  Bool_t status = kTRUE;
+  for(Int_t i=0;i<nspecies;i++){
+    if(i != type && prob[type] <= prob[i]){
+      status = kFALSE;
+      break;
+    }
+  }
+
+  return status;
+}
diff --git a/PWGPP/pid/AliPIDmaxProb.h b/PWGPP/pid/AliPIDmaxProb.h
new file mode 100644 (file)
index 0000000..acd233f
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef ALIPIDMAXPROB_H
+#define ALIPIDMAXPROB_H
+
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: AliPIDmaxProb.h 49869 2013-07-10 04:49:51Z fnoferin $ */
+
+/////////////////////////////////////////////////
+//                                             //
+//             PID cut max prob                //
+//           noferini@bo.infn.it               //
+/////////////////////////////////////////////////
+
+#include"AliPIDperfCut.h"
+#include"AliPIDCombined.h"
+
+class AliPIDmaxProb : public AliPIDperfCut
+{
+ public:
+  AliPIDmaxProb(const char *name);
+  AliPIDmaxProb();
+
+  void SetPIDMask(Int_t mask){fMaskPID=mask;}; // set the PID mask to be used
+
+  Bool_t IsSelected(AliVTrack *track,AliPID::EParticleType type) const;
+
+ private:
+  AliPIDmaxProb(const AliPIDmaxProb &old);
+  AliPIDmaxProb& operator=(const AliPIDmaxProb &source);
+
+  AliPIDCombined *fPIDCombined;         //! PID combined object
+  Int_t fMaskPID;                       // PID mask
+
+  ClassDef(AliPIDmaxProb,1)             // PID cut virtual class
+};
+#endif
diff --git a/PWGPP/pid/AliPIDperfCut.cxx b/PWGPP/pid/AliPIDperfCut.cxx
new file mode 100644 (file)
index 0000000..2451cdb
--- /dev/null
@@ -0,0 +1,15 @@
+#include"AliPIDperfCut.h"
+
+ClassImp(AliPIDperfCut);
+
+AliPIDperfCut::AliPIDperfCut(const char *name):
+  TNamed(name,name)
+{}
+//--------------------------------------------------------------------
+AliPIDperfCut::AliPIDperfCut():
+  TNamed("PIDperfCut","PIDperfCut")
+{}
+//--------------------------------------------------------------------
+Bool_t AliPIDperfCut::IsSelected(AliVTrack */*track*/,AliPID::EParticleType /*type*/) const{
+  return 1;
+}
diff --git a/PWGPP/pid/AliPIDperfCut.h b/PWGPP/pid/AliPIDperfCut.h
new file mode 100644 (file)
index 0000000..3830300
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef ALIPIDPERFCUT_H
+#define ALIPIDPERFCUT_H
+
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: AliPIDperfCut.h 49869 2013-07-10 04:49:51Z fnoferin $ */
+
+/////////////////////////////////////////////////
+//                                             //
+//         PID cut for performanve             //
+//           noferini@bo.infn.it               //
+/////////////////////////////////////////////////
+
+#include"AliVTrack.h"
+#include"AliPID.h"
+#include"TNamed.h"
+
+class AliPIDperfCut : public TNamed
+{
+ public:
+  AliPIDperfCut(const char *name);
+  AliPIDperfCut();
+
+  virtual Bool_t IsSelected(AliVTrack *track,AliPID::EParticleType type) const;
+
+ private:
+
+  ClassDef(AliPIDperfCut,1)  // PID cut virtual class
+};
+#endif