Dplus task used AliAODPidHF via AliRDHFCutsDplustoKpipi (Renu, Francesco)
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Jul 2010 15:04:02 +0000 (15:04 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Jul 2010 15:04:02 +0000 (15:04 +0000)
PWG3/vertexingHF/AliAnalysisTaskSEDplus.h
PWG3/vertexingHF/AliRDHFCutsDplustoKpipi.cxx
PWG3/vertexingHF/AliRDHFCutsDplustoKpipi.h
PWG3/vertexingHF/macros/AddTaskDplus.C

index 29fb45e..8ef7ef3 100644 (file)
@@ -64,7 +64,7 @@ class AliAnalysisTaskSEDplus : public AliAnalysisTaskSE
   Int_t GetBackgroundHistoIndex(Int_t iPtBin) const { return iPtBin*3+2;}
   Int_t GetLSHistoIndex(Int_t iPtBin)const { return iPtBin*5;}
  
-  enum {kMaxPtBins=10};
+  enum {kMaxPtBins=20};
 
   TList   *fOutput; //! list send on output slot 0
   TH1F    *fHistNEvents; //!hist. for No. of events
index cfc62ff..7f0f07b 100644 (file)
@@ -29,6 +29,7 @@
 #include "AliAODTrack.h"
 #include "AliESDtrack.h"
 
+
 ClassImp(AliRDHFCutsDplustoKpipi)
 
 //--------------------------------------------------------------------------
@@ -80,6 +81,22 @@ AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const char* name) :
   SetVarsForOpt(5,forOpt);
   Float_t limits[2]={0,999999999.};
   SetPtBins(2,limits);
+  if(fPidHF)delete fPidHF;
+  fPidHF=new AliAODPidHF();
+  Double_t plim[2]={0.6,0.8};
+  Double_t nsigma[5]={2.,1.,2.,3.,0.};
+  
+  fPidHF->SetPLimit(plim);
+  fPidHF->SetAsym(kTRUE);
+  fPidHF->SetSigma(nsigma);
+  fPidHF->SetMatch(1);
+  fPidHF->SetTPC(1);
+  fPidHF->SetTOF(1);
+  fPidHF->SetITS(0);
+  fPidHF->SetTRD(0);
+  fPidHF->SetCompat(kTRUE);
+
+  
 }
 //--------------------------------------------------------------------------
 AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const AliRDHFCutsDplustoKpipi &source) :
@@ -102,6 +119,7 @@ AliRDHFCutsDplustoKpipi &AliRDHFCutsDplustoKpipi::operator=(const AliRDHFCutsDpl
 
   return *this;
 }
+//
 
 
 //---------------------------------------------------------------------------
@@ -206,6 +224,42 @@ void AliRDHFCutsDplustoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *var
   }
   return;
 }
