BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
CumulativeValue.h
Go to the documentation of this file.
1
// ************************************************************************** //
2
//
3
// BornAgain: simulate and fit scattering at grazing incidence
4
//
5
//! @file Device/Data/CumulativeValue.h
6
//! @brief Defines class CumulativeValue.
7
//!
8
//! @homepage http://www.bornagainproject.org
9
//! @license GNU General Public License v3 or higher (see COPYING)
10
//! @copyright Forschungszentrum Jülich GmbH 2018
11
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12
//
13
// ************************************************************************** //
14
15
#ifndef BORNAGAIN_CORE_INTENSITY_CUMULATIVEVALUE_H
16
#define BORNAGAIN_CORE_INTENSITY_CUMULATIVEVALUE_H
17
18
//! The cumulative value with average and rms on-the-flight calculations.
19
//! @ingroup tools
20
21
class
CumulativeValue
22
{
23
public
:
24
CumulativeValue
() { clear(); }
25
26
void
clear();
27
void
setContent(
double
value) { m_sum = value; }
28
void
add(
double
value,
double
weight = 1.0);
29
30
int
getNumberOfEntries()
const
{
return
m_n_entries; }
31
double
getContent()
const
{
return
m_sum; }
32
double
getAverage()
const
{
return
m_average; }
33
double
getRMS()
const
;
34
35
private
:
36
int
m_n_entries;
37
double
m_sum;
38
double
m_average;
39
double
m_rms2;
// sum[ (x-x_aver)^2]/nentries
40
double
m_sum_of_weights;
41
};
42
43
bool
operator<(
const
CumulativeValue
& lhs,
const
CumulativeValue
& rhs);
44
bool
operator>(
const
CumulativeValue
& lhs,
const
CumulativeValue
& rhs);
45
46
#endif
// BORNAGAIN_CORE_INTENSITY_CUMULATIVEVALUE_H
CumulativeValue
The cumulative value with average and rms on-the-flight calculations.
Definition:
CumulativeValue.h:22
Device
Data
CumulativeValue.h
Generated by
1.9.1