CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual double random ()
 
void setRandomEngine (CLHEP::HepRandomEngine *v)
 
virtual ~myEvtRandomEngine ()
 

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.

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

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.

References the_engine.

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

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 the_engine, and 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 engine(), myEvtRandomEngine(), random(), and setRandomEngine().