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
!1391
LHCbMath: add summation operators for WStatEntity (
@ibelyaev
)
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
LHCbMath: add summation operators for WStatEntity (
@ibelyaev
)
cherry-pick-6c28ea97
into
master
Overview
1
Commits
1
Pipelines
0
Changes
2
Merged
Marco Cattaneo
requested to merge
cherry-pick-6c28ea97
into
master
6 years ago
Overview
1
Commits
1
Pipelines
0
Changes
2
Expand
Cherry picked from
!1385 (merged)
on
run2-patches
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
e7adaea2
1 commit,
6 years ago
2 files
+
46
−
21
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
Kernel/LHCbMath/LHCbMath/WStatEntity.h
+
22
−
8
Options
// $Id$
// ============================================================================
#ifndef ANALYSIS_WSTATENTITY_H
#define ANALYSIS_WSTATENTITY_H 1
@@ -26,8 +25,8 @@ namespace Gaudi
{
public:
// ======================================================================
/// empty constructor
WStatEntity
()
;
///
default
empty constructor
WStatEntity
()
=
default
;
/// constructor from StatEntity of values
WStatEntity
(
const
StatEntity
&
values
)
;
// ======================================================================
@@ -42,7 +41,12 @@ namespace Gaudi
(
const
double
value
,
const
double
weight
=
1
)
{
return
add
(
value
,
weight
)
;
}
// ======================================================================
WStatEntity
&
operator
+=
(
const
double
value
)
{
return
add
(
value
)
;
}
/// add the entry to the counter (with trivial weight)
WStatEntity
&
operator
+=
(
const
double
value
)
{
return
add
(
value
)
;
}
/// add another counter:
WStatEntity
&
operator
+=
(
const
WStatEntity
&
value
)
;
/// add another counter:
WStatEntity
&
operator
+=
(
const
StatEntity
&
value
)
;
// ======================================================================
// reset statistic
void
reset
()
;
@@ -80,22 +84,32 @@ namespace Gaudi
private
:
/// the basic statistic
// ======================================================================
/// sum_i weight_i*value_i
long
double
m_sum
;
// sum_i weight_i*value_i
long
double
m_sum
{
0
}
;
// sum_i weight_i*value_i
/// sum_i weight_i*value_i**2
long
double
m_sum2
;
// sum_i weight_i*value_i**2
long
double
m_sum2
{
0
}
;
// sum_i weight_i*value_i**2
// ======================================================================
private
:
/// helper statistics
// ======================================================================
/// statistic of values with non-zero weight
StatEntity
m_values
;
StatEntity
m_values
{
}
;
/// statistic of weights
StatEntity
m_weights
;
StatEntity
m_weights
{
}
;
// ======================================================================
};
// ========================================================================
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
s
,
const
WStatEntity
&
e
)
{
return
e
.
fillStream
(
s
)
;
}
// ========================================================================
/// sum two counters
inline
WStatEntity
operator
+
(
WStatEntity
a
,
const
WStatEntity
&
b
)
{
a
+=
b
;
return
a
;
}
/// sum two counters
inline
WStatEntity
operator
+
(
WStatEntity
a
,
const
StatEntity
&
b
)
{
a
+=
b
;
return
a
;
}
/// sum two counters
inline
WStatEntity
operator
+
(
const
StatEntity
&
a
,
const
WStatEntity
&
b
)
{
return
b
+
a
;
}
// ========================================================================
}
// The end of namespace Gaudi::Math
// ==========================================================================
}
// The end of namespace Gaudi
Loading