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
 
void endJob () 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
 
- 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept 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_
 
unsigned int expectedGlobalBeginLumi_
 
unsigned int expectedGlobalBeginRun_
 
unsigned int expectedOffsetNoGlobalEndLumi_
 
unsigned int expectedOffsetNoGlobalEndRun_
 
unsigned int expectedOffsetNoStreamEndLumi_
 
unsigned int expectedOffsetNoStreamEndRun_
 
unsigned int expectedOffsetNoWriteLumi_
 
unsigned int expectedOffsetNoWriteRun_
 
unsigned int expectedStreamBeginLumi_
 
unsigned int expectedStreamBeginRun_
 
std::atomic< bool > globalBeginLumiExceptionOccurred_ = false
 
std::atomic< bool > globalBeginRunExceptionOccurred_ = false
 
std::atomic< unsigned int > nGlobalBeginLumi_ {0}
 
std::atomic< unsigned int > nGlobalBeginRun_ {0}
 
std::atomic< unsigned int > nGlobalEndLumi_ {0}
 
std::atomic< unsigned int > nGlobalEndRun_ {0}
 
std::vector< unsigned int > nStreamBeginLumi_
 
std::vector< unsigned int > nStreamBeginRun_
 
std::vector< unsigned int > nStreamEndLumi_
 
std::vector< unsigned int > nStreamEndRun_
 
std::atomic< bool > streamBeginLumiExceptionOccurred_ = false
 
std::atomic< bool > streamBeginRunExceptionOccurred_ = false
 
std::atomic< bool > streamEndLumiExceptionOccurred_ = false
 
std::atomic< bool > streamEndRunExceptionOccurred_ = false
 
unsigned int streamWithBeginLumiException_ = kUnset
 
unsigned int streamWithBeginRunException_ = kUnset
 
bool verbose_
 

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 43 of file ExceptionThrowingProducer.cc.

Constructor & Destructor Documentation

◆ ExceptionThrowingProducer()

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

Definition at line 112 of file ExceptionThrowingProducer.cc.

113  : verbose_(pset.getUntrackedParameter<bool>("verbose")),
114  eventIDThrowOnEvent_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnEvent")),
115  eventIDThrowOnGlobalBeginRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalBeginRun")),
116  eventIDThrowOnGlobalBeginLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalBeginLumi")),
117  eventIDThrowOnGlobalEndRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalEndRun")),
118  eventIDThrowOnGlobalEndLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalEndLumi")),
119  eventIDThrowOnStreamBeginRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamBeginRun")),
120  eventIDThrowOnStreamBeginLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamBeginLumi")),
121  eventIDThrowOnStreamEndRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamEndRun")),
122  eventIDThrowOnStreamEndLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamEndLumi")),
127  expectedStreamBeginLumi_(pset.getUntrackedParameter<unsigned int>("expectedStreamBeginLumi")),
128  expectedOffsetNoStreamEndLumi_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoStreamEndLumi")),
129  expectedGlobalBeginLumi_(pset.getUntrackedParameter<unsigned int>("expectedGlobalBeginLumi")),
130  expectedOffsetNoGlobalEndLumi_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoGlobalEndLumi")),
131  expectedOffsetNoWriteLumi_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoWriteLumi")),
132  expectedStreamBeginRun_(pset.getUntrackedParameter<unsigned int>("expectedStreamBeginRun")),
133  expectedOffsetNoStreamEndRun_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoStreamEndRun")),
134  expectedGlobalBeginRun_(pset.getUntrackedParameter<unsigned int>("expectedGlobalBeginRun")),
135  expectedOffsetNoGlobalEndRun_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoGlobalEndRun")),
136  expectedOffsetNoWriteRun_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoWriteRun")) {}
std::vector< unsigned int > nStreamBeginRun_
constexpr unsigned int kTestStreams
std::vector< unsigned int > nStreamBeginLumi_
std::vector< unsigned int > nStreamEndRun_
std::vector< unsigned int > nStreamEndLumi_

Member Function Documentation

◆ beginStream()

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

Definition at line 190 of file ExceptionThrowingProducer.cc.

190  {
191  return std::make_unique<Cache>();
192  }

◆ endJob()

void edmtest::ExceptionThrowingProducer::endJob ( void  )
overridevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 268 of file ExceptionThrowingProducer.cc.

