HepRndm::Generator< Rndm::DefinedPdf > Class Template Reference
Inheritance diagram for HepRndm::Generator< Rndm::DefinedPdf >:
Collaboration diagram for HepRndm::Generator< Rndm::DefinedPdf >:

Public Member Functions

 Generator (IInterface *engine)
 Standard Constructor. More...
 
virtual ~Generator ()
 Standard Destructor. More...
 
virtual StatusCode initialize (const IRndmGen::Param &par)
 Initialize the generator. More...
 
virtual StatusCode finalize ()
 Finalize the generator. More...
 
virtual double shoot () const
 Single shot. More...
 
- Public Member Functions inherited from RndmGen
virtual const InterfaceIDtype () const
 Random number generator type. More...
 
virtual long ID () const
 Random number generator ID. More...
 
virtual const IRndmGen::Paramparameters () const
 Access to random number generator parameters. More...
 
virtual StatusCode shootArray (std::vector< double > &array, long howmany, long start) const
 Multiple shots returning vector with random number according to specified distribution. More...
 
- Public Member Functions inherited from extend_interfaces1< IRndmGen >
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IRndmGen
 DeclareInterfaceID (IRndmGen, 2, 0)
 InterfaceID. More...
 
virtual ~IRndmGen ()
 Virtual destructor. More...
 
 DeclareInterfaceID (IRndmGen, 2, 0)
 InterfaceID. More...
 
virtual ~IRndmGen ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IInterface
virtual void * i_cast (const InterfaceID &) const =0
 main cast function More...
 
virtual std::vector< std::string > getInterfaceNames () const =0
 Returns a vector of strings containing the names of all the implemented interfaces. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)=0
 Set the void** to the pointer to the requested interface of the instance. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
virtual void * i_cast (const InterfaceID &) const =0
 main cast function More...
 
virtual std::vector< std::string > getInterfaceNames () const =0
 Returns a vector of strings containing the names of all the implemented interfaces. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)=0
 Set the void** to the pointer to the requested interface of the instance. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 

Protected Attributes

RandGeneral * m_generator
 
HepRandomEngine * m_hepEngine
 
- Protected Attributes inherited from RndmGen
IRndmGen::Paramm_params
 Generation parameters. More...
 
IRndmEnginem_engine
 Hosting service: Access must always be possible. More...
 

Additional Inherited Members

- Public Types inherited from implements1< IRndmGen >
typedef implements1 base_class
 Typedef to this class. More...
 
typedef implements1 base_class
 Typedef to this class. More...
 
typedef extend_interfaces1< IRndmGenextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces1< IRndmGenextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces1< IRndmGen >
typedef IRndmGen::iid::iids::type ext_iids
 MPL set of interfaces extended by this one. More...
 
typedef IRndmGen::iid::iids::type ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IInterface
enum  Status {
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR,
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR
}
 Return status. More...
 
enum  Status {
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR,
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR
}
 Return status. More...
 
typedef Gaudi::InterfaceId< IInterface, 0, 0 > iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
typedef Gaudi::InterfaceId< IInterface, 0, 0 > iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 
- Protected Member Functions inherited from RndmGen
 RndmGen (IInterface *engine)
 Standard Constructor. More...
 
virtual ~RndmGen ()
 Standard Destructor. More...
 

Detailed Description

template<>
class HepRndm::Generator< Rndm::DefinedPdf >

Definition at line 339 of file HepRndmGenerators.cpp.

Constructor & Destructor Documentation

Standard Constructor.

Definition at line 345 of file HepRndmGenerators.cpp.

346  : RndmGen (engine), m_generator(0), m_hepEngine(0) {
347  }
RndmGen(IInterface *engine)
Standard Constructor.
Definition: RndmGen.cpp:22
virtual HepRndm::Generator< Rndm::DefinedPdf >::~Generator ( )
inlinevirtual

Standard Destructor.

Definition at line 349 of file HepRndmGenerators.cpp.

349  {
350  }

Member Function Documentation

virtual StatusCode HepRndm::Generator< Rndm::DefinedPdf >::finalize ( )
inlinevirtual

Finalize the generator.

Reimplemented from RndmGen.

Definition at line 376 of file HepRndmGenerators.cpp.

376  {
377  if ( m_generator ) delete m_generator;
378  m_generator = 0;
379  return RndmGen::finalize();
380  }
virtual StatusCode finalize()
Initialize the generator.
Definition: RndmGen.cpp:43
virtual StatusCode HepRndm::Generator< Rndm::DefinedPdf >::initialize ( const IRndmGen::Param par)
inlinevirtual

Initialize the generator.

Reimplemented from RndmGen.

Definition at line 352 of file HepRndmGenerators.cpp.

352  {
353  StatusCode status = RndmGen::initialize(par);
354  if ( status.isSuccess() ) {
355  try {
356  Rndm::DefinedPdf* specs = dynamic_cast<Rndm::DefinedPdf*>(m_params);
357  if ( 0 != specs ) {
358  m_generator = new RandGeneral( &specs->pdf()[0],
359  specs->pdf().size(),
360  specs->interpolation());
361  BaseEngine* engine = dynamic_cast<BaseEngine*>(m_engine);
362  if ( 0 != engine ) {
363  m_hepEngine = engine->hepEngine();
364  if ( 0 != m_hepEngine ) {
365  return StatusCode::SUCCESS;
366  }
367  }
368  }
369  }
370  catch (...) {
371  }
372  }
373  return StatusCode::FAILURE;
374  }
virtual StatusCode initialize(const IRndmGen::Param &par)
IRndmGen implementation.
Definition: RndmGen.cpp:37
IRndmGen::Param * m_params
Generation parameters.
Definition: RndmGen.h:43
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
long interpolation() const
Access interpolation type.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
IRndmEngine * m_engine
Hosting service: Access must always be possible.
Definition: RndmGen.h:45
Generate a random number Generator following generally distributed random values, given a user-define...
std::vector< double > & pdf()
Access pdf.
virtual double HepRndm::Generator< Rndm::DefinedPdf >::shoot ( ) const
inlinevirtual

Single shot.

Reimplemented from RndmGen.

Definition at line 382 of file HepRndmGenerators.cpp.

382  {
383  return m_generator->shoot(m_hepEngine);
384  }

Member Data Documentation

RandGeneral* HepRndm::Generator< Rndm::DefinedPdf >::m_generator
protected

Definition at line 341 of file HepRndmGenerators.cpp.

HepRandomEngine* HepRndm::Generator< Rndm::DefinedPdf >::m_hepEngine
protected

Definition at line 342 of file HepRndmGenerators.cpp.


The documentation for this class was generated from the following file: