Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
master (42b00024)
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
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
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
Macros
_
a
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
HiveNumbers.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 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
// Framework include files
12
#include "
HiveNumbers.h
"
13
#include <
GaudiKernel/GaudiException.h
>
14
#include <
GaudiKernel/IRndmGen.h
>
15
#include <
GaudiKernel/IRndmGenSvc.h
>
16
#include <
GaudiKernel/SmartIF.h
>
17
18
namespace
{
19
constexpr
double
HIVENUMBERS_BUFFER_SIZE = 1000;
20
}
21
22
HiveRndm::HiveNumbersMutex
HiveRndm::HiveNumbers::m_genMutex
;
23
24
// Standard constructor
25
HiveRndm::HiveNumbers::HiveNumbers
() : m_buffer_index( 0 ), m_buffer_size( HIVENUMBERS_BUFFER_SIZE ), m_generator( 0 ) {
26
m_buffer
.reserve(
m_buffer_size
);
27
}
28
29
// Copy constructor
30
HiveRndm::HiveNumbers::HiveNumbers
(
const
HiveRndm::HiveNumbers
& copy )
31
: m_buffer_index( 0 ), m_buffer_size( HIVENUMBERS_BUFFER_SIZE ), m_generator( copy.m_generator ) {
32
m_buffer
.reserve(
m_buffer_size
);
33
if
( 0 !=
m_generator
) {
m_generator
->
addRef
(); }
34
}
35
36
// Construct and initialize the generator
37
HiveRndm::HiveNumbers::HiveNumbers
(
const
SmartIF<IRndmGenSvc>
& svc,
const
IRndmGen::Param
&
par
)
38
: m_buffer_index( 0 ), m_buffer_size( HIVENUMBERS_BUFFER_SIZE ), m_generator( 0 ) {
39
m_buffer
.reserve(
m_buffer_size
);
40
StatusCode
status =
initialize
( svc,
par
);
41
if
( !status.
isSuccess
() ) {
throw
GaudiException
(
"Initialization failed !"
,
"HiveRndm::HiveNumbers"
, status ); }
42
}
43
44
// Standard destructor
45
HiveRndm::HiveNumbers::~HiveNumbers
() { finalize().ignore(); }
46
47
// Initialize the generator
48
StatusCode
HiveRndm::HiveNumbers::initialize
(
const
SmartIF<IRndmGenSvc>
& svc,
const
IRndmGen::Param
&
par
) {
49
if
( svc.
isValid
() && 0 == m_generator ) {
52
return
svc->generator(
par
, m_generator );
53
}
54
return
StatusCode::FAILURE
;
55
}
56
57
// Initialize the generator
58
StatusCode
HiveRndm::HiveNumbers::finalize
() {
59
if
( 0 != m_generator ) {
60
m_generator->finalize().
ignore
();
61
m_generator->release();
62
m_generator = 0;
63
}
64
return
StatusCode::SUCCESS
;
65
}
StatusCode::isSuccess
bool isSuccess() const
Definition:
StatusCode.h:315
HiveRndm::HiveNumbers::m_genMutex
static HiveNumbersMutex m_genMutex
Definition:
HiveNumbers.h:43
GaudiException.h
HiveRndm::HiveNumbers::initialize
virtual StatusCode initialize(const SmartIF< IRndmGenSvc > &svc, const IRndmGen::Param &par)
Initialization.
Definition:
HiveNumbers.cpp:48
GaudiException
Definition:
GaudiException.h:32
HiveRndm::HiveNumbers::~HiveNumbers
virtual ~HiveNumbers()
Standard destructor.
Definition:
HiveNumbers.cpp:45
IRndmGenSvc.h
HiveRndm::HiveNumbersMutex
tbb::spin_rw_mutex HiveNumbersMutex
Definition:
HiveNumbers.h:36
HiveNumbers.h
compareOutputFiles.par
par
Definition:
compareOutputFiles.py:477
HiveRndm::HiveNumbers::HiveNumbers
HiveNumbers()
Standard constructor.
Definition:
HiveNumbers.cpp:25
SmartIF.h
IRndmGen.h
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition:
SmartIF.h:72
HiveRndm::HiveNumbers::m_generator
IRndmGen * m_generator
Pointer to random number generator.
Definition:
HiveNumbers.h:47
StatusCode
Definition:
StatusCode.h:65
HiveRndm::HiveNumbers::m_buffer
std::vector< double > m_buffer
Definition:
HiveNumbers.h:42
IRndmGen::Param
Definition:
IRndmGen.h:49
SmartIF< IRndmGenSvc >
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition:
StatusCode.h:140
HiveRndm::HiveNumbers::m_buffer_size
const unsigned int m_buffer_size
Definition:
HiveNumbers.h:41
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition:
StatusCode.h:100
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition:
StatusCode.h:101
HiveRndm::HiveNumbers
Definition:
HiveNumbers.h:38
HiveRndm::HiveNumbers::finalize
virtual StatusCode finalize()
Finalization.
Definition:
HiveNumbers.cpp:58
IInterface::addRef
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
GaudiHive
src
HiveNumbers.cpp
Generated on Sat Jun 7 2025 08:03:59 for The Gaudi Framework by
1.8.18