References expectedGlobalBeginLumi_, expectedGlobalBeginRun_, expectedOffsetNoGlobalEndLumi_, expectedOffsetNoGlobalEndRun_, expectedOffsetNoStreamEndLumi_, expectedOffsetNoStreamEndRun_, expectedOffsetNoWriteLumi_, expectedOffsetNoWriteRun_, expectedStreamBeginLumi_, expectedStreamBeginRun_, globalBeginLumiExceptionOccurred_, globalBeginRunExceptionOccurred_, mps_fire::i, kNumberOfTestModules, kUnset, nGlobalBeginLumi_, nGlobalBeginRun_, nGlobalEndLumi_, nGlobalEndRun_, edmtest::TestServiceOne::nPostGlobalBeginLumi(), edmtest::TestServiceTwo::nPostGlobalBeginLumi(), edmtest::TestServiceOne::nPostGlobalBeginRun(), edmtest::TestServiceTwo::nPostGlobalBeginRun(), edmtest::TestServiceOne::nPostGlobalEndLumi(), edmtest::TestServiceTwo::nPostGlobalEndLumi(), edmtest::TestServiceOne::nPostGlobalEndRun(), edmtest::TestServiceTwo::nPostGlobalEndRun(), edmtest::TestServiceOne::nPostGlobalWriteLumi(), edmtest::TestServiceTwo::nPostGlobalWriteLumi(), edmtest::TestServiceOne::nPostGlobalWriteRun(), edmtest::TestServiceTwo::nPostGlobalWriteRun(), edmtest::TestServiceOne::nPostModuleGlobalBeginLumi(), edmtest::TestServiceTwo::nPostModuleGlobalBeginLumi(), edmtest::TestServiceOne::nPostModuleGlobalBeginRun(), edmtest::TestServiceTwo::nPostModuleGlobalBeginRun(), edmtest::TestServiceOne::nPostModuleGlobalEndLumi(), edmtest::TestServiceTwo::nPostModuleGlobalEndLumi(), edmtest::TestServiceOne::nPostModuleGlobalEndRun(), edmtest::TestServiceTwo::nPostModuleGlobalEndRun(), edmtest::TestServiceOne::nPostModuleStreamBeginLumi(), edmtest::TestServiceTwo::nPostModuleStreamBeginLumi(), edmtest::TestServiceOne::nPostModuleStreamBeginRun(), edmtest::TestServiceTwo::nPostModuleStreamBeginRun(), edmtest::TestServiceOne::nPostModuleStreamEndLumi(), edmtest::TestServiceTwo::nPostModuleStreamEndLumi(), edmtest::TestServiceOne::nPostModuleStreamEndRun(), edmtest::TestServiceTwo::nPostModuleStreamEndRun(), edmtest::TestServiceOne::nPostStreamBeginLumi(), edmtest::TestServiceTwo::nPostStreamBeginLumi(), edmtest::TestServiceOne::nPostStreamBeginRun(), edmtest::TestServiceTwo::nPostStreamBeginRun(), edmtest::TestServiceOne::nPostStreamEndLumi(), edmtest::TestServiceTwo::nPostStreamEndLumi(), edmtest::TestServiceOne::nPostStreamEndRun(), edmtest::TestServiceTwo::nPostStreamEndRun(), edmtest::TestServiceOne::nPreGlobalBeginLumi(), edmtest::TestServiceTwo::nPreGlobalBeginLumi(), edmtest::TestServiceOne::nPreGlobalBeginRun(), edmtest::TestServiceTwo::nPreGlobalBeginRun(), edmtest::TestServiceOne::nPreGlobalEndLumi(), edmtest::TestServiceTwo::nPreGlobalEndLumi(), edmtest::TestServiceOne::nPreGlobalEndRun(), edmtest::TestServiceTwo::nPreGlobalEndRun(), edmtest::TestServiceOne::nPreGlobalWriteLumi(), edmtest::TestServiceTwo::nPreGlobalWriteLumi(), edmtest::TestServiceOne::nPreGlobalWriteRun(), edmtest::TestServiceTwo::nPreGlobalWriteRun(), edmtest::TestServiceOne::nPreModuleGlobalBeginLumi(), edmtest::TestServiceTwo::nPreModuleGlobalBeginLumi(), edmtest::TestServiceOne::nPreModuleGlobalBeginRun(), edmtest::TestServiceTwo::nPreModuleGlobalBeginRun(), edmtest::TestServiceOne::nPreModuleGlobalEndLumi(), edmtest::TestServiceTwo::nPreModuleGlobalEndLumi(), edmtest::TestServiceOne::nPreModuleGlobalEndRun(), edmtest::TestServiceTwo::nPreModuleGlobalEndRun(), edmtest::TestServiceOne::nPreModuleStreamBeginLumi(), edmtest::TestServiceTwo::nPreModuleStreamBeginLumi(), edmtest::TestServiceOne::nPreModuleStreamBeginRun(), edmtest::TestServiceTwo::nPreModuleStreamBeginRun(), edmtest::TestServiceOne::nPreModuleStreamEndLumi(), edmtest::TestServiceTwo::nPreModuleStreamEndLumi(), edmtest::TestServiceOne::nPreModuleStreamEndRun(), edmtest::TestServiceTwo::nPreModuleStreamEndRun(), edmtest::TestServiceOne::nPreStreamBeginLumi(), edmtest::TestServiceTwo::nPreStreamBeginLumi(), edmtest::TestServiceOne::nPreStreamBeginRun(), edmtest::TestServiceTwo::nPreStreamBeginRun(), edmtest::TestServiceOne::nPreStreamEndLumi(), edmtest::TestServiceTwo::nPreStreamEndLumi(), edmtest::TestServiceOne::nPreStreamEndRun(), edmtest::TestServiceTwo::nPreStreamEndRun(), nStreamBeginLumi_, nStreamBeginRun_, nStreamEndLumi_, nStreamEndRun_, streamWithBeginLumiException_, streamWithBeginRunException_, and verbose_.

