Tools/InclinedShowers/TankResponse/Simple/TankResponse.cc
Go to the documentation of this file.
1 #include "TankResponse.h"
2 
3 #include <tls/TankResponseUtilities.h>
4 
5 #include <utl/Reader.h>
6 #include <utl/Math.h>
7 #include <utl/NormalDistribution.h>
8 
9 using namespace SimpleTankResponseNS;
10 using namespace utl;
11 using namespace std;
12 using namespace tls;
13 
14 
16  fVerticalTankTrackLength(TankMeanTrackLength(0))
17 {
18  branch.GetChild("ParameterMean").GetData(fParMean);
19  branch.GetChild("ParameterSigma").GetData(fParSigma);
20 }
21 
22 
25 {
26  static TankResponse singleton(branch);
27  return singleton;
28 }
29 
30 
31 double
32 TankResponse::CDF(const double threshold,
33  const double theta,
34  const double /* r */,
35  const ulong muons)
36  const
37 {
38  double m, s;
39  CalculateAverageAndSigma(m, s, theta, muons);
40  return NormalCDF(threshold, m, s);
41 }
42 
43 
44 double
45 TankResponse::PDF(const double signal,
46  const double theta,
47  const double /* r */,
48  const ulong muons)
49  const
50 {
51  double m, s;
52  CalculateAverageAndSigma(m, s, theta, muons);
53  return NormalPDF(signal, m, s);
54 }
55 
56 
57 double
58 TankResponse::Mean(const double theta,
59  const double /* r */,
60  const ulong muons)
61  const
62 {
63  double m, s;
64  CalculateAverageAndSigma(m, s, theta, muons);
65  return m;
66 }
67 
68 
69 double
70 TankResponse::StDev(const double theta,
71  const double /* r */,
72  const ulong muons)
73  const
74 {
75  double m, s;
76  CalculateAverageAndSigma(m, s, theta, muons);
77  return s;
78 }
79 
80 
81 void
82 TankResponse::CalculateAverageAndSigma(double& mean, double& sigma,
83  const double theta, const ulong muons)
84  const
85 {
86  // signal of vertical muon := 1 VEM
87  // signal of inclined muon = signalVertical * averageTrackLength(theta)/averageTrackLength(0)
88  mean = TankMeanTrackLength(theta)/fVerticalTankTrackLength * muons;
89  const double nmuWithCut = muons < 10 ? muons : 10;
90  const double meanCorrection =
91  fParMean[0] + theta*(fParMean[1] + theta*(fParMean[3] + theta*fParMean[5])) +
92  nmuWithCut*(fParMean[2] + nmuWithCut*fParMean[4]);
93  mean *= (1 + meanCorrection);
94 
95  const double th = theta/degree;
96  const double trackMoment2 =
97  fParSigma[0] + th*(fParSigma[1] + th*(fParSigma[2] + th*(fParSigma[3] + th*fParSigma[4])));
98 
99  const double trackSigma2 = trackMoment2 - pow(TankMeanTrackLength(theta), 2);
100  const double energyMu = 3; // GeV
101  const double b = (2.33726e-01 + 2.26614e-02*log(energyMu))*trackSigma2;
102  sigma = b*sqrt(muons);
103 }
const double degree
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.
virtual double Mean(const double theta, const double r, const ulong muons) const
Average signal, given fixed number of muons.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Definition: Branch.cc:211
double pow(const double x, const unsigned int i)
double NormalPDF(const double x)
double NormalCDF(const double x)
void CalculateAverageAndSigma(double &mean, double &sigma, const double theta, const ulong muons) const
Class representing a document branch.
Definition: Branch.h:107
constexpr double s
Definition: AugerUnits.h:163
double TankMeanTrackLength(const double theta)
Mean track length of particle piercing Auger tank with zenith angle theta.
void GetData(bool &b) const
Overloads of the GetData member template function.
Definition: Branch.cc:644
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.
constexpr double m
Definition: AugerUnits.h:121
virtual double StDev(const double theta, const double r, const ulong muons) const
Standard deviation of signal, given fixed number of muons.

, generated on Tue Sep 26 2023.