Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LHCb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LHCb
LHCb
Merge requests
!2794
Modernize deterministic mixer code
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Modernize deterministic mixer code
modernize-mixer
into
master
Overview
26
Commits
5
Pipelines
16
Changes
10
Merged
Gerhard Raven
requested to merge
modernize-mixer
into
master
4 years ago
Overview
23
Commits
5
Pipelines
16
Changes
10
Expand
replace uint32_t state and free functions with a small struct
define a single overload set for mixing
be paranoid about implicit conversions of the 'extra' state
use the above mentioned struct everywhere, and remove copies of the code
add a unit test (which contains a copy of the original code to verify the results are the same)
replace use of
boost::integer_traits
with
std::numeric_limits
Edited
4 years ago
by
Gerhard Raven
0
0
Merge request reports
Compare
master
version 15
71e19e3f
4 years ago
version 14
dc3a3248
4 years ago
version 13
363f65e1
4 years ago
version 12
9eb70134
4 years ago
version 11
f5389223
4 years ago
version 10
02e5eb9c
4 years ago
version 9
abed7902
4 years ago
version 8
a2bab979
4 years ago
version 7
afa02aea
4 years ago
version 6
a3d106fb
4 years ago
version 5
a6bc2758
4 years ago
version 4
28d10c8a
4 years ago
version 3
ff6f9700
4 years ago
version 2
f8765a37
4 years ago
version 1
b304e8f4
4 years ago
master (base)
and
latest version
latest version
eec794df
5 commits,
4 years ago
version 15
71e19e3f
5 commits,
4 years ago
version 14
dc3a3248
4 commits,
4 years ago
version 13
363f65e1
4 commits,
4 years ago
version 12
9eb70134
4 commits,
4 years ago
version 11
f5389223
4 commits,
4 years ago
version 10
02e5eb9c
4 commits,
4 years ago
version 9
abed7902
4 commits,
4 years ago
version 8
a2bab979
4 commits,
4 years ago
version 7
afa02aea
3 commits,
4 years ago
version 6
a3d106fb
2 commits,
4 years ago
version 5
a6bc2758
2 commits,
4 years ago
version 4
28d10c8a
2 commits,
4 years ago
version 3
ff6f9700
2 commits,
4 years ago
version 2
f8765a37
2 commits,
4 years ago
version 1
b304e8f4
1 commit,
4 years ago
10 files
+
237
−
143
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
10
Search (e.g. *.vue) (Ctrl+P)
Kernel/LHCbAlgs/src/DeterministicPrescaler.cpp
+
5
−
10
Options
@@ -8,19 +8,14 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
// Gaudi
#include
"GaudiAlg/FilterPredicate.h"
// from LHCb core
#include
"Event/ODIN.h"
// STL
#include
"GaudiAlg/FilterPredicate.h"
#include
"LHCbMath/DeterministicMixer.h"
#include
<cmath>
#include
<cstdint>
#include
<limits>
#include
<string>
#include
"DeterministicPrescalerGenerator.h"
/** @class DeterministicPrescaler DeterministicPrescaler.cpp
*
* @brief Return a positive decision for a configurable fraction of executions.
@@ -51,7 +46,7 @@ public:
bool
operator
()(
const
LHCb
::
ODIN
&
odin
)
const
override
{
auto
accept
=
[
&
](
const
LHCb
::
ODIN
&
odin
)
{
auto
x
=
mix64
(
mix32
(
mix64
(
m_initial
,
odin
.
gpsTime
()
)
,
odin
.
runNumber
()
)
,
odin
.
eventNumber
()
);
auto
x
=
LHCb
::
DeterministicMixer
{
m_initial
}(
odin
.
gpsTime
(),
odin
.
runNumber
(),
odin
.
eventNumber
()
)
.
state
;
if
(
msgLevel
(
MSG
::
DEBUG
)
)
debug
()
<<
" gpsTime: "
<<
odin
.
gpsTime
()
<<
" run#: "
<<
odin
.
runNumber
()
<<
" evt#: "
<<
odin
.
eventNumber
()
<<
" --> "
<<
x
<<
endmsg
;
@@ -72,12 +67,12 @@ private:
throw
GaudiException
(
"Required property SeedName is empty"
,
name
(),
StatusCode
::
FAILURE
);
}
m_initial
=
mixString
(
m_seed_name
.
size
(),
m_seed_name
)
;
m_initial
=
LHCb
::
DeterministicMixer
{
m_seed_name
}
;
},
"String used to seed pseudo-random number generation"
};
/// initial seed unique to this instance (computed from the name)
std
::
uint32_t
m_initial
{
0
};
LHCb
::
DeterministicMixer
m_initial
{
0
};
/// integer representation of the above
std
::
uint32_t
m_acc
{
std
::
numeric_limits
<
uint32_t
>::
max
()};
Loading