From Chiara
authorloizides <cloizides@lbl.gov>
Wed, 8 Jan 2014 15:07:07 +0000 (16:07 +0100)
committerloizides <cloizides@lbl.gov>
Wed, 8 Jan 2014 15:07:07 +0000 (16:07 +0100)
PWGJE/FlavourJetTasks/AliAnalysisTaskFlavourJetCorrelations.cxx
PWGJE/FlavourJetTasks/AliAnalysisTaskFlavourJetCorrelations.h
PWGJE/FlavourJetTasks/macros/AddTaskFlavourJetCorrelations.C

index 9cc934e..de17b49 100644 (file)
@@ -616,6 +616,7 @@ Bool_t  AliAnalysisTaskFlavourJetCorrelations::DefineHistoForAnalysis(){
    fmyOutput->Add(hDeltaRD);\r
    \r
    //background (side bands for the Dstar and like sign for D0)\r
+   fJetRadius=GetJetContainer(0)->GetJetRadius();\r
    TH2F* hInvMassptD = new TH2F("hInvMassptD",Form("D (Delta R < %.1f) invariant mass distribution p_{T}^{j} > threshold",fJetRadius),nbinsmass,fMinMass,fMaxMass,nbinsptD,ptDlims[0],ptDlims[1]);\r
    hInvMassptD->SetStats(kTRUE);\r
    hInvMassptD->GetXaxis()->SetTitle("mass (GeV)");\r
@@ -632,10 +633,10 @@ Bool_t  AliAnalysisTaskFlavourJetCorrelations::DefineHistoForAnalysis(){
       fmyOutput->Add(hInvMassptDbg);\r
       \r
    }\r
-   const Int_t nAxis=5;\r
-   const Int_t nbinsSparse[nAxis]={nbinsz,nbinsphi,nbinsptjet,nbinsptD,nbinsmass};\r
-   const Double_t minSparse[nAxis]={zlims[0],philims[0],ptjetlims[0],ptDlims[0],fMinMass};\r
-   const Double_t maxSparse[nAxis]={zlims[1],philims[1],ptjetlims[1],ptDlims[1],fMaxMass};\r
+   const Int_t nAxis=6;\r
+   const Int_t nbinsSparse[nAxis]={nbinsz,nbinsphi,nbinsptjet,nbinsptD,nbinsmass,2};\r
+   const Double_t minSparse[nAxis]={zlims[0],philims[0],ptjetlims[0],ptDlims[0],fMinMass,-0.5};\r
+   const Double_t maxSparse[nAxis]={zlims[1],philims[1],ptjetlims[1],ptDlims[1],fMaxMass, 1.5};\r
    THnSparseF *hsDphiz=new THnSparseF("hsDphiz","Z and #Delta#phi vs p_{T}^{jet}, p_{T}^{D}, and mass", nAxis, nbinsSparse, minSparse, maxSparse);\r
    hsDphiz->Sumw2();\r
    \r
@@ -728,7 +729,9 @@ void AliAnalysisTaskFlavourJetCorrelations::FillHistogramsDstarJetCorr(AliAODRec
    \r
    TH3F* hPtJetWithD=(TH3F*)fmyOutput->FindObject("hPtJetWithD");\r
    THnSparseF* hsDphiz=(THnSparseF*)fmyOutput->FindObject("hsDphiz");\r
-   Double_t point[5]={z,dPhi,ptj,ptD,deltamass};\r
+   Int_t isSB=IsDzeroSideBand(dstar);\r
+   \r
+   Double_t point[6]={z,dPhi,ptj,ptD,deltamass,isSB};\r
 \r
    if(deltaR<fJetRadius) hPtJetWithD->Fill(ptj,deltamass,ptD);\r
    \r
@@ -744,7 +747,7 @@ void AliAnalysisTaskFlavourJetCorrelations::FillHistogramsMCGenDJetCorr(Double_t
    Double_t pdgmass=0;\r
    TH3F* hPtJetWithD=(TH3F*)fmyOutput->FindObject("hPtJetWithD");\r
    THnSparseF* hsDphiz=(THnSparseF*)fmyOutput->FindObject("hsDphiz");\r
-   Double_t point[5]={z,dPhi,ptjet,ptD,pdgmass};\r
+   Double_t point[6]={z,dPhi,ptjet,ptD,pdgmass,0};\r
 \r
    if(fCandidateType==kD0toKpi) pdgmass=TDatabasePDG::Instance()->GetParticle(421)->Mass();\r
    if(fCandidateType==kDstartoKpipi) pdgmass=TDatabasePDG::Instance()->GetParticle(413)->Mass()-TDatabasePDG::Instance()->GetParticle(421)->Mass();\r
@@ -787,19 +790,7 @@ void AliAnalysisTaskFlavourJetCorrelations::SideBandBackground(AliAODRecoCascade
    TH2F* hDiffSideBand=(TH2F*)fmyOutput->FindObject("hDiffSideBand");\r
    TH3F* hPtJetWithDsb=(TH3F*)fmyOutput->FindObject("hPtJetWithDsb");\r
    \r
-   Double_t mPDGD0=TDatabasePDG::Instance()->GetParticle(421)->Mass();\r
-   \r
-   Int_t bin = fCuts->PtBin(candDstar->Pt());\r
-   if (bin < 0)\r
-     {\r
-       // /PWGHF/vertexingHF/AliRDHFCuts::PtBin(Double_t) const may return values below zero depending on config.\r
-       bin = 9999; // void result code for coverity (bin later in the code non-zero) - will coverity pick up on this?\r
-       return;\r
-     }\r
-   Float_t fourSigmal= mPDGD0-4.*fSigmaD0[bin] , sixSigmal= mPDGD0-8.*fSigmaD0[bin];\r
-   Float_t fourSigmar= mPDGD0+4.*fSigmaD0[bin] , sixSigmar= mPDGD0+8.*fSigmaD0[bin];\r
-   \r
-   Double_t invM=candDstar->InvMassD0(),  deltaM=candDstar->DeltaInvMass(); \r
+   Double_t deltaM=candDstar->DeltaInvMass(); \r
    //Printf("Inv mass = %f between %f and %f or %f and %f?",invM, sixSigmal,fourSigmal,fourSigmar,sixSigmar);\r
    Double_t ptD=candDstar->Pt();\r
    Double_t ptjet=jet->Pt();\r
@@ -808,8 +799,9 @@ void AliAnalysisTaskFlavourJetCorrelations::SideBandBackground(AliAODRecoCascade
    if(dPhi>TMath::Pi())dPhi = dPhi - 2.*TMath::Pi();\r
    if(dPhi<(-1.*TMath::Pi()))dPhi = dPhi + 2.*TMath::Pi();\r
    \r
+   Int_t isSideBand=IsDzeroSideBand(candDstar);\r
    //fill the background histogram with the side bands or when looking at MC with the real background\r
-   if((invM>sixSigmal && invM<fourSigmal) || (invM>fourSigmar && invM<=sixSigmar)){  \r
+   if(isSideBand==1){\r
       hDiffSideBand->Fill(deltaM,ptD); // M(Kpipi)-M(Kpi) side band background    \r
       //hdeltaPhiDjaB->Fill(deltaM,ptD,dPhi);\r
       \r
@@ -885,3 +877,26 @@ Float_t AliAnalysisTaskFlavourJetCorrelations::DeltaR(AliVParticle *p1, AliVPart
    return deltaR;\r
    \r
 }\r
+\r
+//_______________________________________________________________________________\r
+\r
+Int_t AliAnalysisTaskFlavourJetCorrelations::IsDzeroSideBand(AliAODRecoCascadeHF *candDstar){\r
+   \r
+   Double_t ptD=candDstar->Pt();\r
+   Int_t bin = fCuts->PtBin(ptD);\r
+   if (bin < 0){\r
+      // /PWGHF/vertexingHF/AliRDHFCuts::PtBin(Double_t) const may return values below zero depending on config.\r
+      bin = 9999; // void result code for coverity (bin later in the code non-zero) - will coverity pick up on this?      \r
+      return -1;  // out of bounds\r
+   }\r
+   \r
+   Double_t invM=candDstar->InvMassD0();\r
+   Double_t mPDGD0=TDatabasePDG::Instance()->GetParticle(421)->Mass();\r
+\r
+   Float_t fourSigmal= mPDGD0-4.*fSigmaD0[bin] , sixSigmal= mPDGD0-8.*fSigmaD0[bin];\r
+   Float_t fourSigmar= mPDGD0+4.*fSigmaD0[bin] , sixSigmar= mPDGD0+8.*fSigmaD0[bin];\r
+   \r
+   if((invM>=sixSigmal && invM<fourSigmal) || (invM>fourSigmar && invM<=sixSigmar)) return 1;\r
+   else return 0;   \r
+\r
+}\r
index 3eb2404..c5c246e 100644 (file)
@@ -91,7 +91,8 @@ class AliAnalysisTaskFlavourJetCorrelations : public AliAnalysisTaskEmcalJet
   void MCBackground(AliAODRecoDecayHF *candbg, AliEmcalJet *jet);\r
   void FillMassHistograms(Double_t mass,Double_t ptD, Double_t deltaR);\r
   void FlagFlavour(AliVParticle* charm, AliEmcalJet* jet);\r
-  \r
+  Int_t IsDzeroSideBand(AliAODRecoCascadeHF *candDstar);
+\r
  private:\r
   \r
   AliAnalysisTaskFlavourJetCorrelations(const AliAnalysisTaskFlavourJetCorrelations &source);\r
index 0958e23..a5f9dd1 100644 (file)
@@ -58,6 +58,7 @@ AliAnalysisTaskFlavourJetCorrelations *AddTaskFlavourJetCorrelations(
   task->SetMC(theMCon);\r
   task->SetUseReco(reco);\r
   task->SetTriggerOnLeadingJet(triggerOnLeadingJet);\r
+  task->SetJetAcceptanceType(cutType);\r
 \r
   mgr->AddTask(task);\r
 \r