[Rivet-svn] r3481 - in trunk: . src/Analyses src/Projections

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Nov 11 18:56:39 GMT 2011


Author: buckley
Date: Fri Nov 11 18:56:39 2011
New Revision: 3481

Log:
Protecting the OPAL 2004 analysis against NaNs in the hemispheres projection -- I can't track the origin of these and suspect some occasional memory corruption.

Modified:
   trunk/ChangeLog
   trunk/src/Analyses/OPAL_2004_S6132243.cc
   trunk/src/Projections/Hemispheres.cc

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Fri Nov 11 18:11:32 2011	(r3480)
+++ trunk/ChangeLog	Fri Nov 11 18:56:39 2011	(r3481)
@@ -1,3 +1,9 @@
+2011-11-11  Andy Buckley  <andy.buckley at cern.ch>
+
+	* Protecting the OPAL 2004 analysis against NaNs in the
+	hemispheres projection -- I can't track the origin of these and
+	suspect some occasional memory corruption.
+
 2011-11-09  Andy Buckley  <andy at insectnation.org>
 
 	* Renaming source files for EXAMPLE and

Modified: trunk/src/Analyses/OPAL_2004_S6132243.cc
==============================================================================
--- trunk/src/Analyses/OPAL_2004_S6132243.cc	Fri Nov 11 18:11:32 2011	(r3480)
+++ trunk/src/Analyses/OPAL_2004_S6132243.cc	Fri Nov 11 18:56:39 2011	(r3481)
@@ -159,29 +159,29 @@
       // The paper says that M_H/L are scaled by sqrt(s), but scaling by E_vis is the way that fits the data...
       const double hemi_mh = hemi.scaledMhigh();
       const double hemi_ml = hemi.scaledMlow();
-      /// @todo This shouldn't be necessary... what's going on? :(
+      /// @todo This shouldn't be necessary... what's going on? Memory corruption suspected :(
       // if (isnan(hemi_ml)) {
       //   MSG_ERROR("NaN in HemiL! Event = " << numEvents());
       //   MSG_ERROR(hemi.M2low() << ", " << hemi.E2vis());
       // }
-      // if (!isnan(hemi_mh) && !isnan(hemi_ml)) {
-      const double hemi_bmax = hemi.Bmax();
-      const double hemi_bmin = hemi.Bmin();
-      const double hemi_bsum = hemi.Bsum();
-      _histHemiMassH[_isqrts]->fill(hemi_mh, weight);
-      _histHemiMassL[_isqrts]->fill(hemi_ml, weight);
-      _histHemiBroadW[_isqrts]->fill(hemi_bmax, weight);
-      _histHemiBroadN[_isqrts]->fill(hemi_bmin, weight);
-      _histHemiBroadT[_isqrts]->fill(hemi_bsum, weight);
-      for (int n = 1; n <= 5; ++n) {
-        // if (isnan(pow(hemi_ml, n))) MSG_ERROR("NaN in HemiL moment! Event = " << numEvents());
-        _histHemiMassHMom[_isqrts]->fill(n, pow(hemi_mh, n)*weight);
-        _histHemiMassLMom[_isqrts]->fill(n, pow(hemi_ml, n)*weight);
-        _histHemiBroadWMom[_isqrts]->fill(n, pow(hemi_bmax, n)*weight);
-        _histHemiBroadNMom[_isqrts]->fill(n, pow(hemi_bmin, n)*weight);
-        _histHemiBroadTMom[_isqrts]->fill(n, pow(hemi_bsum, n)*weight);
+      if (!isnan(hemi_mh) && !isnan(hemi_ml)) {
+        const double hemi_bmax = hemi.Bmax();
+        const double hemi_bmin = hemi.Bmin();
+        const double hemi_bsum = hemi.Bsum();
+        _histHemiMassH[_isqrts]->fill(hemi_mh, weight);
+        _histHemiMassL[_isqrts]->fill(hemi_ml, weight);
+        _histHemiBroadW[_isqrts]->fill(hemi_bmax, weight);
+        _histHemiBroadN[_isqrts]->fill(hemi_bmin, weight);
+        _histHemiBroadT[_isqrts]->fill(hemi_bsum, weight);
+        for (int n = 1; n <= 5; ++n) {
+          // if (isnan(pow(hemi_ml, n))) MSG_ERROR("NaN in HemiL moment! Event = " << numEvents());
+          _histHemiMassHMom[_isqrts]->fill(n, pow(hemi_mh, n)*weight);
+          _histHemiMassLMom[_isqrts]->fill(n, pow(hemi_ml, n)*weight);
+          _histHemiBroadWMom[_isqrts]->fill(n, pow(hemi_bmax, n)*weight);
+          _histHemiBroadNMom[_isqrts]->fill(n, pow(hemi_bmin, n)*weight);
+          _histHemiBroadTMom[_isqrts]->fill(n, pow(hemi_bsum, n)*weight);
+        }
       }
-      // }
     }
 
 

Modified: trunk/src/Projections/Hemispheres.cc
==============================================================================
--- trunk/src/Projections/Hemispheres.cc	Fri Nov 11 18:11:32 2011	(r3480)
+++ trunk/src/Projections/Hemispheres.cc	Fri Nov 11 18:56:39 2011	(r3481)
@@ -55,8 +55,6 @@
     _M2high = max(mass2With, mass2Against);
     _M2low = min(mass2With, mass2Against);
 
-    if (_M2low < 0) cout << _M2low << ", " << p4With << " / " << p4Against << endl;
-
     // Calculate broadenings.
     broadWith /= broadDenom;
     broadAgainst /= broadDenom;


More information about the Rivet-svn mailing list