Skip to content

Commit

Permalink
Merge pull request cms-sw#37545 from Dr15Jones/exceptionInHepMCValida…
Browse files Browse the repository at this point in the history
…tionHelper

Added exception to HepMCValidationHelper
  • Loading branch information
cmsbuild authored Apr 14, 2022
2 parents bb8fc90 + 401e834 commit cb6f1b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Validation/EventGenerator/src/HepMCValidationHelper.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "Validation/EventGenerator/interface/HepMCValidationHelper.h"
#include "DataFormats/Math/interface/deltaR.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/Exception.h"
#include <iostream>
#include <limits>
#include "TLorentzVector.h"
Expand Down Expand Up @@ -202,8 +203,9 @@ namespace HepMCValidationHelper {
std::vector<const HepMC::GenParticle*> taudaughters;
findDescendents(taus[i], taudaughters);
if (taudaughters.empty()) {
edm::LogError("HepMCValidationHelper") << "Tau with no daughters. This is a bug. Fix it";
abort();
throw cms::Exception("NoTauDaugters")
<< " HepMCValidationHelper found no daughters for Tau within index " << i << " and info \n"
<< *taus[i] << "\n This should not be able to happen and needs to be fixed.";
}
const HepMC::FourVector& taumom = taus[i]->momentum();
//remove the daughters from the list of particles to compute isolation
Expand Down

0 comments on commit cb6f1b1

Please sign in to comment.