Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:10

0001 /*----------------------------------------------------------------------
0002 ----------------------------------------------------------------------*/
0003 #include "FWCore/Sources/interface/VectorInputSource.h"
0004 #include "FWCore/Sources/interface/VectorInputSourceDescription.h"
0005 #include "FWCore/Framework/interface/EventPrincipal.h"
0006 #include "FWCore/Utilities/interface/Exception.h"
0007 
0008 namespace edm {
0009 
0010   struct VectorInputSourceDescription;
0011 
0012   VectorInputSource::VectorInputSource(ParameterSet const& pset, VectorInputSourceDescription const& desc)
0013       : productRegistry_(desc.productRegistry_),
0014         processHistoryRegistry_(new ProcessHistoryRegistry),
0015         consecutiveRejectionsLimit_(pset.getUntrackedParameter<unsigned int>("consecutiveRejectionsLimit", 100)) {}
0016 
0017   VectorInputSource::~VectorInputSource() {}
0018 
0019   void VectorInputSource::dropUnwantedBranches(std::vector<std::string> const& wantedBranches) {
0020     this->dropUnwantedBranches_(wantedBranches);
0021   }
0022 
0023   void VectorInputSource::clearEventPrincipal(EventPrincipal& cache) { cache.clearEventPrincipal(); }
0024 
0025   void VectorInputSource::doBeginJob() { this->beginJob(); }
0026 
0027   void VectorInputSource::doEndJob() { this->endJob(); }
0028 
0029   void VectorInputSource::throwIfOverLimit(unsigned int consecutiveRejections) const {
0030     if (consecutiveRejections >= consecutiveRejectionsLimit_) {
0031       throw cms::Exception("LogicError")
0032           << "VectorInputSource::loopOverEvents() read " << consecutiveRejections
0033           << " consecutive pileup events that were rejected by the eventOperator. "
0034           << "This is likely a sign of misconfiguration (of e.g. the adjusted-to pileup probability profile). "
0035           << "If you know what you're doing, this exception can be turned off by setting consecutiveRejectionsLimit=0.";
0036     }
0037   }
0038 
0039 }  // namespace edm