Enable usage of compatibility band for PID (A. Rossi)
authorfprino <prino@to.infn.it>
Mon, 31 Mar 2014 12:59:07 +0000 (14:59 +0200)
committerfprino <prino@to.infn.it>
Mon, 31 Mar 2014 12:59:50 +0000 (14:59 +0200)
PWGHF/vertexingHF/AliAnalysisTaskCombinHF.cxx
PWGHF/vertexingHF/AliAnalysisTaskCombinHF.h
PWGHF/vertexingHF/macros/AddTaskCombinHF.C

index 1c3a85f..24cd4c9 100644 (file)
@@ -88,7 +88,10 @@ AliAnalysisTaskCombinHF::AliAnalysisTaskCombinHF():
   fReadMC(kFALSE),
   fPromptFeeddown(kPrompt),
   fGoUpToQuark(kTRUE),
-  fFullAnalysis(0)  
+  fFullAnalysis(0),
+  fmaxPforIDPion(0.6),
+  fmaxPforIDKaon(2.),  
+  fKeepNegID(kFALSE)  
 {
   // default constructor
 }
@@ -138,7 +141,10 @@ AliAnalysisTaskCombinHF::AliAnalysisTaskCombinHF(Int_t meson, AliRDHFCuts* analy
   fReadMC(kFALSE),
   fPromptFeeddown(1),
   fGoUpToQuark(kTRUE),
-  fFullAnalysis(0)
+  fFullAnalysis(0),
+  fmaxPforIDPion(0.6),
+  fmaxPforIDKaon(2.),  
+  fKeepNegID(kFALSE)  
 
 {
   // standard constructor
@@ -671,6 +677,7 @@ Bool_t AliAnalysisTaskCombinHF::IsTrackSelected(AliAODTrack* track){
   // track selection cuts
 
   if(track->Charge()==0) return kFALSE;
+  if(track->GetID()<0&&!fKeepNegID)return kFALSE;
   if(!(track->TestFilterMask(fFilterMask))) return kFALSE;
   if(!SelectAODTrack(track,fTrackCutsAll)) return kFALSE;    
   return kTRUE;
@@ -681,7 +688,11 @@ Bool_t AliAnalysisTaskCombinHF::IsKaon(AliAODTrack* track){
 
   if(!fPidHF) return kTRUE;
   Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon);  
-  if(isKaon>=0 && SelectAODTrack(track,fTrackCutsKaon)) return kTRUE;
+
+  if(SelectAODTrack(track,fTrackCutsKaon)) {
+    if(isKaon>=1)    return kTRUE;
+    else if(isKaon>=0 && track->P()>fmaxPforIDKaon)return kTRUE;
+  }
   return kFALSE;
 }
 //________________________________________________________________________
@@ -690,7 +701,10 @@ Bool_t AliAnalysisTaskCombinHF::IsPion(AliAODTrack* track){
 
   if(!fPidHF) return kTRUE;
   Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion);
-  if(isPion>=0&& SelectAODTrack(track,fTrackCutsPion)) return kTRUE;
+  if(SelectAODTrack(track,fTrackCutsPion)) {
+    if(isPion>=1)    return kTRUE;
+    else if(isPion>=0 && track->P()>fmaxPforIDPion)return kTRUE;
+  }
   return kFALSE;
 }
 //________________________________________________________________________
index 7069d43..2aa1b3f 100644 (file)
@@ -40,7 +40,7 @@ class AliAnalysisTaskCombinHF : public AliAnalysisTaskSE
   void SelectFeeddownD(){fPromptFeeddown=kFeeddown;}
   void SelectPromptAndFeeddownD(){fPromptFeeddown=kBoth;}
   void SetGoUpToQuark(Bool_t opt){fGoUpToQuark=opt;}
-
+  void SetKeepNegIDtracks(Bool_t nid){fKeepNegID=nid;}//set it to kTRUE only if you know what you are doing
   void SetTrackCuts(AliESDtrackCuts* cuts){
     if(fTrackCutsAll) delete fTrackCutsAll;
     fTrackCutsAll=new AliESDtrackCuts(*cuts);
@@ -77,6 +77,8 @@ class AliAnalysisTaskCombinHF : public AliAnalysisTaskSE
   Bool_t CheckAcceptance(TClonesArray* arrayMC, Int_t nProng, Int_t *labDau);
   enum EMesonSpecies {kDzero, kDplus, kDstar, kDs};
   enum EPrompFd {kNone,kPrompt,kFeeddown,kBoth};
+  void SetMaxPforIDPion(Double_t maxpIdPion){fmaxPforIDPion=maxpIdPion;}
+  void SetMaxPforIDKaon(Double_t maxpIdKaon){fmaxPforIDKaon=maxpIdKaon;}
 
  private:
 
@@ -133,7 +135,10 @@ class AliAnalysisTaskCombinHF : public AliAnalysisTaskSE
   Bool_t fGoUpToQuark;   // flag for definition of c,b origin
   Int_t fFullAnalysis;   // flag to set analysis level (0 is the fastest)
 
-  ClassDef(AliAnalysisTaskCombinHF,2); // D+ task from AOD tracks
+  Double_t fmaxPforIDPion; // flag for upper p limit for id band for pion
+  Double_t fmaxPforIDKaon; // flag for upper p limit for id band for kaon
+  Bool_t   fKeepNegID;    // flag to keep also track with negative ID (default kFALSE, change it only if you know what you are doing)
+  ClassDef(AliAnalysisTaskCombinHF,3); // D+ task from AOD tracks
 };
 
 #endif
index 7aebe5b..38ec670 100644 (file)
@@ -15,6 +15,7 @@ AliAnalysisTaskCombinHF *AddTaskCombinHF(Int_t meson=0, TString containerStr="",
     TFile *f=TFile::Open(cutObjFile.Data(),"READ");
     if(f){
       analysiscuts=(AliRDHFCuts*)f->Get(cutObjNam.Data());
+      AliESDtrackCuts *esdc=analysiscuts->GetTrackCuts();
       pid=analysiscuts->GetPidHF();
     }
   }
@@ -38,6 +39,11 @@ AliAnalysisTaskCombinHF *AddTaskCombinHF(Int_t meson=0, TString containerStr="",
   }
 
   AliAnalysisTaskCombinHF *dTask = new AliAnalysisTaskCombinHF(meson,analysiscuts);
+  if(!cutObjFile.IsNull()){
+    dTask->SetKaonTrackCuts(esdc);
+    dTask->SetPionTrackCuts(esdc);
+    dTask->SetTrackCuts(esdc);
+  }
   dTask->SetReadMC(readMC);
   dTask->SetDebugLevel(0);
   dTask->SetPIDHF(pid);