CMS 3D CMS Logo

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 82 of file SherpaHadronizer.cc.

Constructor & Destructor Documentation

CMS_SHERPA_RNG::CMS_SHERPA_RNG ( )
inline

Definition at line 85 of file SherpaHadronizer.cc.

References gen::BaseHadronizer::setRandomEngine().

85  : randomEngine(nullptr) {
86  edm::LogVerbatim("SherpaHadronizer") << "Use stored reference for the external RNG";
87  setRandomEngine(GetExternalEngine());
88  }
CLHEP::HepRandomEngine * randomEngine
void setRandomEngine(CLHEP::HepRandomEngine *v)

Member Function Documentation

double CMS_SHERPA_RNG::Get ( )
overrideprivate

Definition at line 357 of file SherpaHadronizer.cc.

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

357  {
358  if(randomEngine == nullptr) {
360  << "The Sherpa code attempted to a generate random number while\n"
361  << "the engine pointer was null. This might mean that the code\n"
362  << "was modified to generate a random number outside the event and\n"
363  << "beginLuminosityBlock methods, which is not allowed.\n";
364  }
365  return randomEngine->flat();
366 
367 }
CLHEP::HepRandomEngine * randomEngine
void CMS_SHERPA_RNG::setRandomEngine ( CLHEP::HepRandomEngine *  v)
inline

Definition at line 89 of file SherpaHadronizer.cc.

References randomEngine, and findQualityFiles::v.

Referenced by SherpaHadronizer::doSetRandomEngine().

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

Member Data Documentation

CLHEP::HepRandomEngine* CMS_SHERPA_RNG::randomEngine
private

Definition at line 93 of file SherpaHadronizer.cc.