[Rivet-svn] r3480 - in trunk: include/Rivet/Projections src/Analyses src/Projections

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


Author: buckley
Date: Fri Nov 11 18:11:32 2011
New Revision: 3480

Log:
Investigating/fixing light hemisphere mass problem in OPAL 2004

Modified:
   trunk/include/Rivet/Projections/Hemispheres.hh
   trunk/src/Analyses/OPAL_2004_S6132243.cc
   trunk/src/Projections/Hemispheres.cc

Modified: trunk/include/Rivet/Projections/Hemispheres.hh
==============================================================================
--- trunk/include/Rivet/Projections/Hemispheres.hh	Wed Nov  9 18:23:59 2011	(r3479)
+++ trunk/include/Rivet/Projections/Hemispheres.hh	Fri Nov 11 18:11:32 2011	(r3480)
@@ -10,55 +10,51 @@
 
 namespace Rivet {
 
-  /**
-     @brief Calculate the hemisphere masses and broadenings.
-
-     Calculate the hemisphere masses and broadenings, with event hemispheres
-     defined by the plane normal to the thrust vector, \f$ \vec{n}_\mathrm{T} \f$.
-
-     @todo Allow axes to be defined by sphericity: superclass Thrust and Sphericity as AxisDefinition?
-
-     The "high" hemisphere mass,
-     \f$ M^2_\mathrm{high} / E^2_\mathrm{vis} \f$, is defined as
-     \f[
-     \frac{M^2_\mathrm{high}}{E^2_\mathrm{vis}} =
-     \frac{1}{E^2_\mathrm{vis}} \max
-     \left(
-     \left| \sum_{\vec{p}_k \cdot \vec{n}_\mathrm{T} > 0} p_k \right|^2 ,
-     \left| \sum_{\vec{p}_k \cdot \vec{n}_\mathrm{T} < 0} p_k \right|^2
-     \right)
-     \f]
-     and the corresponding "low" hemisphere mass,
-     \f$ M^2_\mathrm{low} / E^2_\mathrm{vis} \f$,
-     is the sum of momentum vectors in the opposite hemisphere, i.e.
-     \f$ \max \rightarrow \min \f$ in the formula above.
-
-     Finally, we define a hemisphere mass difference:
-     \f[
-     \frac{M^2_\mathrm{diff} }{ E^2_\mathrm{vis}} =
-     \frac{ M^2_\mathrm{high} - M^2_\mathrm{low} }{ E^2_\mathrm{vis}} .
-     \f]
-
-     Similarly to the masses, we also define hemisphere broadenings, using the
-     momenta transverse to the thrust axis:
-     \f[
-     B_\pm =
-     \frac{
-       \sum{\pm \vec{p}_i \cdot \vec{n}_\mathrm{T} > 0}
-       |\vec{p}_i \times \vec{n}_\mathrm{T} |
-     }{
-       2 \sum_i | \vec{p}_i |
-     }
-     \f]
-     and then a set of the broadening maximum, minimum, sum and difference as follows:
-     \f[ B_\mathrm{max}  = \max(B_+, B_-) \f]
-     \f[ B_\mathrm{min}  = \min(B_+, B_-) \f]
-     \f[ B_\mathrm{sum}  = B_+ + B_- \f]
-     \f[ B_\mathrm{diff} = |B_+ - B_-| \f]
-
-     Internally, this projection uses a Thrust or Sphericity projection to
-     determine the hemisphere orientation.
-  */
+  /// @brief Calculate the hemisphere masses and broadenings.
+  ///
+  /// Calculate the hemisphere masses and broadenings, with event hemispheres
+  /// defined by the plane normal to the thrust vector, \f$ \vec{n}_\mathrm{T} \f$.
+  ///
+  /// The "high" hemisphere mass,
+  /// \f$ M^2_\mathrm{high} / E^2_\mathrm{vis} \f$, is defined as
+  /// \f[
+  /// \frac{M^2_\mathrm{high}}{E^2_\mathrm{vis}} =
+  /// \frac{1}{E^2_\mathrm{vis}} \max
+  /// \left(
+  /// \left| \sum_{\vec{p}_k \cdot \vec{n}_\mathrm{T} > 0} p_k \right|^2 ,
+  /// \left| \sum_{\vec{p}_k \cdot \vec{n}_\mathrm{T} < 0} p_k \right|^2
+  /// \right)
+  /// \f]
+  /// and the corresponding "low" hemisphere mass,
+  /// \f$ M^2_\mathrm{low} / E^2_\mathrm{vis} \f$,
+  /// is the sum of momentum vectors in the opposite hemisphere, i.e.
+  /// \f$ \max \rightarrow \min \f$ in the formula above.
+  ///
+  /// Finally, we define a hemisphere mass difference:
+  /// \f[
+  /// \frac{M^2_\mathrm{diff} }{ E^2_\mathrm{vis}} =
+  /// \frac{ M^2_\mathrm{high} - M^2_\mathrm{low} }{ E^2_\mathrm{vis}} .
+  /// \f]
+  ///
+  /// Similarly to the masses, we also define hemisphere broadenings, using the
+  /// momenta transverse to the thrust axis:
+  /// \f[
+  /// B_\pm =
+  /// \frac{
+  ///   \sum{\pm \vec{p}_i \cdot \vec{n}_\mathrm{T} > 0}
+  ///   |\vec{p}_i \times \vec{n}_\mathrm{T} |
+  /// }{
+  ///   2 \sum_i | \vec{p}_i |
+  /// }
+  /// \f]
+  /// and then a set of the broadening maximum, minimum, sum and difference as follows:
+  /// \f[ B_\mathrm{max}  = \max(B_+, B_-) \f]
+  /// \f[ B_\mathrm{min}  = \min(B_+, B_-) \f]
+  /// \f[ B_\mathrm{sum}  = B_+ + B_- \f]
+  /// \f[ B_\mathrm{diff} = |B_+ - B_-| \f]
+  ///
+  /// Internally, this projection uses a Thrust or Sphericity projection to
+  /// determine the hemisphere orientation.
   class Hemispheres : public Projection {
   public:
 
@@ -114,15 +110,15 @@
     double Mdiff() const { return sqrt(M2diff()); }
 
     double scaledM2high() const {
-      if (_M2high == 0.0) return 0.0;
-      if (_E2vis != 0.0) return _M2high/_E2vis;
+      if (isZero(_M2high)) return 0.0;
+      if (!isZero(_E2vis)) return _M2high/_E2vis;
       else return std::numeric_limits<double>::max();
     }
     double scaledMhigh() const { return sqrt(scaledM2high()); }
 
     double scaledM2low() const {
-      if (_M2low == 0.0) return 0.0;
-      if (_E2vis != 0.0) return _M2low/_E2vis;
+      if (isZero(_M2low)) return 0.0;
+      if (!isZero(_E2vis)) return _M2low/_E2vis;
       else return std::numeric_limits<double>::max();
     }
     double scaledMlow() const { return sqrt(scaledM2low()); }
@@ -150,7 +146,7 @@
       return _highMassEqMaxBroad;
     }
 
-     
+
   private:
 
     /// Visible energy-squared, \f$ E^2_\mathrm{vis} \f$.

Modified: trunk/src/Analyses/OPAL_2004_S6132243.cc
==============================================================================
--- trunk/src/Analyses/OPAL_2004_S6132243.cc	Wed Nov  9 18:23:59 2011	(r3479)
+++ trunk/src/Analyses/OPAL_2004_S6132243.cc	Fri Nov 11 18:11:32 2011	(r3480)
@@ -159,7 +159,12 @@
       // 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? :(
+      // 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();
@@ -169,12 +174,14 @@
       _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	Wed Nov  9 18:23:59 2011	(r3479)
+++ trunk/src/Projections/Hemispheres.cc	Fri Nov 11 18:11:32 2011	(r3480)
@@ -5,6 +5,8 @@
 
 
   void Hemispheres::project(const Event& e) {
+    clear();
+
     // Get thrust axes.
     const AxesDefinition& ax = applyProjection<AxesDefinition>(e, "Axes");
     const Vector3 n = ax.axis1();
@@ -14,7 +16,7 @@
     double Evis(0), broadWith(0), broadAgainst(0), broadDenom(0);
     const FinalState& fs = applyProjection<FinalState>(e, ax.getProjection("FS"));
     const ParticleVector& particles = fs.particles();
-    MSG_DEBUG("number of particles = " << particles.size());
+    MSG_DEBUG("Number of particles = " << particles.size());
     foreach (const Particle& p, particles) {
       const FourMomentum p4 = p.momentum();
       const Vector3 p3 = p4.vector3();
@@ -36,7 +38,7 @@
       } else {
         // In the incredibly unlikely event that a particle goes exactly along the
         // thrust plane, add half to each hemisphere.
-        MSG_DEBUG("Particle split between hemispheres");
+        MSG_WARNING("Particle split between hemispheres");
         p4With += 0.5 * p4;
         p4Against += 0.5 * p4;
         broadWith += 0.5 * p3Trans;
@@ -53,6 +55,8 @@
     _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