CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

AbortOnEventIDAnalyzer Class Reference

#include <FWCore/Modules/src/AbortOnEventIDAnalyzer.cc>

Inheritance diagram for AbortOnEventIDAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

List of all members.

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::EventIDids_
bool throwException_

Detailed Description

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.


Constructor & Destructor Documentation

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.)

}

Member Function Documentation

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]

Reimplemented from edm::EDAnalyzer.

Definition at line 113 of file AbortOnEventIDAnalyzer.cc.

                                 {
}
void AbortOnEventIDAnalyzer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 118 of file AbortOnEventIDAnalyzer.cc.

                               {
}
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);
}

Member Data Documentation

Definition at line 51 of file AbortOnEventIDAnalyzer.cc.

Referenced by analyze().

Definition at line 52 of file AbortOnEventIDAnalyzer.cc.

Referenced by analyze().