Belle II Software development
BkgNeutronWeight.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <vector>
12
13namespace Belle2 {
18
23
24 public:
25
28
30 double getWeight(double ke);
31
32 private:
33
35 BkgNeutronWeight(void);
36
38 void addPoint(double, double);
39
41 void doSpline();
42
44 int m_n;
45
47 std::vector<double> m_x;
48
50 std::vector<double> m_y;
51
53 std::vector<double> m_b;
54
56 std::vector<double> m_c;
57
59 std::vector<double> m_d;
60
63
64 };
65
67} // end of namespace Belle2
std::vector< double > m_b
Vector of first derivatives in spline fit (calculated)
std::vector< double > m_c
Vector of second derivatives in spline fit (calculated)
int m_n
Number of tabulated points.
std::vector< double > m_y
Vector of tabulated y coordinates (weighting factors)
std::vector< double > m_d
Vector of third derivatives in spline fit (calculated)
std::vector< double > m_x
Vector of tabulated x coordinates (logarithm of kinetic energy)
double getWeight(double ke)
Get weighting factor to convert a neutron to its 1-MeV equivalent.
void addPoint(double, double)
Function to add one (x,y) data point to the spline table.
static BkgNeutronWeight * m_Instance
static pointer to the singleton instance of this class
static BkgNeutronWeight & getInstance()
Return a reference to the singleton BkgNeutronWeight instance.
void doSpline()
Function to calculate the cubic spline derivatives.
BkgNeutronWeight(void)
Constructor is private for this singleton.
Abstract base class for different kinds of events.