+
+//---------------------------------------------------------------------------
+Int_t AliRDHFCutsDplustoKpipi::IsSelectedPID(AliAODRecoDecayHF *rd)const {
+  //PID 
+  if(!fUsePID || !rd) return 1;
+  //if(fUsePID)printf("i am inside the pid \n");
+  Int_t nkaons=0;
+  Int_t nNotKaons=0;
+  Int_t sign= rd->GetCharge(); 
+  for(Int_t daught=0;daught<3;daught++){
+    AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(daught);
+    Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion);
+    Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon);
+    Int_t isProton=fPidHF->MakeRawPid(track,AliPID::kProton);
+    
+    if(isProton>0 &&  isKaon<0  && isPion<0) return 0;
+    if(isKaon>0 && isPion<0) nkaons++;
+    if(isKaon<0) nNotKaons++;  
+    if(sign==track->Charge()){//pions
+      if(isPion<0)return 0;
+    }
+      else{//kaons
+       if(isKaon<0)return 0;
+      }
+    
+      
+  }
+  
+  if(nkaons>1)return 0;
+  if(nNotKaons==3)return 0;
+  
+  return 1;   
+}
+
+
+
 //---------------------------------------------------------------------------
 Int_t AliRDHFCutsDplustoKpipi::IsSelected(TObject* obj,Int_t selectionLevel) {
   //
@@ -232,15 +286,27 @@ Int_t AliRDHFCutsDplustoKpipi::IsSelected(TObject* obj,Int_t selectionLevel) {
      selectionLevel==AliRDHFCuts::kTracks) {
     if(!AreDaughtersSelected(d)) return 0;
   }
+  
+  // PID selection
+  Int_t returnvaluePID=1;  
+                                          
 
+  //if(selectionLevel==AliRDHFCuts::kAll || 
+  if(selectionLevel==AliRDHFCuts::kCandidate ||     
+ selectionLevel==AliRDHFCuts::kPID) {
+    returnvaluePID = IsSelectedPID(d);
+  }
+  if(returnvaluePID==0)return 0;
+  
+  
   // selection on candidate
   if(selectionLevel==AliRDHFCuts::kAll || 
      selectionLevel==AliRDHFCuts::kCandidate) {
     
     Double_t pt=d->Pt();
-   
+    
     Int_t ptbin=PtBin(pt);
-
+    
     Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
     Double_t mDplus=d->InvMassDplus();
     if(TMath::Abs(mDplus-mDplusPDG)>fCutsRD[GetGlobalIndex(0,ptbin)])return 0;
index 82aaef9..5a54dcc 100644 (file)
 
 
 #include "AliRDHFCuts.h"
-
+#include "AliAODPidHF.h"
 class AliRDHFCutsDplustoKpipi : public AliRDHFCuts 
 {
  public:
 
   AliRDHFCutsDplustoKpipi(const char* name="CutsDplustoKpipi");
   
-  virtual ~AliRDHFCutsDplustoKpipi(){}
-
+  virtual ~AliRDHFCutsDplustoKpipi(){};
   AliRDHFCutsDplustoKpipi(const AliRDHFCutsDplustoKpipi& source);
   AliRDHFCutsDplustoKpipi& operator=(const AliRDHFCutsDplustoKpipi& source); 
  
@@ -30,12 +29,13 @@ class AliRDHFCutsDplustoKpipi : public AliRDHFCuts
 
   using AliRDHFCuts::IsSelected;
   virtual Int_t IsSelected(TObject* obj,Int_t selectionLevel);
-  
+  virtual Int_t IsSelectedPID(AliAODRecoDecayHF *rd) const;
+
+
   Float_t GetMassCut(Int_t iPtBin=0) const { return (GetCuts() ? fCutsRD[GetGlobalIndex(0,iPtBin)] : 1.e6);}
   Float_t GetDCACut(Int_t iPtBin=0) const { return (GetCuts() ? fCutsRD[GetGlobalIndex(1,iPtBin)] : 1.e6);}
   
  protected:
-  
 
   ClassDef(AliRDHFCutsDplustoKpipi,1);  // class for cuts on AOD reconstructed 
                                    // D+->Kpipi
index 1a4b0c3..8b520af 100644 (file)
@@ -1,5 +1,5 @@
-AliAnalysisTaskSEDplus *AddTaskDplus(Bool_t storeNtuple=kTRUE,
-                                    Bool_t readMC=kTRUE)
+AliAnalysisTaskSEDplus *AddTaskDplus(Bool_t storeNtuple=kFALSE,
+                                    Bool_t readMC=kFALSE)
 {
   //                                                                                                                                    
   // Test macro for the AliAnalysisTaskSE for D+ candidates 
@@ -16,14 +16,24 @@ AliAnalysisTaskSEDplus *AddTaskDplus(Bool_t storeNtuple=kTRUE,
   }
 
   //ptbins
-  const Int_t nptbins=4;
+  const Int_t nptbins=14;
   Float_t* ptbins;
   ptbins=new Float_t[nptbins+1];
   ptbins[0]=0.;
-  ptbins[1]=2.;
-  ptbins[2]=3.;
-  ptbins[3]=5.;
-  ptbins[4]=99999.;
+  ptbins[1]=1.;
+  ptbins[2]=2.;
+  ptbins[3]=3.;
+  ptbins[4]=4.;
+  ptbins[5]=5.;
+  ptbins[6]=6.;
+  ptbins[7]=7.;
+  ptbins[8]=8.;
+  ptbins[9]=9.;
+  ptbins[10]=10.;
+  ptbins[11]=12.;
+  ptbins[12]=15.;
+  ptbins[13]=20.;
+  ptbins[14]=99999.;
   const Int_t nvars=12;
 
   
@@ -52,6 +62,7 @@ AliAnalysisTaskSEDplus *AddTaskDplus(Bool_t storeNtuple=kTRUE,
 
  Float_t** anacutsval;
   anacutsval=new Float_t*[nvars];
+
   for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
  //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
    Int_t ic=0;
@@ -83,31 +94,87 @@ AliAnalysisTaskSEDplus *AddTaskDplus(Bool_t storeNtuple=kTRUE,
      anacutsval[ic][ipt]=10000000000.;
    }
    anacutsval[6][0]=0.022100;
-   anacutsval[6][1]=0.034;
-   anacutsval[6][2]=0.020667;
-   anacutsval[6][3]=0.023333;
-
+   anacutsval[6][1]=0.022100;
+   anacutsval[6][2]=0.034;
+   anacutsval[6][3]=0.020667;
+   anacutsval[6][4]=0.020667;
+   anacutsval[6][5]=0.023333;
+   anacutsval[6][6]=0.023333;
+   anacutsval[6][7]=0.023333;
+   anacutsval[6][8]=0.023333;
+   anacutsval[6][9]=0.023333;
+   anacutsval[6][10]=0.023333;
+   anacutsval[6][11]=0.023333;
+   anacutsval[6][12]=0.023333;
+   anacutsval[6][13]=0.023333;
+   anacutsval[6][14]=0.023333;
+   
    anacutsval[7][0]=0.08;
-   anacutsval[7][1]=0.09;
-   anacutsval[7][2]=0.095;
-   anacutsval[7][3]=0.115;
+   anacutsval[7][1]=0.08;
+   anacutsval[7][2]=0.09;
+   anacutsval[7][3]=0.095;
+   anacutsval[7][4]=0.095;
+   anacutsval[7][5]=0.115;
+   anacutsval[7][6]=0.115;
+   anacutsval[7][7]=0.115;
+   anacutsval[7][8]=0.115;
+   anacutsval[7][9]=0.115;
+   anacutsval[7][10]=0.115;
+   anacutsval[7][11]=0.115;
+   anacutsval[7][12]=0.115;
+   anacutsval[7][13]=0.115;
+   anacutsval[7][14]=0.115;
+
 
    anacutsval[8][0]=0.5;
-   anacutsval[8][1]=1.0;
-   anacutsval[8][2]=0.5;
+   anacutsval[8][1]=0.5;
+   anacutsval[8][2]=1.0;
    anacutsval[8][3]=0.5;
+   anacutsval[8][4]=0.5;
+   anacutsval[8][5]=0.5;
+   anacutsval[8][6]=0.5;
+   anacutsval[8][7]=0.5;
+   anacutsval[8][8]=0.5;
+   anacutsval[8][9]=0.5;
+   anacutsval[8][10]=0.5;
+   anacutsval[8][11]=0.5;
+   anacutsval[8][12]=0.5;
+   anacutsval[8][13]=0.5;
+   anacutsval[8][14]=0.5;
+
 
    anacutsval[9][0]=0.979;
-   anacutsval[9][1]=0.9975;
-   anacutsval[9][2]=0.995;
-   anacutsval[9][3]=0.9975;
+   anacutsval[9][1]=0.979;
+   anacutsval[9][2]= 0.9975;//0.99 ; 0.9975;
+   anacutsval[9][3]= 0.995;   //0.99;  //0.995;
+   anacutsval[9][4]= 0.995;   //0.99;  //0.995;
+   anacutsval[9][5]=0.9975; //0.99;
+   anacutsval[9][6]=0.9975; 
+   anacutsval[9][7]=0.9975;
+   anacutsval[9][8]=0.9975;
+   anacutsval[9][9]=0.9975;
+   anacutsval[9][10]=0.9975;
+   anacutsval[9][11]=0.9975;
+   anacutsval[9][12]=0.9975;
+   anacutsval[9][13]=0.9975;
+   anacutsval[9][14]=0.9975;
 
    anacutsval[10][0]=0.0055;
-   anacutsval[10][1]=0.0028;
-   anacutsval[10][2]=0.000883;
+   anacutsval[10][1]=0.0055;
+   anacutsval[10][2]=0.0028;//0.00400
    anacutsval[10][3]=0.000883;
-
-
+   anacutsval[10][4]=0.000883;
+   anacutsval[10][5]=0.000883;
+   anacutsval[10][6]=0.000883;
+   anacutsval[10][7]=0.000883;
+   anacutsval[10][8]=0.000883;
+   anacutsval[10][9]=0.000883;
+   anacutsval[10][10]=0.000883;
+   anacutsval[10][11]=0.000883;
+   anacutsval[10][12]=0.000883;
+   anacutsval[10][13]=0.000883;
+   anacutsval[10][14]=0.000883;
+   
 
  
 //Production cuts
@@ -120,14 +187,19 @@ AliAnalysisTaskSEDplus *AddTaskDplus(Bool_t storeNtuple=kTRUE,
   AliRDHFCutsDplustoKpipi *analysiscuts = new AliRDHFCutsDplustoKpipi();
   analysiscuts->SetPtBins(nptbins+1,ptbins);
   analysiscuts->SetCuts(nvars,nptbins,anacutsval);
-
+  analysiscuts->SetUsePID(kTRUE);
+  
+  //  analysiscuts->SetTPCPID(kTRUE);
+  //analysiscuts->SetTOFPID(kTRUE);
 
   // Aanalysis task
   AliAnalysisTaskSEDplus *dplusTask = new AliAnalysisTaskSEDplus("DplusAnalysis",analysiscuts,prodcuts,storeNtuple);
   dplusTask->SetReadMC(readMC);
   dplusTask->SetDoLikeSign(kTRUE);
+  //  dplusTask->SetUseTPCpid(kTRUE);
+  //dplusTask->SetUseTOFpid(kTRUE);
   dplusTask->SetDebugLevel(0);
-
+   dplusTask->SetMassLimits(0.2);
   mgr->AddTask(dplusTask);
 
  // Create containers for input/output