268  {
269  bool testsPass = true;
270 
271  unsigned int totalStreamBeginLumi = 0;
272  unsigned int i = 0;
273  for (auto const& nStreamBeginLumi : nStreamBeginLumi_) {
274  totalStreamBeginLumi += nStreamBeginLumi;
275 
276  // Don't know exact number to expect because streams might skip a lumi so
277  // only throw if it is greater than the maximum possible and we only know
278  // that for sure if the exception was thrown in stream begin lumi.
279  if (nStreamBeginLumi > expectedStreamBeginLumi_ && streamWithBeginLumiException_ != kUnset) {
280  edm::LogAbsolute("ExceptionThrowingProducer")
281  << "FAILED: More than maximum possible number of streamBeginLumi transitions, stream " << i << " saw "
282  << nStreamBeginLumi << " max possible " << expectedStreamBeginLumi_;
283  testsPass = false;
284  }
285  unsigned int expectedStreamEndLumi =
286  (streamWithBeginLumiException_ == i) ? nStreamBeginLumi - 1 : nStreamBeginLumi;
287  if (nStreamEndLumi_[i] != expectedStreamEndLumi) {
288  edm::LogAbsolute("ExceptionThrowingProducer")
289  << "FAILED: Unexpected number of streamEndLumi transitions, stream " << i << " saw " << nStreamEndLumi_[i]
290  << " expected " << expectedStreamEndLumi;
291  testsPass = false;
292  }
293 
294  ++i;
295  }
296 
297  unsigned int totalStreamBeginRun = 0;
298  i = 0;
299  for (auto const& nStreamBeginRun : nStreamBeginRun_) {
300  totalStreamBeginRun += nStreamBeginRun;
301 
302  // Don't know exact number to expect because streams might skip a run (not yet
303  // but probably in the future) so only throw if it is greater than the maximum
304  // possible and we only know that for sure if the exception was thrown in stream begin run.
305  if (nStreamBeginRun > expectedStreamBeginRun_ && streamWithBeginRunException_ != kUnset) {
306  edm::LogAbsolute("ExceptionThrowingProducer")
307  << "FAILED: More than maximum possible number of streamBeginRun transitions, stream " << i << " saw "
308  << nStreamBeginRun << " max possible " << expectedStreamBeginRun_;
309  testsPass = false;
310  }
311  unsigned int expectedStreamEndRun = (streamWithBeginRunException_ == i) ? nStreamBeginRun - 1 : nStreamBeginRun;
312  if (nStreamEndRun_[i] != expectedStreamEndRun) {
313  edm::LogAbsolute("ExceptionThrowingProducer")
314  << "FAILED: Unexpected number of streamEndRun transitions, stream " << i << " saw " << nStreamEndRun_[i]
315  << " expected " << expectedStreamEndRun;
316  testsPass = false;
317  }
318 
319  ++i;
320  }
321 
322  // There has to be at least as many global begin lumi transitions
323  // as expected. Because of concurrency, the Framework might already have
324  // started other lumis ahead of the one where an exception occurs.
326  edm::LogAbsolute("ExceptionThrowingProducer")
327  << "FAILED: Less than the expected number of globalBeginLumi transitions, expected at least "
328  << expectedGlobalBeginLumi_ << " saw " << nGlobalBeginLumi_.load();
329  testsPass = false;
330  }
331 
332  // There has to be at least as many global begin run transitions
333  // as expected. Because of concurrency, the Framework might already have
334  // started other runs ahead of the one where an exception occurs.
336  edm::LogAbsolute("ExceptionThrowingProducer")
337  << "FAILED: Less than the expected number of globalBeginRun transitions, expected at least "
338  << expectedGlobalBeginRun_ << " saw " << nGlobalBeginRun_.load();
339  testsPass = false;
340  }
341 
342  unsigned int expectedGlobalEndLumi =
344  if (nGlobalEndLumi_.load() != expectedGlobalEndLumi) {
345  edm::LogAbsolute("ExceptionThrowingProducer")
346  << "FAILED: number of global end lumi transitions not equal to expected value, expected "
347  << expectedGlobalEndLumi << " saw " << nGlobalEndLumi_.load();
348  testsPass = false;
349  }
350 
351  unsigned int expectedGlobalEndRun =
353  if (nGlobalEndRun_.load() != expectedGlobalEndRun) {
354  edm::LogAbsolute("ExceptionThrowingProducer")
355  << "FAILED: number of global end run transitions not equal to expected value, expected "
356  << expectedGlobalEndRun << " saw " << nGlobalEndRun_.load();
357  testsPass = false;
358  }
359 
361  if (serviceOne->nPreStreamBeginLumi() != totalStreamBeginLumi ||
362  serviceOne->nPostStreamBeginLumi() != totalStreamBeginLumi ||
363  serviceOne->nPreStreamEndLumi() != totalStreamBeginLumi ||
364  serviceOne->nPostStreamEndLumi() != totalStreamBeginLumi ||
365  serviceOne->nPreModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
366  serviceOne->nPostModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
367  serviceOne->nPreModuleStreamEndLumi() !=
368  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_ ||
369  serviceOne->nPostModuleStreamEndLumi() !=
370  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_) {
371  edm::LogAbsolute("ExceptionThrowingProducer")
372  << "FAILED: Unexpected number of service transitions in TestServiceOne, stream lumi";
373  testsPass = false;
374  }
375 
377  if (serviceTwo->nPreStreamBeginLumi() != totalStreamBeginLumi ||
378  serviceTwo->nPostStreamBeginLumi() != totalStreamBeginLumi ||
379  serviceTwo->nPreStreamEndLumi() != totalStreamBeginLumi ||
380  serviceTwo->nPostStreamEndLumi() != totalStreamBeginLumi ||
381  serviceTwo->nPreModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
382  serviceTwo->nPostModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
383  serviceTwo->nPreModuleStreamEndLumi() !=
384  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_ ||
385  serviceTwo->nPostModuleStreamEndLumi() !=
386  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_) {
387  edm::LogAbsolute("ExceptionThrowingProducer")
388  << "FAILED: Unexpected number of service transitions in TestServiceTwo, stream lumi";
389  testsPass = false;
390  }
391 
392  unsigned int nGlobalBeginLumi = nGlobalBeginLumi_.load();
393 
394  if (serviceOne->nPreGlobalBeginLumi() != nGlobalBeginLumi ||
395  serviceOne->nPostGlobalBeginLumi() != nGlobalBeginLumi || serviceOne->nPreGlobalEndLumi() != nGlobalBeginLumi ||
396  serviceOne->nPostGlobalEndLumi() != nGlobalBeginLumi ||
397  serviceOne->nPreModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
398  serviceOne->nPostModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
399  serviceOne->nPreModuleGlobalEndLumi() !=
401  serviceOne->nPostModuleGlobalEndLumi() !=
403  serviceOne->nPreGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_ ||
404  serviceOne->nPostGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_) {
405  edm::LogAbsolute("ExceptionThrowingProducer")
406  << "FAILED: Unexpected number of service transitions in TestServiceOne, global lumi";
407  testsPass = false;
408  }
409 
410  if (serviceTwo->nPreGlobalBeginLumi() != nGlobalBeginLumi ||
411  serviceTwo->nPostGlobalBeginLumi() != nGlobalBeginLumi || serviceTwo->nPreGlobalEndLumi() != nGlobalBeginLumi ||
412  serviceTwo->nPostGlobalEndLumi() != nGlobalBeginLumi ||
413  serviceTwo->nPreModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
414  serviceTwo->nPostModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
415  serviceTwo->nPreModuleGlobalEndLumi() !=
417  serviceTwo->nPostModuleGlobalEndLumi() !=
419  serviceTwo->nPreGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_ ||
420  serviceTwo->nPostGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_) {
421  edm::LogAbsolute("ExceptionThrowingProducer")
422  << "FAILED: Unexpected number of service transitions in TestServiceTwo, global lumi";
423  testsPass = false;
424  }
425 
426  if (serviceOne->nPreStreamBeginRun() != totalStreamBeginRun ||
427  serviceOne->nPostStreamBeginRun() != totalStreamBeginRun ||
428  serviceOne->nPreStreamEndRun() != totalStreamBeginRun ||
429  serviceOne->nPostStreamEndRun() != totalStreamBeginRun ||
430  serviceOne->nPreModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
431  serviceOne->nPostModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
432  serviceOne->nPreModuleStreamEndRun() !=
433  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_ ||
434  serviceOne->nPostModuleStreamEndRun() !=
435  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_) {
436  edm::LogAbsolute("ExceptionThrowingProducer")
437  << "FAILED: Unexpected number of service transitions in TestServiceOne, stream run";
438  testsPass = false;
439  }
440 
441  if (serviceTwo->nPreStreamBeginRun() != totalStreamBeginRun ||
442  serviceTwo->nPostStreamBeginRun() != totalStreamBeginRun ||
443  serviceTwo->nPreStreamEndRun() != totalStreamBeginRun ||
444  serviceTwo->nPostStreamEndRun() != totalStreamBeginRun ||
445  serviceTwo->nPreModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
446  serviceTwo->nPostModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
447  serviceTwo->nPreModuleStreamEndRun() !=
448  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_ ||
449  serviceTwo->nPostModuleStreamEndRun() !=
450  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_) {
451  edm::LogAbsolute("ExceptionThrowingProducer")
452  << "FAILED: Unexpected number of service transitions in TestServiceTwo, stream run";
453  testsPass = false;
454  }
455 
456  unsigned int nGlobalBeginRun = nGlobalBeginRun_.load();
457 
458  if (serviceOne->nPreGlobalBeginRun() != nGlobalBeginRun || serviceOne->nPostGlobalBeginRun() != nGlobalBeginRun ||
459  serviceOne->nPreGlobalEndRun() != nGlobalBeginRun || serviceOne->nPostGlobalEndRun() != nGlobalBeginRun ||
460  serviceOne->nPreModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
461  serviceOne->nPostModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
462  serviceOne->nPreModuleGlobalEndRun() !=
464  serviceOne->nPostModuleGlobalEndRun() !=
466  serviceOne->nPreGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_ ||
467  serviceOne->nPostGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_) {
468  edm::LogAbsolute("ExceptionThrowingProducer")
469  << "FAILED: Unexpected number of service transitions in TestServiceOne, global run";
470  testsPass = false;
471  }
472 
473  if (serviceTwo->nPreGlobalBeginRun() != nGlobalBeginRun || serviceTwo->nPostGlobalBeginRun() != nGlobalBeginRun ||
474  serviceTwo->nPreGlobalEndRun() != nGlobalBeginRun || serviceTwo->nPostGlobalEndRun() != nGlobalBeginRun ||
475  serviceTwo->nPreModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
476  serviceTwo->nPostModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
477  serviceTwo->nPreModuleGlobalEndRun() !=
479  serviceTwo->nPostModuleGlobalEndRun() !=
481  serviceTwo->nPreGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_ ||
482  serviceTwo->nPostGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_) {
483  edm::LogAbsolute("ExceptionThrowingProducer")
484  << "FAILED: Unexpected number of service transitions in TestServiceTwo, global run";
485  testsPass = false;
486  }
487 
488  if (verbose_) {
489  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalBeginLumi_ = " << nGlobalBeginLumi_;
490  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalEndLumi_ = " << nGlobalEndLumi_;
491  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalBeginRun_ = " << nGlobalBeginRun_;
492  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalEndRun_ = " << nGlobalEndRun_;
493 
494  edm::LogAbsolute("ExceptionThrowingProducer")
495  << "serviceOne->nPreStreamBeginLumi = " << serviceOne->nPreStreamBeginLumi();
496  edm::LogAbsolute("ExceptionThrowingProducer")
497  << "serviceOne->nPostStreamBeginLumi = " << serviceOne->nPostStreamBeginLumi();
498  edm::LogAbsolute("ExceptionThrowingProducer")
499  << "serviceOne->nPreStreamEndLumi = " << serviceOne->nPreStreamEndLumi();
500  edm::LogAbsolute("ExceptionThrowingProducer")
501  << "serviceOne->nPostStreamEndLumi = " << serviceOne->nPostStreamEndLumi();
502  edm::LogAbsolute("ExceptionThrowingProducer")
503  << "serviceOne->nPreModuleStreamBeginLumi = " << serviceOne->nPreModuleStreamBeginLumi();
504  edm::LogAbsolute("ExceptionThrowingProducer")
505  << "serviceOne->nPostModuleStreamBeginLumi = " << serviceOne->nPostModuleStreamBeginLumi();
506  edm::LogAbsolute("ExceptionThrowingProducer")
507  << "serviceOne->nPreModuleStreamEndLumi = " << serviceOne->nPreModuleStreamEndLumi();
508  edm::LogAbsolute("ExceptionThrowingProducer")
509  << "serviceOne->nPostModuleStreamEndLumi = " << serviceOne->nPostModuleStreamEndLumi() << "\n";
510 
511  edm::LogAbsolute("ExceptionThrowingProducer")
512  << "serviceOne->nPreGlobalBeginLumi = " << serviceOne->nPreGlobalBeginLumi();
513  edm::LogAbsolute("ExceptionThrowingProducer")
514  << "serviceOne->nPostGlobalBeginLumi = " << serviceOne->nPostGlobalBeginLumi();
515  edm::LogAbsolute("ExceptionThrowingProducer")
516  << "serviceOne->nPreGlobalEndLumi = " << serviceOne->nPreGlobalEndLumi();
517  edm::LogAbsolute("ExceptionThrowingProducer")
518  << "serviceOne->nPostGlobalEndLumi = " << serviceOne->nPostGlobalEndLumi();
519  edm::LogAbsolute("ExceptionThrowingProducer")
520  << "serviceOne->nPreModuleGlobalBeginLumi = " << serviceOne->nPreModuleGlobalBeginLumi();
521  edm::LogAbsolute("ExceptionThrowingProducer")
522  << "serviceOne->nPostModuleGlobalBeginLumi = " << serviceOne->nPostModuleGlobalBeginLumi();
523  edm::LogAbsolute("ExceptionThrowingProducer")
524  << "serviceOne->nPreModuleGlobalEndLumi = " << serviceOne->nPreModuleGlobalEndLumi();
525  edm::LogAbsolute("ExceptionThrowingProducer")
526  << "serviceOne->nPostModuleGlobalEndLumi = " << serviceOne->nPostModuleGlobalEndLumi();
527  edm::LogAbsolute("ExceptionThrowingProducer")
528  << "serviceOne->nPreGlobalWriteLumi = " << serviceOne->nPreGlobalWriteLumi();
529  edm::LogAbsolute("ExceptionThrowingProducer")
530  << "serviceOne->nPostGlobalWriteLumi = " << serviceOne->nPostGlobalWriteLumi() << "\n";
531 
532  edm::LogAbsolute("ExceptionThrowingProducer")
533  << "serviceOne->nPreStreamBeginRun = " << serviceOne->nPreStreamBeginRun();
534  edm::LogAbsolute("ExceptionThrowingProducer")
535  << "serviceOne->nPostStreamBeginRun = " << serviceOne->nPostStreamBeginRun();
536  edm::LogAbsolute("ExceptionThrowingProducer")
537  << "serviceOne->nPreStreamEndRun = " << serviceOne->nPreStreamEndRun();
538  edm::LogAbsolute("ExceptionThrowingProducer")
539  << "serviceOne->nPostStreamEndRun = " << serviceOne->nPostStreamEndRun();
540  edm::LogAbsolute("ExceptionThrowingProducer")
541  << "serviceOne->nPreModuleStreamBeginRun = " << serviceOne->nPreModuleStreamBeginRun();
542  edm::LogAbsolute("ExceptionThrowingProducer")
543  << "serviceOne->nPostModuleStreamBeginRun = " << serviceOne->nPostModuleStreamBeginRun();
544  edm::LogAbsolute("ExceptionThrowingProducer")
545  << "serviceOne->nPreModuleStreamEndRun = " << serviceOne->nPreModuleStreamEndRun();
546  edm::LogAbsolute("ExceptionThrowingProducer")
547  << "serviceOne->nPostModuleStreamEndRun = " << serviceOne->nPostModuleStreamEndRun() << "\n";
548 
549  edm::LogAbsolute("ExceptionThrowingProducer")
550  << "serviceOne->nPreGlobalBeginRun = " << serviceOne->nPreGlobalBeginRun();
551  edm::LogAbsolute("ExceptionThrowingProducer")
552  << "serviceOne->nPostGlobalBeginRun = " << serviceOne->nPostGlobalBeginRun();
553  edm::LogAbsolute("ExceptionThrowingProducer")
554  << "serviceOne->nPreGlobalEndRun = " << serviceOne->nPreGlobalEndRun();
555  edm::LogAbsolute("ExceptionThrowingProducer")
556  << "serviceOne->nPostGlobalEndRun = " << serviceOne->nPostGlobalEndRun();
557  edm::LogAbsolute("ExceptionThrowingProducer")
558  << "serviceOne->nPreModuleGlobalBeginRun = " << serviceOne->nPreModuleGlobalBeginRun();
559  edm::LogAbsolute("ExceptionThrowingProducer")
560  << "serviceOne->nPostModuleGlobalBeginRun = " << serviceOne->nPostModuleGlobalBeginRun();
561  edm::LogAbsolute("ExceptionThrowingProducer")
562  << "serviceOne->nPreModuleGlobalEndRun = " << serviceOne->nPreModuleGlobalEndRun();
563  edm::LogAbsolute("ExceptionThrowingProducer")
564  << "serviceOne->nPostModuleGlobalEndRun = " << serviceOne->nPostModuleGlobalEndRun();
565  edm::LogAbsolute("ExceptionThrowingProducer")
566  << "serviceOne->nPreGlobalWriteRun = " << serviceOne->nPreGlobalWriteRun();
567  edm::LogAbsolute("ExceptionThrowingProducer")
568  << "serviceOne->nPostGlobalWriteRun = " << serviceOne->nPostGlobalWriteRun() << "\n";
569  }
570 
571  if (testsPass) {
572  edm::LogAbsolute("ExceptionThrowingProducer") << "All tests in ExceptionThrowingProducer PASSED";
573  } else {
574  edm::LogAbsolute("ExceptionThrowingProducer") << "At least one test in ExceptionThrowingProducer FAILED";
575  }
576  }
unsigned int nPreStreamEndLumi() const
unsigned int nPreModuleGlobalBeginLumi() const
std::vector< unsigned int > nStreamBeginRun_
unsigned int nPreStreamBeginLumi() const
unsigned int nPreStreamBeginRun() const
unsigned int nPreStreamBeginLumi() const
unsigned int nPreModuleStreamBeginLumi() const
std::vector< unsigned int > nStreamBeginLumi_
unsigned int nPreModuleGlobalBeginLumi() const
unsigned int nPostGlobalEndLumi() const
unsigned int nPostStreamBeginLumi() const
unsigned int nPostModuleStreamEndLumi() const
unsigned int nPreGlobalEndRun() const
unsigned int nPostGlobalBeginRun() const
unsigned int nPreModuleStreamBeginRun() const
unsigned int nPreGlobalBeginLumi() const
unsigned int nPostGlobalBeginLumi() const
unsigned int nPostStreamBeginRun() const
std::vector< unsigned int > nStreamEndRun_
unsigned int nPreModuleGlobalEndRun() const
std::atomic< unsigned int > nGlobalBeginLumi_
unsigned int nPostGlobalEndLumi() const
unsigned int nPostModuleGlobalEndRun() const
unsigned int nPreGlobalEndLumi() const
unsigned int nPostGlobalWriteLumi() const
unsigned int nPostModuleStreamBeginLumi() const
unsigned int nPreGlobalBeginLumi() const
unsigned int nPreModuleStreamBeginLumi() const
unsigned int nPostModuleGlobalBeginLumi() const
unsigned int nPreGlobalWriteRun() const
unsigned int nPostStreamBeginLumi() const
unsigned int nPreStreamBeginRun() const
unsigned int nPostGlobalBeginRun() const
unsigned int nPostGlobalEndRun() const
unsigned int nPreModuleStreamBeginRun() const
std::atomic< unsigned int > nGlobalEndRun_
unsigned int nPostStreamEndRun() const
unsigned int nPreGlobalEndRun() const
unsigned int nPreGlobalBeginRun() const
unsigned int nPreStreamEndLumi() const
unsigned int nPreModuleGlobalBeginRun() const
unsigned int nPreGlobalWriteLumi() const
unsigned int nPostModuleGlobalBeginLumi() const
unsigned int nPreStreamEndRun() const
unsigned int nPreGlobalWriteRun() const
unsigned int nPreModuleGlobalEndLumi() const
constexpr unsigned int kNumberOfTestModules
unsigned int nPreModuleGlobalBeginRun() const
unsigned int nPostModuleGlobalBeginRun() const
unsigned int nPostModuleGlobalEndLumi() const
unsigned int nPostModuleStreamEndLumi() const
unsigned int nPostGlobalWriteLumi() const
unsigned int nPreGlobalWriteLumi() const
unsigned int nPostStreamEndLumi() const
unsigned int nPostModuleGlobalBeginRun() const
unsigned int nPostGlobalBeginLumi() const
std::atomic< unsigned int > nGlobalEndLumi_
unsigned int nPostModuleStreamBeginRun() const
unsigned int nPostModuleGlobalEndLumi() const
unsigned int nPostModuleGlobalEndRun() const
constexpr unsigned int kUnset
unsigned int nPreStreamEndRun() const
unsigned int nPreModuleStreamEndLumi() const
unsigned int nPreModuleStreamEndRun() const
unsigned int nPostModuleStreamEndRun() const
unsigned int nPreModuleGlobalEndLumi() const
std::vector< unsigned int > nStreamEndLumi_
unsigned int nPostStreamEndRun() const
unsigned int nPostGlobalWriteRun() const
unsigned int nPreModuleStreamEndLumi() const
unsigned int nPostGlobalWriteRun() const
unsigned int nPostModuleStreamEndRun() const
Log< level::System, true > LogAbsolute
unsigned int nPreModuleGlobalEndRun() const
unsigned int nPostGlobalEndRun() const
std::atomic< unsigned int > nGlobalBeginRun_
unsigned int nPreModuleStreamEndRun() const
unsigned int nPostModuleStreamBeginRun() const
unsigned int nPostStreamBeginRun() const
unsigned int nPostModuleStreamBeginLumi() const
unsigned int nPreGlobalEndLumi() const
unsigned int nPostStreamEndLumi() const
unsigned int nPreGlobalBeginRun() const

