|
[Rivet-svn] r2779 - in trunk: . include/Rivet/Math include/Rivet/Projections src/Analysesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgFri Nov 26 22:06:47 GMT 2010
Author: buckley Date: Fri Nov 26 22:06:47 2010 New Revision: 2779 Log: Improved boundary checking on closed interval inRange for floating point values Modified: trunk/ChangeLog trunk/include/Rivet/Math/MathUtils.hh trunk/include/Rivet/Projections/JetShape.hh trunk/src/Analyses/CDF_2005_S6217184.cc trunk/src/Analyses/CDF_2008_S7782535.cc Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Fri Nov 26 21:24:22 2010 (r2778) +++ trunk/ChangeLog Fri Nov 26 22:06:47 2010 (r2779) @@ -1,5 +1,13 @@ 2010-11-26 Andy Buckley <andy at insectnation.org> + * Tweak to floating point inRange to use fuzzyEquals for CLOSED + interval equality comparisons. + + * Some BibTeX generation improvements, and fixing the ATLAS dijet + BibTeX key. + + * Resolution upgrade in PNG make-plots output. + * CDF_2005_S6217184.cc, CDF_2008_S7782535.cc: Updates to use the new per-jet JetAlg interface (and some other fixes). Modified: trunk/include/Rivet/Math/MathUtils.hh ============================================================================== --- trunk/include/Rivet/Math/MathUtils.hh Fri Nov 26 21:24:22 2010 (r2778) +++ trunk/include/Rivet/Math/MathUtils.hh Fri Nov 26 22:06:47 2010 (r2779) @@ -78,11 +78,11 @@ if (lowbound == OPEN && highbound == OPEN) { return (value > low && value < high); } else if (lowbound == OPEN && highbound == CLOSED) { - return (value > low && value <= high); + return (value > low && (value < high || fuzzyEquals(value, high))); } else if (lowbound == CLOSED && highbound == OPEN) { - return (value >= low && value < high); + return ((value > low || fuzzyEquals(value, low)) && value < high); } else { // if (lowbound == CLOSED && highbound == CLOSED) { - return (value >= low && value <= high); + return ((value > low || fuzzyEquals(value, low)) && (value < high || fuzzyEquals(value, high))); } } Modified: trunk/include/Rivet/Projections/JetShape.hh ============================================================================== --- trunk/include/Rivet/Projections/JetShape.hh Fri Nov 26 21:24:22 2010 (r2778) +++ trunk/include/Rivet/Projections/JetShape.hh Fri Nov 26 22:06:47 2010 (r2779) @@ -125,6 +125,7 @@ /// Central \f$ r \f$ value for bin @a rbin. double rBinMid(size_t rbin) const { assert(inRange(rbin, 0, numBins())); + //cout << _binedges << endl; return (_binedges[rbin] + _binedges[rbin+1])/2.0; } Modified: trunk/src/Analyses/CDF_2005_S6217184.cc ============================================================================== --- trunk/src/Analyses/CDF_2005_S6217184.cc Fri Nov 26 21:24:22 2010 (r2778) +++ trunk/src/Analyses/CDF_2005_S6217184.cc Fri Nov 26 22:06:47 2010 (r2779) @@ -45,7 +45,7 @@ stringstream ss; ss << "JetShape" << k; const string pname = ss.str(); _jsnames_pT[k] = pname; - const JetShape jsp(fj, 0.0, 0.7, 6, _ptedges[k], _ptedges[k+1], 0.1, 0.7, RAPIDITY); + const JetShape jsp(fj, 0.0, 0.7, 7, _ptedges[k], _ptedges[k+1], 0.1, 0.7, RAPIDITY); addProjection(jsp, pname); _profhistRho_pT[k] = bookProfile1D(i+1, 1, j+1); _profhistPsi_pT[k] = bookProfile1D(6+i+1, 1, j+1); @@ -79,7 +79,7 @@ for (size_t ijet = 0; ijet < jsipt.numJets(); ++ijet) { for (size_t rbin = 0; rbin < jsipt.numBins(); ++rbin) { const double r_rho = jsipt.rBinMid(rbin); - // cout << ipt << " " << rbin << " " << jsipt.diffJetShape(ijet, rbin) << endl; + // cout << ipt << " " << rbin << " (" << r_rho << ") " << jsipt.diffJetShape(ijet, rbin) << endl; /// Bin width Jacobian factor of 0.7/0.1 = 7 in the differential shapes plot _profhistRho_pT[ipt]->fill(r_rho/0.7, (0.7/0.1)*jsipt.diffJetShape(ijet, rbin), weight); const double r_Psi = jsipt.rBinMax(rbin); Modified: trunk/src/Analyses/CDF_2008_S7782535.cc ============================================================================== --- trunk/src/Analyses/CDF_2008_S7782535.cc Fri Nov 26 21:24:22 2010 (r2778) +++ trunk/src/Analyses/CDF_2008_S7782535.cc Fri Nov 26 22:06:47 2010 (r2779) @@ -38,7 +38,7 @@ stringstream ss; ss << "JetShape" << i; const string pname = ss.str(); _jsnames_pT[i] = pname; - const JetShape jsp(jetproj, 0.0, 0.7, 6, _ptedges[i], _ptedges[i+1], 0.0, 0.7, RAPIDITY); + const JetShape jsp(jetproj, 0.0, 0.7, 7, _ptedges[i], _ptedges[i+1], 0.0, 0.7, RAPIDITY); addProjection(jsp, pname); _h_Psi_pT[i] = bookProfile1D(i+1, 2, 1); }
More information about the Rivet-svn mailing list |