| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes | List of all members
HepRndm::Generator< Rndm::DefinedPdf > Class Template Reference
Inheritance diagram for HepRndm::Generator< Rndm::DefinedPdf >:
[legend]
Collaboration diagram for HepRndm::Generator< Rndm::DefinedPdf >:
[legend]

## Public Member Functions
| Generator (IInterface *engine)
| Standard Constructor. More...
virtual | ~Generator ()=default
| 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
StatusCode | initialize (const IRndmGen::Param &par) override
| IRndmGen implementation. More...
StatusCode | finalize () override
| Finalize the generator. More...
const InterfaceID & | type () const override
| Random number generator type. More...
long | ID () const override
| Random number generator ID. More...
const IRndmGen::Param * | parameters () const override
| Access to random number generator parameters. More...
StatusCode | shootArray (std::vector< double > &array, long howmany, long start) const override
| Multiple shots returning vector with random number according to specified distribution. More...
Public Member Functions inherited from implements< IRndmGen >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| implements ()=default
| Default constructor. More...
| implements (const implements &)
| Copy constructor (zero the reference count) More...
implements & | operator= (const implements &)
| Assignment operator (do not touch the reference count). More...
| ~implements () override=default
| Virtual destructor. More...
unsigned long | addRef () override
| Reference Interface instance. More...
unsigned long | release () override
| Release Interface instance. More...
unsigned long | refCount () const override
| Current reference count. More...
Public Member Functions inherited from extend_interfaces< Interfaces...>
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Protected Attributes
std::unique_ptr< RandGeneral > | m_generator
HepRandomEngine * | m_hepEngine = nullptr
Protected Attributes inherited from RndmGen
std::unique_ptr< IRndmGen::Param > | m_params
| Generation parameters. More...
SmartIF< IRndmEngine > | m_engine
| Hosting service: Access must always be possible. More...
Protected Attributes inherited from implements< IRndmGen >
std::atomic_ulong | m_refCount
| Reference counter. More...

## Additional Inherited Members
Public Types inherited from implements< IRndmGen >
using | base_class = implements< Interfaces...>
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces...>
| Typedef to the base of this class. More...
using | iids = typename extend_interfaces_base::ext_iids
Public Types inherited from extend_interfaces< Interfaces...>
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
| take union of the ext_iids of all Interfaces... More...
Protected Member Functions inherited from RndmGen
| RndmGen (IInterface *engine)
| Standard Constructor. More...
| ~RndmGen () override=default
| Standard Destructor. More...

## Detailed Description

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

Definition at line 340 of file HepRndmGenerators.cpp.

## Constructor & Destructor Documentation

HepRndm::Generator< Rndm::DefinedPdf >::Generator | ( | IInterface * | engine | ) |
| inline

Standard Constructor.

Definition at line 346 of file HepRndmGenerators.cpp.

347 : RndmGen (engine) {
348 }
RndmGen::RndmGen
RndmGen(IInterface *engine)
Standard Constructor.
Definition: RndmGen.cpp:23

virtual HepRndm::Generator< Rndm::DefinedPdf >::~Generator | ( |  | ) |
| virtual default

Standard Destructor.

## Member Function Documentation

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

Finalize the generator.

Definition at line 376 of file HepRndmGenerators.cpp.

376 {
377 m_generator.reset();
378 return RndmGen::finalize();
379 }
HepRndm::Generator< Rndm::DefinedPdf >::m_generator
std::unique_ptr< RandGeneral > m_generator
Definition: HepRndmGenerators.cpp:342
std::unique_ptr::reset
T reset(T...args)
RndmGen::finalize
StatusCode finalize() override
Finalize the generator.
Definition: RndmGen.cpp:33

virtual StatusCode HepRndm::Generator< Rndm::DefinedPdf >::initialize | ( | const IRndmGen::Param & | par | ) |
| inline virtual

Initialize the generator.

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.get());
357 if ( specs ) {
358 m_generator.reset( new RandGeneral( &specs->pdf()[0],
359 specs->pdf().size(),
360 specs->interpolation()) );
361 BaseEngine* engine = dynamic_cast<BaseEngine*>(m_engine.get());
362 if ( engine ) {
363 m_hepEngine = engine->hepEngine();
364 if ( m_hepEngine ) {
365 return StatusCode::SUCCESS;
366 }
367 }
368 }
369 }
370 catch (...) {
371 }
372 }
373 return StatusCode::FAILURE;
374 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
HepRndm::Generator< Rndm::DefinedPdf >::m_generator
std::unique_ptr< RandGeneral > m_generator
Definition: HepRndmGenerators.cpp:342
HepRndm::Generator< Rndm::DefinedPdf >::m_hepEngine
HepRandomEngine * m_hepEngine
Definition: HepRndmGenerators.cpp:343
Rndm::DefinedPdf::interpolation
long interpolation() const
Access interpolation type.
Definition: RndmGenerators.h:323
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
StatusCode::FAILURE
Definition: StatusCode.h:29
RndmGen::m_engine
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition: RndmGen.h:47
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
RndmGen::initialize
StatusCode initialize(const IRndmGen::Param &par) override
IRndmGen implementation.
Definition: RndmGen.cpp:28
std::unique_ptr::reset
T reset(T...args)
std::unique_ptr::get
T get(T...args)
std::vector::size
T size(T...args)
RndmGen::m_params
std::unique_ptr< IRndmGen::Param > m_params
Generation parameters.
Definition: RndmGen.h:45
Rndm::DefinedPdf
Generate a random number Generator following generally distributed random values, given a user-define...
Definition: RndmGenerators.h:306
Rndm::DefinedPdf::pdf
std::vector< double > & pdf()
Access pdf.
Definition: RndmGenerators.h:321

virtual double HepRndm::Generator< Rndm::DefinedPdf >::shoot | ( |  | ) | const
| inline virtual

Single shot.

Definition at line 381 of file HepRndmGenerators.cpp.

381 {
382 return m_generator->shoot(m_hepEngine);
383 }
HepRndm::Generator< Rndm::DefinedPdf >::m_generator
std::unique_ptr< RandGeneral > m_generator
Definition: HepRndmGenerators.cpp:342
HepRndm::Generator< Rndm::DefinedPdf >::m_hepEngine
HepRandomEngine * m_hepEngine
Definition: HepRndmGenerators.cpp:343

## Member Data Documentation

std::unique_ptr<RandGeneral> HepRndm::Generator< Rndm::DefinedPdf >::m_generator
| protected

Definition at line 342 of file HepRndmGenerators.cpp.

HepRandomEngine* HepRndm::Generator< Rndm::DefinedPdf >::m_hepEngine = nullptr
| protected

Definition at line 343 of file HepRndmGenerators.cpp.

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

- GaudiSvc/src/RndmGenSvc/HepRndmGenerators.cpp