◆ fillDescriptions()

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

Definition at line 578 of file ExceptionThrowingProducer.cc.

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

578  {
580  edm::EventID invalidEventID;
581  desc.addUntracked<bool>("verbose", false);
582  desc.addUntracked<edm::EventID>("eventIDThrowOnEvent", invalidEventID);
583  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalBeginRun", invalidEventID);
584  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalBeginLumi", invalidEventID);
585  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalEndRun", invalidEventID);
586  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalEndLumi", invalidEventID);
587  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamBeginRun", invalidEventID);
588  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamBeginLumi", invalidEventID);
589  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamEndRun", invalidEventID);
590  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamEndLumi", invalidEventID);
591 
592  desc.addUntracked<unsigned int>("expectedStreamBeginLumi", kUnset);
593  desc.addUntracked<unsigned int>("expectedOffsetNoStreamEndLumi", 0);
594  desc.addUntracked<unsigned int>("expectedGlobalBeginLumi", 0);
595  desc.addUntracked<unsigned int>("expectedOffsetNoGlobalEndLumi", 0);
596  desc.addUntracked<unsigned int>("expectedOffsetNoWriteLumi", 0);
597 
598  desc.addUntracked<unsigned int>("expectedStreamBeginRun", kUnset);
599  desc.addUntracked<unsigned int>("expectedOffsetNoStreamEndRun", 0);
600  desc.addUntracked<unsigned int>("expectedGlobalBeginRun", 0);
601  desc.addUntracked<unsigned int>("expectedOffsetNoGlobalEndRun", 0);
602  desc.addUntracked<unsigned int>("expectedOffsetNoWriteRun", 0);
603 
604  descriptions.addDefault(desc);
605  }
void addDefault(ParameterSetDescription const &psetDescription)
constexpr unsigned int kUnset

