23{
26
27 double bequerel;
30
31 try {
32
34
35 JParser<> zap(
"Example program to calculate singles rate.");
36
40
41 zap(argc, argv);
42 }
43 catch(const exception &error) {
44 FATAL(error.what() << endl);
45 }
46
47
48 using namespace NAMESPACE;
49
51
52
53 const double wmin = 280.0;
54 const double wmax = 700.0;
55 double ng = 47.11;
56 const int npe = 1;
57 double cpow = 2.156;
58
59 double R[] = { 0.0, 0.0 };
60 double W[] = { 0.0, 0.0 };
61
62 const char* option[] = { "1Dx1D", "2D" };
63
64 for (
double x = -1.0, dx = 0.02;
x <= +1.0;
x += dx) {
66 }
67
68
69 const double dw = 1.5;
70
71 double norm[] = { 0.0, 0.0 };
72
73 for (double w = wmin; w <= wmax; w += dw) {
74
75 W[1] = 0.0;
76
77 for (
double x = -1.0, dx = 0.02;
x <= +1.0;
x += dx) {
79 }
80
83 norm[0] += W[0] * dw *
getQE(w) /
pow(w,cpow);
84 norm[1] += W[1] * dw /
pow(w,cpow);
85 }
86
87 double avabs[] = { 0.0, 0.0 };
88
89 cout << "survival probability: " << cpu.getSurvivalProbability(npe) << endl;
90
91 for (int i = 0; i != sizeof(R)/sizeof(R[0]); ++i) {
92 avabs[i] = R[i]/norm[i];
93
94 R[i] *= cpow-1.0;
95 R[i] /=
pow(wmin, 1.0-cpow) -
pow(wmax,1.0-cpow);
96
97 R[i] *= bequerel * ng;
98
99 R[i] *= cpu.getSurvivalProbability(npe);
100 R[i] *= 0.5e-3;
101
102 cout << "Rate " << setw(6) << left << option[i] << " [kHz]: " << R[i] << endl;
103 double corr = R[i]*(1.0-exp(-MODULE_RADIUS_M/avabs[i]));
104 cout << "Rcor "<< setw(6) << left << option[i] << " [kHz]: " << R[i]-corr << " <abs> [m]: "<< avabs[i] << endl;
105 }
106}
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
double getAbsorptionLength(const double lambda)
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for PMT parameters.
JProperties getProperties(const JEquationParameters &equation=JPMTParameters::getEquationParameters())
Get properties of this class.
Utility class to parse parameter values.
Utility class to parse command line options.
double getPhotocathodeArea()
Get photo-cathode area of PMT.
double getQE(const double R, const double mu)
Get QE for given ratio of hit probabilities and expectation value of the number of photo-electrons.
T pow(const T &x, const double y)
Power .
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const JPhotocathodeArea2D getPhotocathodeArea2D
Function object for effective photo-cathode area of PMT.
PMT analogue signal processor.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...