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

Constructor & Destructor Documentation

◆ CMS_SHERPA_RNG()

CMS_SHERPA_RNG::CMS_SHERPA_RNG ( )
inline

Definition at line 77 of file SherpaHadronizer.cc.

77  : randomEngine(nullptr) {
78  edm::LogVerbatim("SherpaHadronizer") << "Use stored reference for the external RNG";
79  setRandomEngine(GetExternalEngine());
80  }

References setRandomEngine().

Member Function Documentation

◆ Get()

double CMS_SHERPA_RNG::Get ( )
overrideprivate

Definition at line 348 of file SherpaHadronizer.cc.

348  {
349  if (randomEngine == nullptr) {
350  throw edm::Exception(edm::errors::LogicError) << "The Sherpa code attempted to a generate random number while\n"
351  << "the engine pointer was null. This might mean that the code\n"
352  << "was modified to generate a random number outside the event and\n"
353  << "beginLuminosityBlock methods, which is not allowed.\n";
354  }
355  return randomEngine->flat();
356 }

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

◆ setRandomEngine()

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

Definition at line 81 of file SherpaHadronizer.cc.

81 { randomEngine = v; }

References randomEngine, and findQualityFiles::v.

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

Member Data Documentation

◆ randomEngine

CLHEP::HepRandomEngine* CMS_SHERPA_RNG::randomEngine
private

Definition at line 85 of file SherpaHadronizer.cc.

Referenced by Get(), and setRandomEngine().

edm::errors::LogicError
Definition: EDMException.h:37
findQualityFiles.v
v
Definition: findQualityFiles.py:179
CMS_SHERPA_RNG::randomEngine
CLHEP::HepRandomEngine * randomEngine
Definition: SherpaHadronizer.cc:85
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Exception
Definition: hltDiff.cc:245
CMS_SHERPA_RNG::setRandomEngine
void setRandomEngine(CLHEP::HepRandomEngine *v)
Definition: SherpaHadronizer.cc:81