◆ globalBeginLuminosityBlock()

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

Definition at line 166 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnGlobalBeginLumi_, Exception, globalBeginLumiExceptionOccurred_, edm::invalidEventNumber, and nGlobalBeginLumi_.

167  {
169  if (edm::EventID(lumi.id().run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
172  throw cms::Exception("IntentionalTestException")
173  << "ExceptionThrowingProducer::globalBeginLuminosityBlock, module configured to throw on: "
175  }
176  return std::make_shared<Cache>();
177  }
std::atomic< unsigned int > nGlobalBeginLumi_
EventNumber_t const invalidEventNumber

◆ globalBeginRun()

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

Definition at line 145 of file ExceptionThrowingProducer.cc.

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

145  {
150  throw cms::Exception("IntentionalTestException")
151  << "ExceptionThrowingProducer::globalBeginRun, module configured to throw on: "
153  }
154  return std::make_shared<Cache>();
155  }
EventNumber_t const invalidEventNumber
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
std::atomic< unsigned int > nGlobalBeginRun_

◆ globalEndLuminosityBlock()

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

Definition at line 179 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnGlobalEndLumi_, Exception, edm::invalidEventNumber, and nGlobalEndLumi_.

180  {
181  ++nGlobalEndLumi_;
182  if (edm::EventID(lumi.id().run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
184  throw cms::Exception("IntentionalTestException")
185  << "ExceptionThrowingProducer::globalEndLuminosityBlock, module configured to throw on: "
187  }
188  }
EventNumber_t const invalidEventNumber
std::atomic< unsigned int > nGlobalEndLumi_

◆ globalEndRun()

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

Definition at line 157 of file ExceptionThrowingProducer.cc.

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

157  {
158  ++nGlobalEndRun_;
161  throw cms::Exception("IntentionalTestException")
162  << "ExceptionThrowingProducer::globalEndRun, module configured to throw on: " << eventIDThrowOnGlobalEndRun_;
163  }
164  }
EventNumber_t const invalidEventNumber
std::atomic< unsigned int > nGlobalEndRun_
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 138 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnEvent_, and Exception.

