44 :
public edm::global::EDProducer<edm::StreamCache<Cache>, edm::RunCache<Cache>, edm::LuminosityBlockCache<Cache>> {
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")) {}
141 <<
"ExceptionThrowingProducer::produce, module configured to throw on: " <<
eventIDThrowOnEvent_;
151 <<
"ExceptionThrowingProducer::globalBeginRun, module configured to throw on: " 154 return std::make_shared<Cache>();
173 <<
"ExceptionThrowingProducer::globalBeginLuminosityBlock, module configured to throw on: " 176 return std::make_shared<Cache>();
185 <<
"ExceptionThrowingProducer::globalEndLuminosityBlock, module configured to throw on: " 191 return std::make_unique<Cache>();
201 bool expected =
false;
208 <<
"ExceptionThrowingProducer::streamBeginRun, module configured to throw on: " 222 bool expected =
false;
230 <<
"ExceptionThrowingProducer::streamBeginLuminosityBlock, module configured to throw on: " 242 bool expected =
false;
247 <<
"ExceptionThrowingProducer::streamEndLuminosityBlock, module configured to throw on: " 259 bool expected =
false;
269 bool testsPass =
true;
271 unsigned int totalStreamBeginLumi = 0;
274 totalStreamBeginLumi += nStreamBeginLumi;
281 <<
"FAILED: More than maximum possible number of streamBeginLumi transitions, stream " <<
i <<
" saw " 285 unsigned int expectedStreamEndLumi =
289 <<
"FAILED: Unexpected number of streamEndLumi transitions, stream " <<
i <<
" saw " <<
nStreamEndLumi_[
i]
290 <<
" expected " << expectedStreamEndLumi;
297 unsigned int totalStreamBeginRun = 0;
300 totalStreamBeginRun += nStreamBeginRun;
307 <<
"FAILED: More than maximum possible number of streamBeginRun transitions, stream " <<
i <<
" saw " 314 <<
"FAILED: Unexpected number of streamEndRun transitions, stream " <<
i <<
" saw " <<
nStreamEndRun_[
i]
315 <<
" expected " << expectedStreamEndRun;
327 <<
"FAILED: Less than the expected number of globalBeginLumi transitions, expected at least " 337 <<
"FAILED: Less than the expected number of globalBeginRun transitions, expected at least " 342 unsigned int expectedGlobalEndLumi =
346 <<
"FAILED: number of global end lumi transitions not equal to expected value, expected " 351 unsigned int expectedGlobalEndRun =
355 <<
"FAILED: number of global end run transitions not equal to expected value, expected " 372 <<
"FAILED: Unexpected number of service transitions in TestServiceOne, stream lumi";
388 <<
"FAILED: Unexpected number of service transitions in TestServiceTwo, stream lumi";
406 <<
"FAILED: Unexpected number of service transitions in TestServiceOne, global lumi";
422 <<
"FAILED: Unexpected number of service transitions in TestServiceTwo, global lumi";
437 <<
"FAILED: Unexpected number of service transitions in TestServiceOne, stream run";
452 <<
"FAILED: Unexpected number of service transitions in TestServiceTwo, stream run";
469 <<
"FAILED: Unexpected number of service transitions in TestServiceOne, global run";
484 <<
"FAILED: Unexpected number of service transitions in TestServiceTwo, global run";
572 edm::LogAbsolute(
"ExceptionThrowingProducer") <<
"All tests in ExceptionThrowingProducer PASSED";
574 edm::LogAbsolute(
"ExceptionThrowingProducer") <<
"At least one test in ExceptionThrowingProducer FAILED";
581 desc.addUntracked<
bool>(
"verbose",
false);
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);
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);
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);
unsigned int nPreStreamEndLumi() const
unsigned int nPreModuleGlobalBeginLumi() const
std::vector< unsigned int > nStreamBeginRun_
unsigned int nPreStreamBeginLumi() const
unsigned int nPreStreamBeginRun() const
constexpr unsigned int kTestStreams
unsigned int nPreStreamBeginLumi() const
edm::EventID eventIDThrowOnGlobalBeginRun_
unsigned int nPreModuleStreamBeginLumi() const
std::vector< unsigned int > nStreamBeginLumi_
std::atomic< bool > streamEndLumiExceptionOccurred_
unsigned int nPreModuleGlobalBeginLumi() const
edm::EventID eventIDThrowOnEvent_
unsigned int nPostGlobalEndLumi() const
unsigned int nPostStreamBeginLumi() const
std::shared_ptr< Cache > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
std::unique_ptr< Cache > beginStream(edm::StreamID) const override
unsigned int expectedOffsetNoWriteRun_
unsigned int nPostModuleStreamEndLumi() const
unsigned int nPreGlobalEndRun() const
unsigned int nPostGlobalBeginRun() const
unsigned int nPreModuleStreamBeginRun() const
unsigned int nPreGlobalBeginLumi() const
std::atomic< bool > streamBeginRunExceptionOccurred_
unsigned int nPostGlobalBeginLumi() const
unsigned int nPostStreamBeginRun() const
std::atomic< bool > streamBeginLumiExceptionOccurred_
std::atomic< bool > globalBeginLumiExceptionOccurred_
std::vector< unsigned int > nStreamEndRun_
unsigned int nPreModuleGlobalEndRun() const
static void fillDescriptions(edm::ConfigurationDescriptions &)
std::atomic< unsigned int > nGlobalBeginLumi_
unsigned int nPostGlobalEndLumi() const
unsigned int expectedOffsetNoStreamEndRun_
unsigned int nPostModuleGlobalEndRun() const
unsigned int nPreGlobalEndLumi() const
std::atomic< bool > globalBeginRunExceptionOccurred_
unsigned int nPostGlobalWriteLumi() const
edm::EventID eventIDThrowOnStreamBeginRun_
unsigned int nPostModuleStreamBeginLumi() const
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const override
unsigned int expectedGlobalBeginLumi_
EventNumber_t const invalidEventNumber
unsigned int nPreGlobalBeginLumi() const
unsigned int nPreModuleStreamBeginLumi() const
void addDefault(ParameterSetDescription const &psetDescription)
unsigned int nPostModuleGlobalBeginLumi() const
unsigned int expectedOffsetNoStreamEndLumi_
edm::EventID eventIDThrowOnStreamEndRun_
unsigned int streamWithBeginLumiException_
unsigned int expectedOffsetNoGlobalEndRun_
unsigned int streamWithBeginRunException_
edm::EventID eventIDThrowOnStreamBeginLumi_
unsigned int nPreGlobalWriteRun() const
unsigned int expectedGlobalBeginRun_
unsigned int nPostStreamBeginLumi() const
unsigned int nPreStreamBeginRun() const
unsigned int nPostGlobalBeginRun() const
unsigned int nPostGlobalEndRun() const
unsigned int expectedStreamBeginLumi_
unsigned int nPreModuleStreamBeginRun() const
std::atomic< unsigned int > nGlobalEndRun_
unsigned int nPostStreamEndRun() const
unsigned int nPreGlobalEndRun() const
unsigned int nPreGlobalBeginRun() const
#define DEFINE_FWK_MODULE(type)
void streamBeginLuminosityBlock(edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
std::atomic< bool > streamEndRunExceptionOccurred_
unsigned int nPreStreamEndLumi() const
unsigned int nPreModuleGlobalBeginRun() const
void streamBeginRun(edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
unsigned int nPreGlobalWriteLumi() const
unsigned int nPostModuleGlobalBeginLumi() const
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
unsigned int nPreStreamEndRun() const
unsigned int nPreGlobalWriteRun() const
unsigned int nPreModuleGlobalEndLumi() const
constexpr unsigned int kNumberOfTestModules
unsigned int nPreModuleGlobalBeginRun() const
unsigned int nPostModuleGlobalBeginRun() const
std::shared_ptr< Cache > globalBeginRun(edm::Run const &, edm::EventSetup const &) const override
unsigned int nPostModuleGlobalEndLumi() const
unsigned int expectedOffsetNoGlobalEndLumi_
unsigned int nPostModuleStreamEndLumi() const
unsigned int nPostGlobalWriteLumi() const
unsigned int nPreGlobalWriteLumi() const
unsigned int nPostStreamEndLumi() const
unsigned int nPostModuleGlobalBeginRun() const
unsigned int nPostGlobalBeginLumi() const
ExceptionThrowingProducer(edm::ParameterSet const &)
std::atomic< unsigned int > nGlobalEndLumi_
void streamEndRun(edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
unsigned int nPostModuleStreamBeginRun() const
unsigned int nPostModuleGlobalEndLumi() const
unsigned int nPostModuleGlobalEndRun() const
constexpr unsigned int kUnset
unsigned int nPreStreamEndRun() const
unsigned int nPreModuleStreamEndLumi() const
void streamEndLuminosityBlock(edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
unsigned int expectedStreamBeginRun_
unsigned int nPreModuleStreamEndRun() const
unsigned int expectedOffsetNoWriteLumi_
unsigned int nPostModuleStreamEndRun() const
edm::EventID eventIDThrowOnStreamEndLumi_
unsigned int nPreModuleGlobalEndLumi() const
void globalEndRun(edm::Run const &, edm::EventSetup const &) const override
std::vector< unsigned int > nStreamEndLumi_
edm::EventID eventIDThrowOnGlobalEndLumi_
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
unsigned int value() const
std::atomic< unsigned int > nGlobalBeginRun_
unsigned int nPreModuleStreamEndRun() const
unsigned int nPostModuleStreamBeginRun() const
unsigned int nPostStreamBeginRun() const
edm::EventID eventIDThrowOnGlobalEndRun_
unsigned int nPostModuleStreamBeginLumi() const
unsigned int nPreGlobalEndLumi() const
unsigned int nPostStreamEndLumi() const
edm::EventID eventIDThrowOnGlobalBeginLumi_
unsigned int nPreGlobalBeginRun() const