CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
edmtest::ExceptionThrowingProducer Class Reference
Inheritance diagram for edmtest::ExceptionThrowingProducer:
edm::global::EDProducer< edm::StreamCache< Cache >, edm::RunCache< Cache >, edm::LuminosityBlockCache< Cache > > edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

std::unique_ptr< Cache > beginStream (edm::StreamID) const override
 
 ExceptionThrowingProducer (edm::ParameterSet const &)
 
std::shared_ptr< Cache > globalBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
std::shared_ptr< Cache > globalBeginRun (edm::Run const &, edm::EventSetup const &) const override
 
void globalEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void globalEndRun (edm::Run const &, edm::EventSetup const &) const override
 
void produce (edm::StreamID, edm::Event &, edm::EventSetup const &) const override
 
void streamBeginLuminosityBlock (edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void streamBeginRun (edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
 
void streamEndLuminosityBlock (edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void streamEndRun (edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
 
 ~ExceptionThrowingProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer< edm::StreamCache< Cache >, edm::RunCache< Cache >, edm::LuminosityBlockCache< Cache > >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=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::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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 &)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EventID eventIDThrowOnEvent_
 
edm::EventID eventIDThrowOnGlobalBeginLumi_
 
edm::EventID eventIDThrowOnGlobalBeginRun_
 
edm::EventID eventIDThrowOnGlobalEndLumi_
 
edm::EventID eventIDThrowOnGlobalEndRun_
 
edm::EventID eventIDThrowOnStreamBeginLumi_
 
edm::EventID eventIDThrowOnStreamBeginRun_
 
edm::EventID eventIDThrowOnStreamEndLumi_
 
edm::EventID eventIDThrowOnStreamEndRun_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- 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

Definition at line 20 of file ExceptionThrowingProducer.cc.

Constructor & Destructor Documentation

◆ ExceptionThrowingProducer()

edmtest::ExceptionThrowingProducer::ExceptionThrowingProducer ( edm::ParameterSet const &  pset)
explicit

Definition at line 55 of file ExceptionThrowingProducer.cc.

56  : eventIDThrowOnEvent_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnEvent")),
57  eventIDThrowOnGlobalBeginRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalBeginRun")),
58  eventIDThrowOnGlobalBeginLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalBeginLumi")),
59  eventIDThrowOnGlobalEndRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalEndRun")),
60  eventIDThrowOnGlobalEndLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalEndLumi")),
61  eventIDThrowOnStreamBeginRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamBeginRun")),
62  eventIDThrowOnStreamBeginLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamBeginLumi")),
63  eventIDThrowOnStreamEndRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamEndRun")),
64  eventIDThrowOnStreamEndLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamEndLumi")) {}

◆ ~ExceptionThrowingProducer()

edmtest::ExceptionThrowingProducer::~ExceptionThrowingProducer ( )
override

Definition at line 66 of file ExceptionThrowingProducer.cc.

66 {}

Member Function Documentation

◆ beginStream()

std::unique_ptr< Cache > edmtest::ExceptionThrowingProducer::beginStream ( edm::StreamID  ) const
override

Definition at line 114 of file ExceptionThrowingProducer.cc.

114  {
115  return std::make_unique<Cache>();
116  }

◆ fillDescriptions()

void edmtest::ExceptionThrowingProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 163 of file ExceptionThrowingProducer.cc.

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

163  {
165  edm::EventID invalidEventID;
166  desc.addUntracked<edm::EventID>("eventIDThrowOnEvent", invalidEventID);
167  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalBeginRun", invalidEventID);
168  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalBeginLumi", invalidEventID);
169  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalEndRun", invalidEventID);
170  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalEndLumi", invalidEventID);
171  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamBeginRun", invalidEventID);
172  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamBeginLumi", invalidEventID);
173  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamEndRun", invalidEventID);
174  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamEndLumi", invalidEventID);
175  descriptions.addDefault(desc);
176  }
void addDefault(ParameterSetDescription const &psetDescription)

◆ globalBeginLuminosityBlock()

std::shared_ptr< Cache > edmtest::ExceptionThrowingProducer::globalBeginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &   
) const
override

Definition at line 93 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnGlobalBeginLumi_, Exception, and edm::invalidEventNumber.

94  {
95  if (edm::EventID(lumi.id().run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
97  throw cms::Exception("IntentionalTestException")
98  << "ExceptionThrowingProducer::globalBeginLuminosityBlock, module configured to throw on: "
100  }
101  return std::make_shared<Cache>();
102  }
EventNumber_t const invalidEventNumber

◆ globalBeginRun()

std::shared_ptr< Cache > edmtest::ExceptionThrowingProducer::globalBeginRun ( edm::Run const &  run,
edm::EventSetup const &   
) const
override

Definition at line 75 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnGlobalBeginRun_, Exception, edm::invalidEventNumber, edm::invalidLuminosityBlockNumber, and writedatasetfile::run.

75  {
78  throw cms::Exception("IntentionalTestException")
79  << "ExceptionThrowingProducer::globalBeginRun, module configured to throw on: "
81  }
82  return std::make_shared<Cache>();
83  }
EventNumber_t const invalidEventNumber
LuminosityBlockNumber_t const invalidLuminosityBlockNumber

◆ globalEndLuminosityBlock()

void edmtest::ExceptionThrowingProducer::globalEndLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &   
) const
override

Definition at line 104 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnGlobalEndLumi_, Exception, and edm::invalidEventNumber.

105  {
106  if (edm::EventID(lumi.id().run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
108  throw cms::Exception("IntentionalTestException")
109  << "ExceptionThrowingProducer::globalEndLuminosityBlock, module configured to throw on: "
111  }
112  }
EventNumber_t const invalidEventNumber

◆ globalEndRun()

void edmtest::ExceptionThrowingProducer::globalEndRun ( edm::Run const &  run,
edm::EventSetup const &   
) const
override

Definition at line 85 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnGlobalEndRun_, Exception, edm::invalidEventNumber, edm::invalidLuminosityBlockNumber, and writedatasetfile::run.

85  {
88  throw cms::Exception("IntentionalTestException")
89  << "ExceptionThrowingProducer::globalEndRun, module configured to throw on: " << eventIDThrowOnGlobalEndRun_;
90  }
91  }
EventNumber_t const invalidEventNumber
LuminosityBlockNumber_t const invalidLuminosityBlockNumber

◆ produce()

void edmtest::ExceptionThrowingProducer::produce ( edm::StreamID  ,
edm::Event event,
edm::EventSetup const &   
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 68 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnEvent_, and Exception.

68  {
69  if (event.id() == eventIDThrowOnEvent_) {
70  throw cms::Exception("IntentionalTestException")
71  << "ExceptionThrowingProducer::produce, module configured to throw on: " << eventIDThrowOnEvent_;
72  }
73  }
Definition: event.py:1

◆ streamBeginLuminosityBlock()

void edmtest::ExceptionThrowingProducer::streamBeginLuminosityBlock ( edm::StreamID  iStream,
edm::LuminosityBlock const &  lumi,
edm::EventSetup const &   
) const
override

Definition at line 130 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnStreamBeginLumi_, Exception, edm::invalidEventNumber, and edm::StreamID::value().

132  {
133  if (iStream.value() == 0 && edm::EventID(lumi.run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
135  throw cms::Exception("IntentionalTestException")
136  << "ExceptionThrowingProducer::streamBeginLuminosityBlock, module configured to throw on: "
138  }
139  }
EventNumber_t const invalidEventNumber
unsigned int value() const
Definition: StreamID.h:43

◆ streamBeginRun()

void edmtest::ExceptionThrowingProducer::streamBeginRun ( edm::StreamID  iStream,
edm::Run const &  run,
edm::EventSetup const &   
) const
override

Definition at line 118 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnStreamBeginRun_, Exception, edm::invalidEventNumber, edm::invalidLuminosityBlockNumber, writedatasetfile::run, and edm::StreamID::value().

120  {
121  if (iStream.value() == 0 &&
124  throw cms::Exception("IntentionalTestException")
125  << "ExceptionThrowingProducer::streamBeginRun, module configured to throw on: "
127  }
128  }
EventNumber_t const invalidEventNumber
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
unsigned int value() const
Definition: StreamID.h:43

◆ streamEndLuminosityBlock()

void edmtest::ExceptionThrowingProducer::streamEndLuminosityBlock ( edm::StreamID  iStream,
edm::LuminosityBlock const &  lumi,
edm::EventSetup const &   
) const
override

Definition at line 141 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnStreamEndLumi_, Exception, edm::invalidEventNumber, and edm::StreamID::value().

143  {
144  if (iStream.value() == 0 && edm::EventID(lumi.run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
146  throw cms::Exception("IntentionalTestException")
147  << "ExceptionThrowingProducer::streamEndLuminosityBlock, module configured to throw on: "
149  }
150  }
EventNumber_t const invalidEventNumber
unsigned int value() const
Definition: StreamID.h:43

◆ streamEndRun()

void edmtest::ExceptionThrowingProducer::streamEndRun ( edm::StreamID  iStream,
edm::Run const &  run,
edm::EventSetup const &   
) const
override

Definition at line 152 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnStreamEndRun_, Exception, edm::invalidEventNumber, edm::invalidLuminosityBlockNumber, writedatasetfile::run, and edm::StreamID::value().

154  {
155  if (iStream.value() == 0 &&
158  throw cms::Exception("IntentionalTestException")
159  << "ExceptionThrowingProducer::streamEndRun, module configured to throw on: " << eventIDThrowOnStreamEndRun_;
160  }
161  }
EventNumber_t const invalidEventNumber
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
unsigned int value() const
Definition: StreamID.h:43

Member Data Documentation

◆ eventIDThrowOnEvent_

edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnEvent_
private

Definition at line 44 of file ExceptionThrowingProducer.cc.

Referenced by produce().

◆ eventIDThrowOnGlobalBeginLumi_

edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnGlobalBeginLumi_
private

Definition at line 46 of file ExceptionThrowingProducer.cc.

Referenced by globalBeginLuminosityBlock().

◆ eventIDThrowOnGlobalBeginRun_

edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnGlobalBeginRun_
private

Definition at line 45 of file ExceptionThrowingProducer.cc.

Referenced by globalBeginRun().

◆ eventIDThrowOnGlobalEndLumi_

edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnGlobalEndLumi_
private

Definition at line 48 of file ExceptionThrowingProducer.cc.

Referenced by globalEndLuminosityBlock().

◆ eventIDThrowOnGlobalEndRun_

edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnGlobalEndRun_
private

Definition at line 47 of file ExceptionThrowingProducer.cc.

Referenced by globalEndRun().

◆ eventIDThrowOnStreamBeginLumi_

edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnStreamBeginLumi_
private

Definition at line 50 of file ExceptionThrowingProducer.cc.

Referenced by streamBeginLuminosityBlock().

◆ eventIDThrowOnStreamBeginRun_

edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnStreamBeginRun_
private

Definition at line 49 of file ExceptionThrowingProducer.cc.

Referenced by streamBeginRun().

◆ eventIDThrowOnStreamEndLumi_

edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnStreamEndLumi_
private

Definition at line 52 of file ExceptionThrowingProducer.cc.

Referenced by streamEndLuminosityBlock().

◆ eventIDThrowOnStreamEndRun_

edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnStreamEndRun_
private

Definition at line 51 of file ExceptionThrowingProducer.cc.

Referenced by streamEndRun().