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 ( CLHEP::HepRandomEngine *  xx)

Definition at line 22 of file myEvtRandomEngine.cc.

References the_engine, and geometryCSVtoXML::xx.

22 { the_engine = xx; }
CLHEP::HepRandomEngine * the_engine
myEvtRandomEngine::~myEvtRandomEngine ( )
override

Definition at line 24 of file myEvtRandomEngine.cc.

24 {}

Member Function Documentation

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

Definition at line 37 of file myEvtRandomEngine.h.

37 { return the_engine; }
CLHEP::HepRandomEngine * the_engine
double myEvtRandomEngine::random ( )
override

Definition at line 26 of file myEvtRandomEngine.cc.

References the_engine, and throwNullPtr().

26  {
27  if (the_engine == nullptr) {
28  throwNullPtr();
29  }
30  return the_engine->flat();
31 }
CLHEP::HepRandomEngine * the_engine
void throwNullPtr() const
void myEvtRandomEngine::setRandomEngine ( CLHEP::HepRandomEngine *  v)
inline

Definition at line 35 of file myEvtRandomEngine.h.

References findQualityFiles::v.

35 { the_engine = v; }
CLHEP::HepRandomEngine * the_engine
void myEvtRandomEngine::throwNullPtr ( ) const
private

Definition at line 33 of file myEvtRandomEngine.cc.

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

Referenced by random().

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 }

Member Data Documentation

CLHEP::HepRandomEngine* myEvtRandomEngine::the_engine
private

Definition at line 42 of file myEvtRandomEngine.h.

Referenced by myEvtRandomEngine(), and random().