[Rivet-svn] rivet: 4 new changesets

Rivet Mercurial rivet at projects.hepforge.org
Thu Feb 1 18:15:02 GMT 2018


details:   https://rivet.hepforge.org/hg/rivet/rev/9a22d3aeffdc
branches:  release-2-6-x
changeset: 6232:9a22d3aeffdc
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Feb 01 17:52:48 2018 +0000
description:
Fix a serious bug in the SmearedParticles and SmearedJets compare methods.

details:   https://rivet.hepforge.org/hg/rivet/rev/dd05688cc68e
branches:  release-2-6-x
changeset: 6233:dd05688cc68e
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Feb 01 18:07:03 2018 +0000
description:
Make the project() and compare() methods of projections public.

details:   https://rivet.hepforge.org/hg/rivet/rev/d198921e9131
branches:  release-2-6-x
changeset: 6234:d198921e9131
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Feb 01 18:08:25 2018 +0000
description:
Some extra aliases to reduce need for user lookup

details:   https://rivet.hepforge.org/hg/rivet/rev/408df94f9ed9
branches:  release-2-6-x
changeset: 6235:408df94f9ed9
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Feb 01 18:08:54 2018 +0000
description:
Add more comments, tidying, and trace messages for projection-pointer-handling debugging

diffs (truncated from 616 to 50 lines):

--- a/ChangeLog	Thu Feb 01 14:29:52 2018 +0000
+++ b/ChangeLog	Thu Feb 01 18:08:54 2018 +0000
@@ -1,5 +1,9 @@
 2018-02-01  Andy Buckley  <andy.buckley at cern.ch>
 
+	* Make the project() and compare() methods of projections public.
+
+	* Fix a serious bug in the SmearedParticles and SmearedJets compare methods.
+
 	* Add string representations and streamability to the Cut objects, for debugging.
 
 2018-01-08  Andy Buckley  <andy.buckley at cern.ch>
--- a/include/Rivet/Event.hh	Thu Feb 01 14:29:52 2018 +0000
+++ b/include/Rivet/Event.hh	Thu Feb 01 18:08:54 2018 +0000
@@ -113,20 +113,25 @@
     /// called and a reference to @a p is returned.
     template <typename PROJ>
     const PROJ& applyProjection(PROJ& p) const {
+      Log& log = Log::getLog("Rivet.Event");
+      log << Log::TRACE << "Applying projection " << &p << " (" << p.name() << ") -> comparing to projections " << _projections << endl;
+      // First search for this projection *or an equivalent* in the already-executed list
       const Projection* cpp(&p);
       std::set<const Projection*>::const_iterator old = _projections.find(cpp);
       if (old != _projections.end()) {
+        log << Log::TRACE << "Equivalent projection found -> returning already-run projection " << *old << endl;
         const Projection& pRef = **old;
         return pcast<PROJ>(pRef);
       }
-      // Add the projection via the Projection base class (only
-      // possible because Event is a friend of Projection)
+      // If this one hasn't been run yet on this event, run it and add to the list
+      log << Log::TRACE << "No equivalent projection in the already-run list -> projecting now" << endl;
       Projection* pp = const_cast<Projection*>(cpp);
       pp->project(*this);
       _projections.insert(pp);
       return p;
     }
 
+
     /// @brief Add a projection @a p to this Event by pointer.
     template <typename PROJ>
     const PROJ& applyProjection(PROJ* pp) const {
--- a/include/Rivet/Projection.hh	Thu Feb 01 14:29:52 2018 +0000
+++ b/include/Rivet/Projection.hh	Thu Feb 01 18:08:54 2018 +0000
@@ -35,10 +35,11 @@
     /// The Cmp specialization for Projection is a friend.
     friend class Cmp<Projection>;
 
-  public:
+


More information about the Rivet-svn mailing list