CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
myEvtRandomEngine Class Reference

#include <myEvtRandomEngine.h>

Inheritance diagram for myEvtRandomEngine:

Public Member Functions

CLHEP::HepRandomEngine * engine () const
 
 myEvtRandomEngine (CLHEP::HepRandomEngine *xx)
 
double random () override
 
void setRandomEngine (CLHEP::HepRandomEngine *v)
 
 ~myEvtRandomEngine () override
 

Private Member Functions

void throwNullPtr () const
 

Private Attributes

CLHEP::HepRandomEngine * the_engine
 

Detailed Description

Definition at line 27 of file myEvtRandomEngine.h.

Constructor & Destructor Documentation

◆ myEvtRandomEngine()

myEvtRandomEngine::myEvtRandomEngine ( CLHEP::HepRandomEngine *  xx)

Definition at line 22 of file myEvtRandomEngine.cc.

22 { the_engine = xx; }

References the_engine, and geometryCSVtoXML::xx.

◆ ~myEvtRandomEngine()

myEvtRandomEngine::~myEvtRandomEngine ( )
override

Definition at line 24 of file myEvtRandomEngine.cc.

24 {}

Member Function Documentation

◆ engine()

CLHEP::HepRandomEngine* myEvtRandomEngine::engine ( ) const
inline

Definition at line 37 of file myEvtRandomEngine.h.

37 { return the_engine; }

References the_engine.

◆ random()

double myEvtRandomEngine::random ( )
override

Definition at line 26 of file myEvtRandomEngine.cc.

26  {
27  if (the_engine == nullptr) {
28  throwNullPtr();
29  }
30  return the_engine->flat();
31 }

References the_engine, and throwNullPtr().

◆ setRandomEngine()

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

Definition at line 35 of file myEvtRandomEngine.h.

35 { the_engine = v; }

References the_engine, and findQualityFiles::v.

◆ throwNullPtr()

void myEvtRandomEngine::throwNullPtr ( ) const
private

Definition at line 33 of file myEvtRandomEngine.cc.

33  {
34  throw edm::Exception(edm::errors::LogicError) << "The EvtGen code attempted to a generate random number while\n"
35  << "the engine pointer was null. This might mean that the code\n"
36  << "was modified to generate a random number outside the event and\n"
37  << "beginLuminosityBlock methods, which is not allowed.\n";
38 }

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

Referenced by random().

Member Data Documentation

◆ the_engine

CLHEP::HepRandomEngine* myEvtRandomEngine::the_engine
private

Definition at line 42 of file myEvtRandomEngine.h.

Referenced by engine(), myEvtRandomEngine(), random(), and setRandomEngine().

myEvtRandomEngine::the_engine
CLHEP::HepRandomEngine * the_engine
Definition: myEvtRandomEngine.h:42
edm::errors::LogicError
Definition: EDMException.h:37
findQualityFiles.v
v
Definition: findQualityFiles.py:179
myEvtRandomEngine::throwNullPtr
void throwNullPtr() const
Definition: myEvtRandomEngine.cc:33
Exception
Definition: hltDiff.cc:246
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19