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::global::EDAnalyzer<> edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 AbortOnEventIDAnalyzer (edm::ParameterSet const &)
 
 ~AbortOnEventIDAnalyzer () override
 
- Public Member Functions inherited from edm::global::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

std::vector< edm::EventIDids_
 
bool throwException_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

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 }
std::vector< edm::EventID > ids_

◆ ~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::StreamID  ,
edm::Event const &  iEvent,
edm::EventSetup const &   
) const
overrideprivatevirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 91 of file AbortOnEventIDAnalyzer.cc.

References Exception, ids_, iEvent, and throwException_.

91  {
92  auto 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 }
std::vector< edm::EventID > ids_
int iEvent
Definition: GenABIO.cc:224

◆ beginJob()

void AbortOnEventIDAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 103 of file AbortOnEventIDAnalyzer.cc.

103 {}

◆ endJob()

void AbortOnEventIDAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDAnalyzerBase.

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.

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

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

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