| The Gaudi Framework v30r0 (c919700c)

- 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...
| ~Generator () override=default
| Standard Destructor. More...
StatusCode | initialize (const IRndmGen::Param &par) override
| Initialize the generator. More...
StatusCode | finalize () override
| Finalize the generator. More...
double | shoot () const override
| 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 299 of file HepRndmGenerators.cpp.

## Constructor & Destructor Documentation

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

Standard Constructor.

Definition at line 307 of file HepRndmGenerators.cpp.

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

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

Standard Destructor.

## Member Function Documentation

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

Finalize the generator.

Definition at line 333 of file HepRndmGenerators.cpp.

334 {
335 m_generator.reset();
336 return RndmGen::finalize();
337 }
HepRndm::Generator< Rndm::DefinedPdf >::m_generator
std::unique_ptr< RandGeneral > m_generator
Definition: HepRndmGenerators.cpp:302
std::unique_ptr::reset
T reset(T...args)
RndmGen::finalize
StatusCode finalize() override
Finalize the generator.
Definition: RndmGen.cpp:32

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

Initialize the generator.

Definition at line 311 of file HepRndmGenerators.cpp.

312 {
313 StatusCode status = RndmGen::initialize( par );
314 if ( status.isSuccess() ) {
315 try {
316 Rndm::DefinedPdf* specs = dynamic_cast<Rndm::DefinedPdf*>( m_params.get() );
317 if ( specs ) {
318 m_generator.reset( new RandGeneral( &specs->pdf()[0], specs->pdf().size(), specs->interpolation() ) );
319 BaseEngine* engine = dynamic_cast<BaseEngine*>( m_engine.get() );
320 if ( engine ) {
321 m_hepEngine = engine->hepEngine();
322 if ( m_hepEngine ) {
323 return StatusCode::SUCCESS;
324 }
325 }
326 }
327 } catch ( ... ) {
328 }
329 }
330 return StatusCode::FAILURE;
331 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
HepRndm::Generator< Rndm::DefinedPdf >::m_generator
std::unique_ptr< RandGeneral > m_generator
Definition: HepRndmGenerators.cpp:302
HepRndm::Generator< Rndm::DefinedPdf >::m_hepEngine
HepRandomEngine * m_hepEngine
Definition: HepRndmGenerators.cpp:303
Rndm::DefinedPdf::interpolation
long interpolation() const
Access interpolation type.
Definition: RndmGenerators.h:349
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
RndmGen::m_engine
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition: RndmGen.h:48
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:26
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:46
StatusCode::FAILURE
Definition: StatusCode.h:29
Rndm::DefinedPdf
Generate a random number Generator following generally distributed random values, given a user-define...
Definition: RndmGenerators.h:330
Rndm::DefinedPdf::pdf
std::vector< double > & pdf()
Access pdf.
Definition: RndmGenerators.h:347

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

Single shot.

Definition at line 339 of file HepRndmGenerators.cpp.

339 { return m_generator->shoot( m_hepEngine ); }
HepRndm::Generator< Rndm::DefinedPdf >::m_generator
std::unique_ptr< RandGeneral > m_generator
Definition: HepRndmGenerators.cpp:302
HepRndm::Generator< Rndm::DefinedPdf >::m_hepEngine
HepRandomEngine * m_hepEngine
Definition: HepRndmGenerators.cpp:303

## Member Data Documentation

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

Definition at line 302 of file HepRndmGenerators.cpp.

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

Definition at line 303 of file HepRndmGenerators.cpp.

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

- GaudiSvc/src/RndmGenSvc/HepRndmGenerators.cpp