[Rivet-svn] rivet: protect ancestors method against null genParticle

Rivet Mercurial rivet at projects.hepforge.org
Sat Nov 25 10:30:01 GMT 2017


details:   https://rivet.hepforge.org/hg/rivet/rev/8d3ee1377c2e
branches:  
changeset: 6156:8d3ee1377c2e
user:      Jon Butterworth <j.butterworth at cern.ch>
date:      Sat Nov 25 10:18:46 2017 +0000
description:
protect ancestors method against null genParticle

diffs (14 lines):

--- a/src/Core/Particle.cc	Fri Nov 24 14:48:42 2017 +0000
+++ b/src/Core/Particle.cc	Sat Nov 25 10:18:46 2017 +0000
@@ -63,6 +63,11 @@
 
   vector<Particle> Particle::ancestors(const Cut& c, bool physical_only) const {
     vector<Particle> rtn;
+
+    // this case needed protecting against (at least for the latest Herwig... not sure why
+    // it didn't show up earlier
+    if (genParticle() == NULL) return rtn;
+
     /// @todo Remove this const mess crap when HepMC doesn't suck
     GenVertexPtr gv = const_cast<GenVertexPtr>( genParticle()->production_vertex() );
     if (gv == NULL) return rtn;


More information about the Rivet-svn mailing list