CMS 3D CMS Logo

List of all members | 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

Public Member Functions

 AbortOnEventIDAnalyzer (edm::ParameterSet const &)
 
 ~AbortOnEventIDAnalyzer () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

std::vector< edm::EventIDids_
 
bool throwException_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

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::AbortOnEventIDAnalyzer ( edm::ParameterSet const &  iConfig)
explicit

Definition at line 65 of file AbortOnEventIDAnalyzer.cc.

66  : ids_(iConfig.getUntrackedParameter<std::vector<edm::EventID> >("eventsToAbort")),
67  throwException_(iConfig.getUntrackedParameter<bool>("throwExceptionInsteadOfAbort")) {
68  //now do what ever initialization is needed
69 }

◆ ~AbortOnEventIDAnalyzer()

AbortOnEventIDAnalyzer::~AbortOnEventIDAnalyzer ( )
override

Definition at line 71 of file AbortOnEventIDAnalyzer.cc.

71  {
72  // do anything here that needs to be done at desctruction time
73  // (e.g. close files, deallocate resources etc.)
74 }

Member Function Documentation

◆ analyze()

void AbortOnEventIDAnalyzer::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 91 of file AbortOnEventIDAnalyzer.cc.

91  {
92  std::vector<edm::EventID>::iterator itFind = std::find_if(ids_.begin(), ids_.end(), CompareWithoutLumi(iEvent.id()));
93  if (itFind != ids_.end()) {
94  if (throwException_) {
95  throw cms::Exception("AbortEvent") << "Found event " << iEvent.id() << "\n";
96  } else {
97  abort();
98  }
99  }
100 }

References Exception, ids_, iEvent, and throwException_.

◆ beginJob()

void AbortOnEventIDAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 103 of file AbortOnEventIDAnalyzer.cc.

103 {}

◆ endJob()

void AbortOnEventIDAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 106 of file AbortOnEventIDAnalyzer.cc.

106 {}

◆ fillDescriptions()

void AbortOnEventIDAnalyzer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 109 of file AbortOnEventIDAnalyzer.cc.

109  {
111  desc.addUntracked<std::vector<edm::EventID> >("eventsToAbort");
112  desc.addUntracked<bool>("throwExceptionInsteadOfAbort", false);
113  descriptions.add("abortOnEventID", desc);
114 }

References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.

Member Data Documentation

◆ ids_

std::vector<edm::EventID> AbortOnEventIDAnalyzer::ids_
private

Definition at line 50 of file AbortOnEventIDAnalyzer.cc.

Referenced by analyze().

◆ throwException_

bool AbortOnEventIDAnalyzer::throwException_
private

Definition at line 51 of file AbortOnEventIDAnalyzer.cc.

Referenced by analyze().

edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
AbortOnEventIDAnalyzer::throwException_
bool throwException_
Definition: AbortOnEventIDAnalyzer.cc:51
iEvent
int iEvent
Definition: GenABIO.cc:224
AbortOnEventIDAnalyzer::ids_
std::vector< edm::EventID > ids_
Definition: AbortOnEventIDAnalyzer.cc:50
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
Exception
Definition: hltDiff.cc:246