]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.cxx
Make sure we set the over- and underflow bins for acceptance
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliMCTruthdNdetaTask.cxx
index f45ffde0e6a7445475a8ad38a0df86ec1873c7ec..a276670f1f8c62fada3090917961bda950a6e7b4 100644 (file)
@@ -87,9 +87,12 @@ AliMCTruthdNdetaTask::GetHistogram(const AliAODEvent* aod, Bool_t mc)
     return 0;
   }
   TH2D* ret = static_cast<TH2D*>(obj);
-  // Need to fill underflow bin with 1's 
-  for (Int_t i = 1; i <= ret->GetNbinsX(); i++)  
-    ret->SetBinContent(i, 0, 1);
+  Int_t nY  = ret->GetNbinsY();
+  // Need to fill under-/overflow bin with 1's 
+  for (Int_t i = 1; i <= ret->GetNbinsX(); i++)  {
+    ret->SetBinContent(i, 0,    1);
+    ret->SetBinContent(i, nY+1, 1);
+  }
   return ret;
 }