Skip to content

Commit

Permalink
Add protection for empty efficiency TrackingParticleRefVector
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Feb 18, 2016
1 parent 5ea88e1 commit 5eb3f94
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Validation/RecoTrack/plugins/MultiTrackValidator.cc
Expand Up @@ -242,6 +242,13 @@ void MultiTrackValidator::bookHistograms(DQMStore::IBooker& ibook, edm::Run cons

namespace {
void ensureEffIsSubsetOfFake(const TrackingParticleRefVector& eff, const TrackingParticleRefVector& fake) {
// If efficiency RefVector is empty, don't check the product ids
// as it will be 0:0 for empty. This covers also the case where
// both are empty. The case of fake being empty and eff not is an
// error.
if(eff.empty())
return;

// First ensure product ids
if(eff.id() != fake.id()) {
throw cms::Exception("Configuration") << "Efficiency and fake TrackingParticle (refs) point to different collections (eff " << eff.id() << " fake " << fake.id() << "). This is not supported. Efficiency TP set must be the same or a subset of the fake TP set.";
Expand Down

0 comments on commit 5eb3f94

Please sign in to comment.