Belle II Software  release-05-01-25
BkgNeutronWeight.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributor: Leo Piilonen *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef BKGNEUTRONWEIGHT_H
12 #define BKGNEUTRONWEIGHT_H
13 
14 #include <vector>
15 
16 namespace Belle2 {
25  class BkgNeutronWeight {
26 
27  public:
28 
30  static BkgNeutronWeight& getInstance();
31 
33  double getWeight(double ke);
34 
35  private:
36 
38  BkgNeutronWeight(void);
39 
41  void addPoint(double, double);
42 
44  void doSpline();
45 
47  int m_n;
48 
50  std::vector<double> m_x;
51 
53  std::vector<double> m_y;
54 
56  std::vector<double> m_b;
57 
59  std::vector<double> m_c;
60 
62  std::vector<double> m_d;
63 
66 
67  };
68 
70 } // end of namespace Belle2
71 
72 #endif // BKGNEUTRONWEIGHT_H
Belle2::BkgNeutronWeight::BkgNeutronWeight
BkgNeutronWeight(void)
Constructor is private for this singleton.
Definition: BkgNeutronWeight.cc:53
Belle2::BkgNeutronWeight::m_b
std::vector< double > m_b
Vector of first derivatives in spline fit (calculated)
Definition: BkgNeutronWeight.h:64
Belle2::BkgNeutronWeight::doSpline
void doSpline()
Function to calculate the cubic spline derivatives.
Definition: BkgNeutronWeight.cc:1448
Belle2::BkgNeutronWeight::m_n
int m_n
Number of tabulated points.
Definition: BkgNeutronWeight.h:55
Belle2::BkgNeutronWeight::addPoint
void addPoint(double, double)
Function to add one (x,y) data point to the spline table.
Definition: BkgNeutronWeight.cc:1439
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::BkgNeutronWeight::m_c
std::vector< double > m_c
Vector of second derivatives in spline fit (calculated)
Definition: BkgNeutronWeight.h:67
Belle2::BkgNeutronWeight::getInstance
static BkgNeutronWeight & getInstance()
Return a reference to the singleton BkgNeutronWeight instance.
Definition: BkgNeutronWeight.cc:30
Belle2::BkgNeutronWeight::m_Instance
static BkgNeutronWeight * m_Instance
static pointer to the singleton instance of this class
Definition: BkgNeutronWeight.h:73
Belle2::BkgNeutronWeight::m_d
std::vector< double > m_d
Vector of third derivatives in spline fit (calculated)
Definition: BkgNeutronWeight.h:70
Belle2::BkgNeutronWeight::getWeight
double getWeight(double ke)
Get weighting factor to convert a neutron to its 1-MeV equivalent.
Definition: BkgNeutronWeight.cc:36
Belle2::BkgNeutronWeight
The class to get the weighting factor for a 1-MeV-equivalent neutron flux on silicon.
Definition: BkgNeutronWeight.h:33
Belle2::BkgNeutronWeight::m_y
std::vector< double > m_y
Vector of tabulated y coordinates (weighting factors)
Definition: BkgNeutronWeight.h:61
Belle2::BkgNeutronWeight::m_x
std::vector< double > m_x
Vector of tabulated x coordinates (logarithm of kinetic energy)
Definition: BkgNeutronWeight.h:58