138  {
139  if (event.id() == eventIDThrowOnEvent_) {
140  throw cms::Exception("IntentionalTestException")
141  << "ExceptionThrowingProducer::produce, module configured to throw on: " << eventIDThrowOnEvent_;
142  }
143  }
Definition: event.py:1

◆ streamBeginLuminosityBlock()

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

Definition at line 213 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnStreamBeginLumi_, Exception, edm::invalidEventNumber, kTestStreams, nStreamBeginLumi_, streamBeginLumiExceptionOccurred_, streamWithBeginLumiException_, and edm::StreamID::value().

215  {
216  if (iStream < kTestStreams) {
217  ++nStreamBeginLumi_[iStream];
218  }
219 
220  // Throw if this lumi's ID matches the configured ID (this code is written so
221  // that only the first stream to match it will throw).
222  bool expected = false;
223  if (edm::EventID(lumi.run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
225  streamBeginLumiExceptionOccurred_.compare_exchange_strong(expected, true)) {
226  // Remember which stream threw
228 
229  throw cms::Exception("IntentionalTestException")
230  << "ExceptionThrowingProducer::streamBeginLuminosityBlock, module configured to throw on: "
232  }
233  }
constexpr unsigned int kTestStreams
std::vector< unsigned int > nStreamBeginLumi_
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 194 of file ExceptionThrowingProducer.cc.

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

196  {
197  if (iStream < kTestStreams) {
198  ++nStreamBeginRun_[iStream];
199  }
200 
201  bool expected = false;
204  streamBeginRunExceptionOccurred_.compare_exchange_strong(expected, true)) {
205  // Remember which stream threw
207  throw cms::Exception("IntentionalTestException")
208  << "ExceptionThrowingProducer::streamBeginRun, module configured to throw on: "
210  }
211  }
std::vector< unsigned int > nStreamBeginRun_
constexpr unsigned int kTestStreams
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 235 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnStreamEndLumi_, Exception, edm::invalidEventNumber, kTestStreams, nStreamEndLumi_, and streamEndLumiExceptionOccurred_.

