protection against efficiency value=0 (Sandro)
authorarossi <arossi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Aug 2013 10:37:20 +0000 (10:37 +0000)
committerarossi <arossi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Aug 2013 10:37:20 +0000 (10:37 +0000)
PWGHF/correlationHF/AliAnalysisTaskDStarCorrelations.cxx

index ce569b1..55ceab8 100644 (file)
@@ -540,8 +540,18 @@ void AliAnalysisTaskDStarCorrelations::UserExec(Option_t *){
             */\r
             \r
             \r
-            if(fUseDmesonEfficiencyCorrection)  DmesonWeight = 1./DmesonEfficiency;\r
-            else DmesonWeight = 1.;\r
+           ptDStar = dstarD0pi->Pt();\r
+           phiDStar = dstarD0pi->Phi();\r
+           etaDStar = dstarD0pi->Eta();\r
+\r
+           if(fUseDmesonEfficiencyCorrection){\r
+             if(DmesonEfficiency>1.e-5) DmesonWeight = 1./DmesonEfficiency;\r
+             else {// THIS ELSE STATEMENT MUST BE REFINED: THE EFFICIENCY MAP HAS TO BE REPLACED WITH A WEIGHT MAP COOKED A PRIORI\r
+               if(ptDStar>2.) DmesonWeight = 0.5; // at high pt a zero value in the efficiency can come only from stat fluctutations in MC -> 0.5 is an arbitrary asymptotic value\r
+               else DmesonWeight = 1.e+5; // at low pt it can be that the efficiency is really low\r
+             }\r
+           }\r
+            else DmesonWeight = 1.; \r
             \r
             // continue;\r
             \r
@@ -551,11 +561,7 @@ void AliAnalysisTaskDStarCorrelations::UserExec(Option_t *){
              mcLabelDStar = dstarD0pi->MatchToMC(413,421,pdgDgDStartoD0pi,pdgDgD0toKpi,fmcArray,kFALSE);\r
              if(mcLabelDStar>=0) isDStarMCtag = kTRUE;\r
            }\r
-            \r
-           ptDStar = dstarD0pi->Pt();\r
-           phiDStar = dstarD0pi->Phi();\r
-           etaDStar = dstarD0pi->Eta();\r
-            \r
+                        \r
             \r
            \r
            phiDStar = fCorrelator->SetCorrectPhiRange(phiDStar);\r
@@ -936,7 +942,7 @@ void AliAnalysisTaskDStarCorrelations::UserExec(Option_t *){
                     if(PartSource[3]) MCarraytofill[5] = 5;\r
                     if(!isDfromB) MCarraytofill[6] = 0;\r
                     if(isDfromB) MCarraytofill[6] = 1;\r
-                                       if(!fReco && TMath::Abs(etaHad)>0.9) continue; // makes sure you study the correlation on MC  truth only if particles are in acceptance\r
+                                       if(!fReco && TMath::Abs(etaHad)>0.8) continue; // makes sure you study the correlation on MC  truth only if particles are in acceptance\r
                     ((THnSparseF*)fOutputMC->FindObject("MCDStarCorrelationsDStarHadron"))->Fill(MCarraytofill);\r
                     \r
                     delete[] PartSource;\r
@@ -944,7 +950,7 @@ void AliAnalysisTaskDStarCorrelations::UserExec(Option_t *){
                                }\r
                                if(isInPeak)  {\r
                     \r
-                                       if(!fReco && TMath::Abs(etaHad)>0.9) continue; // makes sure you study the correlation on MC  truth only if particles are in acceptance\r
+                                       if(!fReco && TMath::Abs(etaHad)>0.8) continue; // makes sure you study the correlation on MC  truth only if particles are in acceptance\r
                     \r
                                        if(fselect==1)  ((THnSparseF*)fOutput->FindObject("CorrelationsDStarHadron"))->Fill(arraytofill,weight);\r
                     if(fselect==2)  ((THnSparseF*)fOutput->FindObject("CorrelationsDStarKaon"))->Fill(arraytofill,weight);\r
@@ -958,7 +964,7 @@ void AliAnalysisTaskDStarCorrelations::UserExec(Option_t *){
                                }\r
                                if(isInDZeroSideBand) {\r
                                        \r
-                                       if(!fReco && TMath::Abs(etaHad)>0.9) continue; // makes sure you study the correlation on MC  truth only if particles are in acceptance\r
+                                       if(!fReco && TMath::Abs(etaHad)>0.8) continue; // makes sure you study the correlation on MC  truth only if particles are in acceptance\r
                     \r
                     \r
                     if(fselect==1)  ((THnSparseF*)fOutput->FindObject("DZeroBkgCorrelationsDStarHadron"))->Fill(arraytofill,weight);\r
@@ -972,7 +978,7 @@ void AliAnalysisTaskDStarCorrelations::UserExec(Option_t *){
                                }\r
                 if(isInDStarSideBand) {\r
                                        \r
-                                       if(!fReco && TMath::Abs(etaHad)>0.9) continue; // makes sure you study the correlation on MC  truth only if particles are in acceptance\r
+                                       if(!fReco && TMath::Abs(etaHad)>0.8) continue; // makes sure you study the correlation on MC  truth only if particles are in acceptance\r
                     \r
                     \r
                     if(fselect==1 && fFullmode)  ((THnSparseF*)fOutput->FindObject("DStarBkgCorrelationsDStarHadron"))->Fill(arraytofill,weight);\r