|
[Rivet-svn] rivet: 3 new changesetsRivet Mercurial rivet at projects.hepforge.orgWed Oct 4 12:30:02 BST 2017
details: https://rivet.hepforge.org/hg/rivet/rev/38d165d04662 branches: multiweight changeset: 6076:38d165d04662 user: David Grellscheid <david.grellscheid at durham.ac.uk> date: Tue Oct 03 15:05:14 2017 +0100 description: Weird workaround needed for ATLAS_2014_I1306615. Something wrong in DressedLepton? details: https://rivet.hepforge.org/hg/rivet/rev/a0cc95765aba branches: multiweight changeset: 6077:a0cc95765aba user: David Grellscheid <david.grellscheid at durham.ac.uk> date: Wed Oct 04 12:14:34 2017 +0100 description: Wrap init/analyze/finalize to catch escaping YODA exceptions. Affected analyses are disabled for the rest of the run. details: https://rivet.hepforge.org/hg/rivet/rev/c1f1c27cdec6 branches: multiweight changeset: 6078:c1f1c27cdec6 user: David Grellscheid <david.grellscheid at durham.ac.uk> date: Wed Oct 04 12:15:19 2017 +0100 description: Write log levels above WARNING to cerr. diffs (truncated from 149 to 50 lines): --- a/analyses/pluginATLAS/ATLAS_2014_I1306615.cc Mon Oct 02 15:02:54 2017 +0100 +++ b/analyses/pluginATLAS/ATLAS_2014_I1306615.cc Wed Oct 04 12:15:19 2017 +0100 @@ -368,6 +368,8 @@ // Trace event record to see if particle came from a hadron (or a tau from a hadron decay) // Based on fromDecay() function bool fromHadronDecay(const Particle& p ) { + const GenParticle * gp = p.genParticle(); + if (!gp) return false; /// TODO: something weird to make this necessary const GenVertex* prodVtx = p.genParticle()->production_vertex(); if (prodVtx == NULL) return false; foreach (const GenParticle* ancestor, particles(prodVtx, HepMC::ancestors)) { --- a/src/Core/AnalysisHandler.cc Mon Oct 02 15:02:54 2017 +0100 +++ b/src/Core/AnalysisHandler.cc Wed Oct 04 12:15:19 2017 +0100 @@ -111,7 +111,10 @@ // Initialize the remaining analyses _stage = Stage::INIT; - for (AnaHandle a : _analyses) { + // DELIBERATELY no increment in for-loop. We may be erasing entries + for (auto it = _analyses.cbegin(); it != _analyses.cend(); /**/) { + + const AnaHandle & a = *it; MSG_DEBUG("Initialising analysis: " << a->name()); try { // Allow projection registration in the init phase onwards @@ -119,12 +122,21 @@ a->init(); //MSG_DEBUG("Checking consistency of analysis: " << a->name()); //a->checkConsistency(); + MSG_DEBUG("Done initialising analysis: " << a->name()); + ++it; } catch (const Error& err) { - cerr << "Error in " << a->name() << "::init method: " << err.what() << endl; - exit(1); + MSG_ERROR("Error in " << a->name() << "::init method: " << err.what()); + MSG_ERROR("REMOVING ANALYSIS " << a->name()); + it = _analyses.erase(it); + } catch (const YODA::Exception & err) { + MSG_ERROR("Unhandled YODA exception in " << a->name() + << "::init method:\n" << err.what()); + MSG_ERROR("REMOVING ANALYSIS " << a->name()); + it = _analyses.erase(it); } - MSG_DEBUG("Done initialising analysis: " << a->name()); + } + _stage = Stage::OTHER; _initialised = true; MSG_DEBUG("Analysis handler initialised");
More information about the Rivet-svn mailing list |