237  {
238  if (iStream < kTestStreams) {
239  ++nStreamEndLumi_[iStream];
240  }
241 
242  bool expected = false;
243  if (edm::EventID(lumi.run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
245  streamEndLumiExceptionOccurred_.compare_exchange_strong(expected, true)) {
246  throw cms::Exception("IntentionalTestException")
247  << "ExceptionThrowingProducer::streamEndLuminosityBlock, module configured to throw on: "
249  }
250  }
constexpr unsigned int kTestStreams
EventNumber_t const invalidEventNumber
std::vector< unsigned int > nStreamEndLumi_

◆ streamEndRun()

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

Definition at line 252 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnStreamEndRun_, Exception, edm::invalidEventNumber, edm::invalidLuminosityBlockNumber, kTestStreams, nStreamEndRun_, writedatasetfile::run, and streamEndRunExceptionOccurred_.

254  {
255  if (iStream < kTestStreams) {
256  ++nStreamEndRun_[iStream];
257  }
258 
259  bool expected = false;
262  streamEndRunExceptionOccurred_.compare_exchange_strong(expected, true)) {
263  throw cms::Exception("IntentionalTestException")
264  << "ExceptionThrowingProducer::streamEndRun, module configured to throw on: " << eventIDThrowOnStreamEndRun_;
265  }
266  }
constexpr unsigned int kTestStreams
std::vector< unsigned int > nStreamEndRun_
EventNumber_t const invalidEventNumber
LuminosityBlockNumber_t const invalidLuminosityBlockNumber

Member Data Documentation

◆ eventIDThrowOnEvent_

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

Definition at line 69 of file ExceptionThrowingProducer.cc.

Referenced by produce().

◆ eventIDThrowOnGlobalBeginLumi_

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

