CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
CMS_SHERPA_RNG Class Reference
Inheritance diagram for CMS_SHERPA_RNG:

Public Member Functions

 CMS_SHERPA_RNG ()
 
void setRandomEngine (CLHEP::HepRandomEngine *v)
 

Private Member Functions

double Get () override
 

Private Attributes

CLHEP::HepRandomEngine * randomEngine
 

Detailed Description

Definition at line 74 of file SherpaHadronizer.cc.

Constructor & Destructor Documentation

CMS_SHERPA_RNG::CMS_SHERPA_RNG ( )
inline

Definition at line 77 of file SherpaHadronizer.cc.

References gather_cfg::cout, and setRandomEngine().

77  : randomEngine(nullptr) {
78  std::cout << "Use stored reference for the external RNG" << std::endl;
79  setRandomEngine(GetExternalEngine());
80  }
CLHEP::HepRandomEngine * randomEngine
void setRandomEngine(CLHEP::HepRandomEngine *v)
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

double CMS_SHERPA_RNG::Get ( )
overrideprivate

Definition at line 309 of file SherpaHadronizer.cc.

References edm::hlt::Exception, edm::errors::LogicError, and randomEngine.

309  {
310  if(randomEngine == nullptr) {
312  << "The Sherpa code attempted to a generate random number while\n"
313  << "the engine pointer was null. This might mean that the code\n"
314  << "was modified to generate a random number outside the event and\n"
315  << "beginLuminosityBlock methods, which is not allowed.\n";
316  }
317  return randomEngine->flat();
318 
319 }
CLHEP::HepRandomEngine * randomEngine
void CMS_SHERPA_RNG::setRandomEngine ( CLHEP::HepRandomEngine *  v)
inline

Definition at line 81 of file SherpaHadronizer.cc.

References randomEngine, and findQualityFiles::v.

Referenced by CMS_SHERPA_RNG(), and SherpaHadronizer::doSetRandomEngine().

81 { randomEngine = v; }
CLHEP::HepRandomEngine * randomEngine

Member Data Documentation

CLHEP::HepRandomEngine* CMS_SHERPA_RNG::randomEngine
private

Definition at line 85 of file SherpaHadronizer.cc.

Referenced by Get(), and setRandomEngine().