CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
gen::P8RndmEngine Class Reference

#include <P8RndmEngine.h>

Inheritance diagram for gen::P8RndmEngine:

Public Member Functions

double flat () override
 
 P8RndmEngine ()
 
void setRandomEngine (CLHEP::HepRandomEngine *v)
 

Private Member Functions

void throwNullPtr () const
 

Private Attributes

CLHEP::HepRandomEngine * randomEngine_
 

Detailed Description

Description: Used to set an external random number engine in Pythia 8. Pythia 8 recognizes a class that has Pythia8::RndmEngine as a base class and a virtual flat method. If you pass a pointer to an object of this class to Pythia 8 it will use it to generate random numbers.

Independent of Pythia 8, one can set the CLHEP engine that this class uses in its flat method.

Author
W. David Dagenhart, created 26 November 2013

Definition at line 27 of file P8RndmEngine.h.

Constructor & Destructor Documentation

◆ P8RndmEngine()

gen::P8RndmEngine::P8RndmEngine ( )
inline

Definition at line 29 of file P8RndmEngine.h.

29 : randomEngine_(nullptr) {}
CLHEP::HepRandomEngine * randomEngine_
Definition: P8RndmEngine.h:39

Member Function Documentation

◆ flat()

double gen::P8RndmEngine::flat ( void  )
override

◆ setRandomEngine()

void gen::P8RndmEngine::setRandomEngine ( CLHEP::HepRandomEngine *  v)
inline

Definition at line 34 of file P8RndmEngine.h.

References randomEngine_, and gen::v.

Referenced by gen::Py8InterfaceBase::p8SetRandomEngine().

34 { randomEngine_ = v; }
double v[5][pyjets_maxn]
CLHEP::HepRandomEngine * randomEngine_
Definition: P8RndmEngine.h:39

◆ throwNullPtr()

void gen::P8RndmEngine::throwNullPtr ( ) const
private

Definition at line 14 of file P8RndmEngine.cc.

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

Referenced by flat().

14  {
15  throw edm::Exception(edm::errors::LogicError) << "The Pythia 8 code attempted to a generate random number while\n"
16  << "the engine pointer was null. This might mean that the code\n"
17  << "was modified to generate a random number outside the event and\n"
18  << "beginLuminosityBlock methods, which is not allowed.\n";
19  }

Member Data Documentation

◆ randomEngine_

CLHEP::HepRandomEngine* gen::P8RndmEngine::randomEngine_
private

Definition at line 39 of file P8RndmEngine.h.

Referenced by flat(), and setRandomEngine().