Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
master (f31105fd)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
i
l
m
n
o
p
q
r
s
t
v
Enumerator
a
b
c
d
e
f
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Properties
Related Functions
:
a
b
c
d
e
g
h
i
m
o
p
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
b
c
e
f
g
h
i
l
m
n
o
p
r
s
t
u
z
Variables
a
b
c
d
e
g
h
i
m
o
p
q
r
s
t
v
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerations
Enumerator
c
e
f
p
u
v
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
RndmGen.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2024 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 implementation
13
//--------------------------------------------------------------------
14
//
15
// Package : Gaudi/RndmGen ( The LHCb Offline System)
16
// Author : M.Frank
17
// History :
18
// +---------+----------------------------------------------+--------+
19
// | Date | Comment | Who |
20
// +---------+----------------------------------------------+--------+
21
// | 21/11/99| Initial version. | MF |
22
// +---------+----------------------------------------------+--------+
23
//====================================================================
24
#define GAUDI_RANDOMGENSVC_RNDMGEN_CPP
25
26
#include "
RndmGen.h
"
27
#include <
GaudiKernel/IRndmEngine.h
>
28
#include <
GaudiKernel/ISvcLocator.h
>
29
#include <algorithm>
30
#include <cfloat>
31
33
RndmGen::RndmGen
(
IInterface
* engine ) : m_engine{ engine } {}
34
36
StatusCode
RndmGen::initialize
(
const
IRndmGen::Param
&
par
) {
37
m_params
.
reset
(
par
.clone() );
38
return
m_engine
?
StatusCode::SUCCESS
:
StatusCode::FAILURE
;
39
}
40
41
StatusCode
RndmGen::finalize
() {
return
StatusCode::SUCCESS
; }
42
44
StatusCode
RndmGen::shootArray
(
std::vector<double>
&
array
,
long
howmany,
long
start
)
const
{
45
if
( !
m_engine
)
return
StatusCode::FAILURE
;
46
array
.resize(
start
+ howmany );
47
std::generate_n
(
std::next
(
std::begin
(
array
),
start
), howmany, [&]() {
return
this->shoot(); } );
48
return
StatusCode::SUCCESS
;
49
}
RndmGen::finalize
StatusCode finalize() override
Finalize the generator.
Definition:
RndmGen.cpp:41
std::generate_n
T generate_n(T... args)
std::vector< double >
RndmGen.h
IOTest.start
start
Definition:
IOTest.py:110
std::unique_ptr::reset
T reset(T... args)
RndmGen::RndmGen
RndmGen(IInterface *engine)
Standard Constructor.
Definition:
RndmGen.cpp:33
compareOutputFiles.par
par
Definition:
compareOutputFiles.py:477
IRndmEngine.h
RndmGen::initialize
StatusCode initialize(const IRndmGen::Param &par) override
IRndmGen implementation
Definition:
RndmGen.cpp:36
StatusCode
Definition:
StatusCode.h:65
RndmGen::m_engine
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition:
RndmGen.h:57
IRndmGen::Param
Definition:
IRndmGen.h:49
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition:
StatusCode.h:100
Containers::array
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Definition:
KeyedObjectManager.h:37
std::begin
T begin(T... args)
IInterface
Definition:
IInterface.h:239
RndmGen::m_params
std::unique_ptr< IRndmGen::Param > m_params
Generation parameters.
Definition:
RndmGen.h:55
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition:
StatusCode.h:101
ISvcLocator.h
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
std::next
T next(T... args)
GaudiSvc
src
RndmGenSvc
RndmGen.cpp
Generated on Mon Apr 7 2025 16:26:25 for The Gaudi Framework by
1.8.18