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 40 of file myEvtRandomEngine.h.

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

Definition at line 26 of file myEvtRandomEngine.cc.

References the_engine, and throwNullPtr().

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

Definition at line 38 of file myEvtRandomEngine.h.

References findQualityFiles::v.

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

Definition at line 34 of file myEvtRandomEngine.cc.

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

Referenced by random().

34  {
36  << "The EvtGen code attempted to a generate random number while\n"
37  << "the engine pointer was null. This might mean that the code\n"
38  << "was modified to generate a random number outside the event and\n"
39  << "beginLuminosityBlock methods, which is not allowed.\n";
40 }

Member Data Documentation

CLHEP::HepRandomEngine* myEvtRandomEngine::the_engine
private

Definition at line 46 of file myEvtRandomEngine.h.

Referenced by myEvtRandomEngine(), and random().