AachenTable.h
Go to the documentation of this file.
1 #ifndef _sdet_AachenTable_h_
2 #define _sdet_AachenTable_h_
3 
4 #include <vector>
5 #include <string>
6 #include <algorithm>
7 #include <cmath>
8 
9 #include "TabulatedPDF.h"
10 
11 class AachenTable {
12 
13 public:
14  AachenTable();
15  AachenTable(const std::string& fileName);
16 
17  ~AachenTable();
18 
19 public:
20 
21  void OpenFile(const std::string& fileName);
22 
23  double PDF(double signal, double theta, int nmu) const;
24 
25  double CDF(double signalmin, double theta, int nmu) const;
26 
27  double Moment(double theta, int nmu, int order) const;
28 
29  double GetFittedMean(double theta, int nmu) const;
30 
31  double GetFittedSigma(double theta, int nmu) const;
32 
33  inline
34  int GetTableLimit(){return 10;}
35 
36  inline
37  int GetThetaMinDeg(){return 60;} // warning, in degree!
38 
39  inline
40  int GetThetaMaxDeg(){return 88;} // warning, in degree!
41 
42 private:
43 
44  class TableItem {
45  public :
46  double theta;
47  double mean[9];
48  double parMean;
49  double parSigma[2];
50  private :
52  public :
53  operator double() const { return theta; } // TableItem can be casted to double, this makes sorting possible
54 
55  inline
56  tls::TabulatedPDF& GetTPF(int nmu){ return tpf[nmu-1]; }
57  inline
58  const tls::TabulatedPDF& GetTPF(int nmu) const { return tpf[nmu-1]; }
59 
60  inline
61  double& GetMean(int nmu){ return mean[nmu-1]; }
62  inline
63  const double& GetMean(int nmu) const { return mean[nmu-1]; }
64 
65  inline
66  double GetFittedMean(int nmu) const { return parMean*nmu; }
67  inline
68  double GetFittedSigma(int nmu) const { return std::sqrt(parSigma[0]+parSigma[1]*nmu); }
69  };
70 
71  typedef std::vector< TableItem > InternalTable;
73 
74  inline
75  const InternalTable::const_iterator UpperLimit(double theta) const
76  { return std::upper_bound(fTable.begin(),fTable.end(),theta); }
77 };
78 
79 #endif
tls::TabulatedPDF & GetTPF(int nmu)
Definition: AachenTable.h:56
tls::TabulatedPDF tpf[9]
Definition: AachenTable.h:51
double GetFittedSigma(double theta, int nmu) const
Definition: AachenTable.cc:230
const InternalTable::const_iterator UpperLimit(double theta) const
Definition: AachenTable.h:75
int GetThetaMinDeg()
Definition: AachenTable.h:37
int GetThetaMaxDeg()
Definition: AachenTable.h:40
double & GetMean(int nmu)
Definition: AachenTable.h:61
double GetFittedMean(int nmu) const
Definition: AachenTable.h:66
std::vector< TableItem > InternalTable
Definition: AachenTable.h:71
const double & GetMean(int nmu) const
Definition: AachenTable.h:63
double GetFittedMean(double theta, int nmu) const
Definition: AachenTable.cc:211
int GetTableLimit()
Definition: AachenTable.h:34
double PDF(double signal, double theta, int nmu) const
Definition: AachenTable.cc:148
InternalTable fTable
Definition: AachenTable.h:72
const tls::TabulatedPDF & GetTPF(int nmu) const
Definition: AachenTable.h:58
void OpenFile(const std::string &fileName)
Definition: AachenTable.cc:33
double GetFittedSigma(int nmu) const
Definition: AachenTable.h:68
double CDF(double signalmin, double theta, int nmu) const
Definition: AachenTable.cc:172
double Moment(double theta, int nmu, int order) const
Definition: AachenTable.cc:192

, generated on Tue Sep 26 2023.