Tabular/TankResponse.h
Go to the documentation of this file.
1 #ifndef _TabularTankResponseNS_TabularTankResponse_h_
2 #define _TabularTankResponseNS_TabularTankResponse_h_
3 
4 #include <tls/VTankResponse.h>
5 #include <vector>
6 #include <algorithm>
7 #include <boost/multi_array.hpp>
8 #include <utl/NormalDistribution.h>
9 
10 namespace utl {
11  class Branch;
12 }
13 
14 namespace TabularTankResponseNS {
15 
25  public:
26 
27  static TankResponse& GetInstance(const utl::Branch branch);
28 
29  virtual
30  double
31  PDF(const double signal,
32  const double theta,
33  const double r,
34  const ulong muons) const;
35 
36  virtual
37  double
38  CDF(const double threshold,
39  const double theta,
40  const double r,
41  const ulong muons) const;
42 
43  virtual
44  double
45  Mean(const double theta,
46  const double r,
47  const ulong muons) const;
48 
49  virtual
50  double
51  StDev(const double theta,
52  const double r,
53  const ulong muons) const;
54 
55  virtual double GetThetaMin() const { return fX; }
56  virtual double GetThetaMax() const { return fX+fDX; }
57 
58  virtual double GetRadiusMin() const { return pow(10,fY); }
59  virtual double GetRadiusMax() const { return pow(10,fY+fDY); }
60 
61  private:
63  TankResponse(const utl::Branch branch);
64 
65  virtual ~TankResponse() {}
67 
68  private:
69 
70  inline
71  double
72  EvaluateCdf(const std::vector<double>& v, const double signal, const double mean, const double sigma)
73  const
74  {
75  if (signal <= 0)
76  return 0.0;
77  if (signal >= fDS*(v.size()-2))
78  return utl::NormalCDF(signal, mean, sigma);
79  double z = signal/fDS;
80  const size_t i = static_cast<size_t>(z);
81  z -= i;
82  return (1.0-z)*v[i] + z*v[i+1];
83  }
84 
85  size_t fNX;
86  double fX, fDX;
87  size_t fNY;
88  double fY, fDY;
89  double fDS;
90  boost::multi_array<double, 2> fMean;
91  boost::multi_array<double, 2> fSigma;
92  boost::multi_array<std::vector<double>, 3> fCdf;
93  double fSmooth;
94  };
95 
96 } // NS TabularTankResponseNS
97 
98 #endif
virtual double StDev(const double theta, const double r, const ulong muons) const
Standard deviation of signal, given fixed number of muons.
virtual double PDF(const double signal, const double theta, const double r, const ulong muons) const
PDF of signal, given a fixed number of muons.
unsigned long ulong
Definition: VTankResponse.h:28
virtual double CDF(const double threshold, const double theta, const double r, const ulong muons) const
Probability of signal begin smaller than smax, given a fixed number of muons.
TankResponse & operator=(const TankResponse &)
double pow(const double x, const unsigned int i)
double NormalCDF(const double x)
virtual double GetThetaMax() const
Largest zenith angle at which the tank response is defined.
Class representing a document branch.
Definition: Branch.h:107
virtual double GetRadiusMin() const
Smallest radial distance at which the tank response is defined.
Interface class for coupling different tank response calculations into the reconstruction code...
Definition: VTankResponse.h:26
boost::multi_array< std::vector< double >, 3 > fCdf
boost::multi_array< double, 2 > fSigma
virtual double Mean(const double theta, const double r, const ulong muons) const
Average signal, given fixed number of muons.
if(signal >=fDS *(v.size()-2)) return utl double z
virtual double GetRadiusMax() const
Largest radial distance at which the tank response is defined.
boost::multi_array< double, 2 > fMean
virtual double GetThetaMin() const
Smallest zenith angle at which the tank response is defined.

, generated on Tue Sep 26 2023.