[Rivet-svn] r3597 - trunk/src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Mar 2 09:51:39 GMT 2012


Author: richardn
Date: Fri Mar  2 09:51:39 2012
New Revision: 3597

Log:
fix to avoid root of negative numbers

Modified:
   trunk/src/Analyses/ATLAS_2010_S8894728.cc

Modified: trunk/src/Analyses/ATLAS_2010_S8894728.cc
==============================================================================
--- trunk/src/Analyses/ATLAS_2010_S8894728.cc	Thu Mar  1 22:59:44 2012	(r3596)
+++ trunk/src/Analyses/ATLAS_2010_S8894728.cc	Fri Mar  2 09:51:39 2012	(r3597)
@@ -260,7 +260,7 @@
         /// @todo Assuming unit weights here! Should use N_effective = sumW**2/sumW2? How?
         const double numentries = moment_profiles[0]->binEntries(b);
         const double var = moment_profiles[1]->binHeight(b) - pow(moment_profiles[0]->binHeight(b), 2);
-        const double sd = isZero(var) ? 0 : sqrt(var); //< Numerical safety check
+        const double sd = fuzzyLessEquals(var,0.) ? 0 : sqrt(var); //< Numerical safety check
         target_dps->point(b)->coordinate(1)->setValue(sd);
         if (sd == 0 || numentries < 3) {
           MSG_WARNING("Need at least 3 bin entries and a non-zero central value to calculate "


More information about the Rivet-svn mailing list