Definition at line 71 of file ExceptionThrowingProducer.cc.

Referenced by globalBeginLuminosityBlock().

◆ eventIDThrowOnGlobalBeginRun_

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

Definition at line 70 of file ExceptionThrowingProducer.cc.

Referenced by globalBeginRun().

◆ eventIDThrowOnGlobalEndLumi_

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

Definition at line 73 of file ExceptionThrowingProducer.cc.

Referenced by globalEndLuminosityBlock().

◆ eventIDThrowOnGlobalEndRun_

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

Definition at line 72 of file ExceptionThrowingProducer.cc.

Referenced by globalEndRun().

◆ eventIDThrowOnStreamBeginLumi_

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

Definition at line 75 of file ExceptionThrowingProducer.cc.

Referenced by streamBeginLuminosityBlock().

◆ eventIDThrowOnStreamBeginRun_

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

Definition at line 74 of file ExceptionThrowingProducer.cc.

Referenced by streamBeginRun().

◆ eventIDThrowOnStreamEndLumi_

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

Definition at line 77 of file ExceptionThrowingProducer.cc.

Referenced by streamEndLuminosityBlock().

◆ eventIDThrowOnStreamEndRun_

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

Definition at line 76 of file ExceptionThrowingProducer.cc.

Referenced by streamEndRun().

◆ expectedGlobalBeginLumi_

unsigned int edmtest::ExceptionThrowingProducer::expectedGlobalBeginLumi_
private

Definition at line 92 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedGlobalBeginRun_

unsigned int edmtest::ExceptionThrowingProducer::expectedGlobalBeginRun_
private

Definition at line 99 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoGlobalEndLumi_

unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoGlobalEndLumi_
private

Definition at line 93 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoGlobalEndRun_

unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoGlobalEndRun_
private

Definition at line 100 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoStreamEndLumi_

unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoStreamEndLumi_
private

Definition at line 90 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoStreamEndRun_

unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoStreamEndRun_
private

Definition at line 97 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoWriteLumi_

unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoWriteLumi_
private

Definition at line 94 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoWriteRun_

unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoWriteRun_
private

Definition at line 101 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedStreamBeginLumi_

unsigned int edmtest::ExceptionThrowingProducer::expectedStreamBeginLumi_
private

Definition at line 89 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedStreamBeginRun_

unsigned int edmtest::ExceptionThrowingProducer::expectedStreamBeginRun_
private

Definition at line 96 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ globalBeginLumiExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::globalBeginLumiExceptionOccurred_ = false
mutableprivate

Definition at line 105 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and globalBeginLuminosityBlock().

◆ globalBeginRunExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::globalBeginRunExceptionOccurred_ = false
mutableprivate

Definition at line 109 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and globalBeginRun().

◆ nGlobalBeginLumi_

std::atomic<unsigned int> edmtest::ExceptionThrowingProducer::nGlobalBeginLumi_ {0}
mutableprivate

Definition at line 81 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and globalBeginLuminosityBlock().

◆ nGlobalBeginRun_

std::atomic<unsigned int> edmtest::ExceptionThrowingProducer::nGlobalBeginRun_ {0}
mutableprivate

Definition at line 86 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and globalBeginRun().

◆ nGlobalEndLumi_

std::atomic<unsigned int> edmtest::ExceptionThrowingProducer::nGlobalEndLumi_ {0}
mutableprivate

Definition at line 82 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and globalEndLuminosityBlock().

◆ nGlobalEndRun_

std::atomic<unsigned int> edmtest::ExceptionThrowingProducer::nGlobalEndRun_ {0}
mutableprivate

Definition at line 87 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and globalEndRun().

◆ nStreamBeginLumi_

std::vector<unsigned int> edmtest::ExceptionThrowingProducer::nStreamBeginLumi_
mutableprivate

Definition at line 79 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamBeginLuminosityBlock().

◆ nStreamBeginRun_

std::vector<unsigned int> edmtest::ExceptionThrowingProducer::nStreamBeginRun_
mutableprivate

Definition at line 84 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamBeginRun().

◆ nStreamEndLumi_

std::vector<unsigned int> edmtest::ExceptionThrowingProducer::nStreamEndLumi_
mutableprivate

Definition at line 80 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamEndLuminosityBlock().

◆ nStreamEndRun_

std::vector<unsigned int> edmtest::ExceptionThrowingProducer::nStreamEndRun_
mutableprivate

Definition at line 85 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamEndRun().

◆ streamBeginLumiExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::streamBeginLumiExceptionOccurred_ = false
mutableprivate

Definition at line 103 of file ExceptionThrowingProducer.cc.

Referenced by streamBeginLuminosityBlock().

◆ streamBeginRunExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::streamBeginRunExceptionOccurred_ = false
mutableprivate

Definition at line 107 of file ExceptionThrowingProducer.cc.

Referenced by streamBeginRun().

◆ streamEndLumiExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::streamEndLumiExceptionOccurred_ = false
mutableprivate

Definition at line 104 of file ExceptionThrowingProducer.cc.

Referenced by streamEndLuminosityBlock().

◆ streamEndRunExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::streamEndRunExceptionOccurred_ = false
mutableprivate

Definition at line 108 of file ExceptionThrowingProducer.cc.

Referenced by streamEndRun().

◆ streamWithBeginLumiException_

unsigned int edmtest::ExceptionThrowingProducer::streamWithBeginLumiException_ = kUnset
mutableprivate

Definition at line 91 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamBeginLuminosityBlock().

◆ streamWithBeginRunException_

unsigned int edmtest::ExceptionThrowingProducer::streamWithBeginRunException_ = kUnset
mutableprivate

Definition at line 98 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamBeginRun().

◆ verbose_

bool edmtest::ExceptionThrowingProducer::verbose_
private

Definition at line 67 of file ExceptionThrowingProducer.cc.

Referenced by endJob().