| The Gaudi Framework v32r1 (f65d50dc)

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...
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...
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...

## 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...

## Detailed Description

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

Definition at line 284 of file HepRndmGenerators.cpp.

## Constructor & Destructor Documentation

## ◆ Generator()

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

Standard Constructor.

Definition at line 291 of file HepRndmGenerators.cpp.

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

## Member Function Documentation

## ◆ finalize()

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

Finalize the generator.

Definition at line 311 of file HepRndmGenerators.cpp.

311 {
312 m_generator.reset();
313 return RndmGen::finalize();
314 }
HepRndm::Generator< Rndm::DefinedPdf >::m_generator
std::unique_ptr< RandGeneral > m_generator
Definition: HepRndmGenerators.cpp:286
std::unique_ptr::reset
T reset(T... args)
RndmGen::finalize
StatusCode finalize() override
Finalize the generator.
Definition: RndmGen.cpp:31

## ◆ initialize()

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

Initialize the generator.

Definition at line 293 of file HepRndmGenerators.cpp.

293 {
294 StatusCode status = RndmGen::initialize( par );
295 if ( status.isSuccess() ) {
296 try {
297 Rndm::DefinedPdf* specs = dynamic_cast<Rndm::DefinedPdf*>( m_params.get() );
298 if ( specs ) {
299 m_generator.reset( new RandGeneral( &specs->pdf()[0], specs->pdf().size(), specs->interpolation() ) );
300 BaseEngine* engine = dynamic_cast<BaseEngine*>( m_engine.get() );
301 if ( engine ) {
302 m_hepEngine = engine->hepEngine();
303 if ( m_hepEngine ) { return StatusCode::SUCCESS; }
304 }
305 }
306 } catch ( ... ) {}
307 }
308 return StatusCode::FAILURE;
309 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
HepRndm::Generator< Rndm::DefinedPdf >::m_generator
std::unique_ptr< RandGeneral > m_generator
Definition: HepRndmGenerators.cpp:286
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
HepRndm::Generator< Rndm::DefinedPdf >::m_hepEngine
HepRandomEngine * m_hepEngine
Definition: HepRndmGenerators.cpp:287
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:465
RndmGen::m_engine
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition: RndmGen.h:47
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
RndmGen::initialize
StatusCode initialize(const IRndmGen::Param &par) override
IRndmGen implementation.
Definition: RndmGen.cpp:26
Rndm::DefinedPdf::interpolation
long interpolation() const
Access interpolation type.
Definition: RndmGenerators.h:305
std::unique_ptr::reset
T reset(T... args)
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
std::unique_ptr::get
T get(T... args)
std::vector::size
T size(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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:291
Rndm::DefinedPdf::pdf
std::vector< double > & pdf()
Access pdf.
Definition: RndmGenerators.h:303

## ◆ shoot()

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

Single shot.

Definition at line 316 of file HepRndmGenerators.cpp.

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

## Member Data Documentation

## ◆ m_generator

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

Definition at line 286 of file HepRndmGenerators.cpp.

## ◆ m_hepEngine

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

Definition at line 287 of file HepRndmGenerators.cpp.

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

- GaudiSvc/src/RndmGenSvc/HepRndmGenerators.cpp