/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
GeneratorInterface/EvtGenInterface/plugins/myEvtRandomEngine.cc
38 строк
1 KB
Cms Build
Clang-Format
29 май 2019, 08:27
29 май 2019, 08:27
e1c03ad
Код
Авторство
О чём код?
//-------------------------------------------------------------------------- // // Module: myEvtRandomEngine.cpp // // Description: // this is an EvtRandomEngine // It is used as an interface of the random number engine provided // by the CMSSW Random Number Generator Service and EvtGen // Its "random()" method uses the "Flat()" method of the CLHEP::HepRandomEngine // provided by the Random Number Generator Service // // Modification history: // // Nello Nappi May 9, 2007 Module created // //------------------------------------------------------------------------ // #include "GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h" #include "CLHEP/Random/RandomEngine.h" #include "FWCore/Utilities/interface/EDMException.h" myEvtRandomEngine::myEvtRandomEngine(CLHEP::HepRandomEngine *xx) { the_engine = xx; } myEvtRandomEngine::~myEvtRandomEngine() {} double myEvtRandomEngine::random() { if (the_engine == nullptr) { throwNullPtr(); } return the_engine->flat(); } void myEvtRandomEngine::throwNullPtr() const { throw edm::Exception(edm::errors::LogicError) << "The EvtGen code attempted to a generate random number while\n" << "the engine pointer was null. This might mean that the code\n" << "was modified to generate a random number outside the event and\n" << "beginLuminosityBlock methods, which is not allowed.\n"; }