[Rivet-svn] rivet: fix an issue with accessing constituents via pointers, wh...

Rivet Mercurial rivet at projects.hepforge.org
Thu Mar 15 10:00:02 GMT 2018


details:   https://rivet.hepforge.org/hg/rivet/rev/6e37afbda4c1
branches:  release-2-6-x
changeset: 6254:6e37afbda4c1
user:      Jon Butterworth <j.butterworth at cern.ch>
date:      Thu Mar 15 09:51:57 2018 +0000
description:
fix an issue with accessing constituents via pointers, which was causing a crash after a few 1000 events

diffs (30 lines):

--- a/analyses/pluginCMS/CMS_2013_I1224539_ZJET.cc	Tue Mar 13 16:48:29 2018 +0000
+++ b/analyses/pluginCMS/CMS_2013_I1224539_ZJET.cc	Thu Mar 15 09:51:57 2018 +0000
@@ -93,14 +93,24 @@
       const ZFinder& zfinder = apply<ZFinder>(event, "ZFinder");
       if (zfinder.bosons().size() != 1) vetoEvent;
       const Particle& z = zfinder.bosons()[0];
-      const Particle& l1 = zfinder.constituents()[0];
-      const Particle& l2 = zfinder.constituents()[1];
+      if (zfinder.constituents().size() <2) {
+	MSG_WARNING("Found a Z with less than 2 constituents.");
+	vetoEvent;
+      }
+
+      const Particle l1 = zfinder.constituents()[0];
+      const Particle l2 = zfinder.constituents()[1];
+
 
       // Require a high-pT Z (and constituents)
-      if (l1.pT() < 30*GeV || l2.pT() < 30*GeV || z.pT() < 120*GeV) vetoEvent;
+      if (l1.pT() < 30*GeV ) vetoEvent;
+      if (l2.pT() < 30*GeV ) vetoEvent;
+      if (z.pT() < 120*GeV) vetoEvent;
 
       // AK7 jets
       const PseudoJets& psjetsAK7_zj = apply<FastJets>(event, "JetsAK7_zj").pseudoJetsByPt(50.0*GeV);
+
+
       if (!psjetsAK7_zj.empty()) {
         // Get the leading jet and make sure it's back-to-back with the Z
         const fastjet::PseudoJet& j0 = psjetsAK7_zj[0];


More information about the Rivet-svn mailing list