The Gaudi Framework
master (ce3a6a80)
Toggle main menu visibility
Loading...
Searching...
No Matches
RndmGen.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
//====================================================================
12
// Random RndmGen class definition
13
//--------------------------------------------------------------------
14
//
15
// Package : Gaudi/RndmGen ( The LHCb Offline System)
16
// Author : M.Frank
17
//====================================================================
18
#pragma once
19
20
#include <memory>
21
// Framework include files
22
#include <
GaudiKernel/IRndmGen.h
>
23
#include <
GaudiKernel/SmartIF.h
>
24
25
// Forward declarations
26
class
IRndmEngine
;
27
50
class
RndmGen
:
public
implements
<IRndmGen> {
51
52
protected
:
54
std::unique_ptr<IRndmGen::Param>
m_params
;
56
SmartIF<IRndmEngine>
m_engine
;
57
59
RndmGen
(
IInterface
* engine );
60
61
public
:
64
StatusCode
initialize
(
const
IRndmGen::Param
& par )
override
;
66
StatusCode
finalize
()
override
;
68
const
InterfaceID
&
type
()
const override
{
return
(
m_params
!= 0 ) ?
m_params
->type() : IID_IRndmFlat; }
70
long
ID
()
const override
{
return
long(
this
); }
72
const
IRndmGen::Param
*
parameters
()
const override
{
return
m_params
.get(); }
78
StatusCode
shootArray
( std::vector<double>& array,
long
howmany,
long
start )
const override
;
80
StatusCode
setSeeds
(
const
std::vector<long>&
seeds
)
override
;
82
StatusCode
seeds
( std::vector<long>&
seeds
)
const override
;
83
};
IRndmGen.h
SmartIF.h
IInterface
Definition of the basic interface.
Definition
IInterface.h:225
IRndmEngine
Definition of a interface for a generic random number generator giving randomly distributed numbers i...
Definition
IRndmEngine.h:25
IRndmGen::Param
Definition
IRndmGen.h:45
InterfaceID
Interface ID class.
Definition
IInterface.h:38
RndmGen::m_engine
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition
RndmGen.h:56
RndmGen::setSeeds
StatusCode setSeeds(const std::vector< long > &seeds) override
Allow to set new seeds.
Definition
RndmGen.cpp:52
RndmGen::ID
long ID() const override
Random number generator ID.
Definition
RndmGen.h:70
RndmGen::RndmGen
RndmGen(IInterface *engine)
Standard Constructor.
Definition
RndmGen.cpp:33
RndmGen::finalize
StatusCode finalize() override
Finalize the generator.
Definition
RndmGen.cpp:41
RndmGen::seeds
StatusCode seeds(std::vector< long > &seeds) const override
Allow to retrieve seeds.
Definition
RndmGen.cpp:58
RndmGen::m_params
std::unique_ptr< IRndmGen::Param > m_params
Generation parameters.
Definition
RndmGen.h:54
RndmGen::shootArray
StatusCode shootArray(std::vector< double > &array, long howmany, long start) const override
Multiple shots returning vector with random number according to specified distribution.
Definition
RndmGen.cpp:44
RndmGen::type
const InterfaceID & type() const override
Random number generator type.
Definition
RndmGen.h:68
RndmGen::initialize
StatusCode initialize(const IRndmGen::Param &par) override
IRndmGen implementation.
Definition
RndmGen.cpp:36
RndmGen::parameters
const IRndmGen::Param * parameters() const override
Access to random number generator parameters.
Definition
RndmGen.h:72
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition
SmartIF.h:28
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
implements< IRndmGen >::implements
implements()=default
GaudiSvc
src
RndmGenSvc
RndmGen.h
Generated on
for The Gaudi Framework by
1.17.0