[Rivet-svn] r3154 - trunk/src/Projections

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Sat Jun 11 15:53:48 BST 2011


Author: richardn
Date: Sat Jun 11 15:53:48 2011
New Revision: 3154

Log:
fix to finding closest piar in InvMassFinalState

Modified:
   trunk/src/Projections/InvMassFinalState.cc

Modified: trunk/src/Projections/InvMassFinalState.cc
==============================================================================
--- trunk/src/Projections/InvMassFinalState.cc	Sat Jun 11 15:53:03 2011	(r3153)
+++ trunk/src/Projections/InvMassFinalState.cc	Sat Jun 11 15:53:48 2011	(r3154)
@@ -80,6 +80,7 @@
         }
       }
     }
+    if(type1.empty() || type2.empty()) return;
 
     // Temporary container of selected particles iterators
     // Useful to compare iterators and avoid double occurrences of the same
@@ -88,6 +89,7 @@
 
     // Now calculate the inv mass
     pair<double, pair<Particle, Particle> > closestPair;
+    closestPair.first = 1e30;
     foreach (const Particle* i1, type1) {
       foreach (const Particle* i2, type2) {
 	// check this is actually a pair 
@@ -132,7 +134,7 @@
         }
       }
     }
-    if (_masstarget>0.0) {
+    if (_masstarget>0.0&&closestPair.first<1e30) {
       _theParticles.clear();
       _particlePairs.clear();
       _theParticles += closestPair.second.first;


More information about the Rivet-svn mailing list