Skip to content

Commit

Permalink
Allow random numbers to be generated at beginLuminosityBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
W.David Dagenhart committed Nov 17, 2010
1 parent 0c07d5d commit 3c87b90
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions IOMC/RandomEngine/src/RandomNumberGeneratorService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -617,25 +617,10 @@ RandomNumberGeneratorService::postModuleEndRun(ModuleDescription const& iDesc) {
void
RandomNumberGeneratorService::preModuleBeginLumi(ModuleDescription const& iDesc){
push(iDesc.moduleLabel());

if (currentEngine_ != engineMap_.end()) {
engineStateStack_.push_back(currentEngine_->second->put());
}
}

void
RandomNumberGeneratorService::postModuleBeginLumi(ModuleDescription const& iDesc) {
if (currentEngine_ != engineMap_.end()) {
if (engineStateStack_.back() != currentEngine_->second->put()) {
throw edm::Exception(edm::errors::LogicError)
<< "It is illegal to generate random numbers during beginLumi because \n"
"that makes it very difficult to reproduce the processing of individual\n"
"events. Random numbers were generated in beginLumi in the module with\n"
"class name \"" << iDesc.moduleName() << "\"\n"
"and module label \"" << iDesc.moduleLabel() << "\"\n";
}
engineStateStack_.pop_back();
}
pop();
}

Expand Down

0 comments on commit 3c87b90

Please sign in to comment.