#include <FWCore/Modules/src/AbortOnEventIDAnalyzer.cc>
Public Member Functions | |
AbortOnEventIDAnalyzer (edm::ParameterSet const &) | |
~AbortOnEventIDAnalyzer () | |
Static Public Member Functions | |
static void | fillDescriptions (edm::ConfigurationDescriptions &descriptions) |
Private Member Functions | |
virtual void | analyze (edm::Event const &, edm::EventSetup const &) |
virtual void | beginJob () |
virtual void | endJob () |
Private Attributes | |
std::vector< edm::EventID > | ids_ |
bool | throwException_ |
Description: Does a system abort when it seens the specified EventID. Useful for testing error handling.
Implementation: <Notes on="" implementation>="">
Definition at line 38 of file AbortOnEventIDAnalyzer.cc.
AbortOnEventIDAnalyzer::AbortOnEventIDAnalyzer | ( | edm::ParameterSet const & | iConfig | ) | [explicit] |
Definition at line 66 of file AbortOnEventIDAnalyzer.cc.
: ids_(iConfig.getUntrackedParameter<std::vector<edm::EventID> >("eventsToAbort")), throwException_(iConfig.getUntrackedParameter<bool>("throwExceptionInsteadOfAbort")) { //now do what ever initialization is needed }
AbortOnEventIDAnalyzer::~AbortOnEventIDAnalyzer | ( | ) |
Definition at line 75 of file AbortOnEventIDAnalyzer.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
void AbortOnEventIDAnalyzer::analyze | ( | edm::Event const & | iEvent, |
edm::EventSetup const & | |||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 100 of file AbortOnEventIDAnalyzer.cc.
References Exception, edm::EventBase::id(), ids_, and throwException_.
{ std::vector<edm::EventID>::iterator itFind= std::find_if(ids_.begin(), ids_.end(), CompareWithoutLumi(iEvent.id())); if(itFind != ids_.end()) { if (throwException_) { throw cms::Exception("AbortEvent") << "Found event " << iEvent.id() << "\n"; } else { abort(); } } }
void AbortOnEventIDAnalyzer::beginJob | ( | void | ) | [private, virtual] |
void AbortOnEventIDAnalyzer::endJob | ( | void | ) | [private, virtual] |
void AbortOnEventIDAnalyzer::fillDescriptions | ( | edm::ConfigurationDescriptions & | descriptions | ) | [static] |
Reimplemented from edm::EDAnalyzer.
Definition at line 123 of file AbortOnEventIDAnalyzer.cc.
References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::addUntracked().
{ edm::ParameterSetDescription desc; desc.addUntracked<std::vector<edm::EventID> >("eventsToAbort"); desc.addUntracked<bool>("throwExceptionInsteadOfAbort", false); descriptions.add("abortOnEventID", desc); }
std::vector<edm::EventID> AbortOnEventIDAnalyzer::ids_ [private] |
Definition at line 51 of file AbortOnEventIDAnalyzer.cc.
Referenced by analyze().
bool AbortOnEventIDAnalyzer::throwException_ [private] |
Definition at line 52 of file AbortOnEventIDAnalyzer.cc.
Referenced by analyze().