1 #include <tls/VTankResponse.h>
2 #include <utl/PoissonDistribution.h>
4 #include <utl/AugerException.h>
16 VTankResponse::PoissonConvolvedPDF(
const double signal,
26 ulong nMuUp = nMuDown+1;
27 for (
double p = 0; k < kmax && (k < 5 || p >=
precision*psum); ++k)
29 p =
PoissonPDF(nMuUp, muons) * PDF(signal, theta, r, nMuUp);
34 p +=
PoissonPDF(nMuDown, muons) * PDF(signal, theta, r, nMuDown);
52 VTankResponse::PoissonConvolvedCDF(
const double sThreshold,
56 const bool complement)
65 ulong nMuUp = nMuDown+1;
67 for (
double p = 0; k < kmax && (k < 5 || p >=
precision*psum); ++k)
70 (1.0 - CDF(sThreshold, theta, r, nMuUp));
76 (1.0 - CDF(sThreshold, theta, r, nMuDown));
88 for (
double p = 0; k < kmax && (k < 5 || p >=
precision*psum); ++k)
90 p =
PoissonPDF(k, muons) * CDF(sThreshold, theta, r, k);
106 VTankResponse::PoissonConvolvedMeanAndStDev(
double& mean,
118 ulong nMuUp = nMuDown+1;
119 for (
double mom1 = 0; k < kmax && (k < 5 || mom1 >=
precision*cmom1); ++k)
123 const double mean =
Mean(theta,r,nMuUp);
124 const double sigma = StDev(theta,r,nMuUp);
126 mom2 = p * (sigma*sigma + mean*mean);
131 const double mean =
Mean(theta,r,nMuDown);
132 const double sigma = StDev(theta,r,nMuDown);
134 mom2 += p * (sigma*sigma + mean*mean);
150 stDev =
sqrt(cmom2 - cmom1*cmom1);
static const double precision
double Mean(const std::vector< double > &v)
double PoissonPDF(const ulong k, const double x)