[Rivet-svn] r3511 - in trunk: . src/Core

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Dec 6 15:21:29 GMT 2011


Author: buckley
Date: Tue Dec  6 15:21:28 2011
New Revision: 3511

Log:
Include underflow and overflow bins in the normalisation when calling Analysis::normalise(h). Only applies to LWH histos so no need to merge this change into the YODA branch

Modified:
   trunk/ChangeLog
   trunk/src/Core/Analysis.cc

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Tue Dec  6 14:02:03 2011	(r3510)
+++ trunk/ChangeLog	Tue Dec  6 15:21:28 2011	(r3511)
@@ -1,3 +1,8 @@
+2011-12-06  Andy Buckley  <andy.buckley at cern.ch>
+
+	* Include underflow and overflow bins in the normalisation when
+	calling Analysis::normalise(h)
+
 2011-11-23  Andy Buckley  <andy.buckley at cern.ch>
 
 	* Bumping version to 1.8.0alpha0 since the Jet interface changes

Modified: trunk/src/Core/Analysis.cc
==============================================================================
--- trunk/src/Core/Analysis.cc	Tue Dec  6 14:02:03 2011	(r3510)
+++ trunk/src/Core/Analysis.cc	Tue Dec  6 15:21:28 2011	(r3511)
@@ -488,12 +488,18 @@
     const string hpath = tree().findPath(dynamic_cast<const AIDA::IManagedObject&>(*histo));
     MSG_TRACE("Normalizing histo " << hpath << " to " << norm);
 
+    // Get integral
     double oldintg = 0.0;
     int nBins = histo->axis().bins();
     for (int iBin = 0; iBin != nBins; ++iBin) {
       // Leaving out factor of binWidth because AIDA's "height" already includes a width factor.
       oldintg += histo->binHeight(iBin); // * histo->axis().binWidth(iBin);
     }
+    // Include overflow bins in the integral
+    oldintg += histo->binHeight(AIDA::IAxis::UNDERFLOW_BIN);
+    oldintg += histo->binHeight(AIDA::IAxis::OVERFLOW_BIN);
+
+    // Sanity check
     if (oldintg == 0.0) {
       MSG_WARNING("Histo " << hpath << " has null integral during normalization");
       return;


More information about the Rivet-svn mailing list