34{
37
39
44 TFormula f1;
46
47 try {
48
50
51 JParser<> zap(
"Example program to calculate singles rate.");
52
59
61 }
62 catch(const exception &error) {
64 }
65
66
68
70
71 for (
const auto& i :
fd) {
72 g1[i.first] = i.second;
73 }
74
77
79
80
81
82 const double wmin = 280.0;
83 const double wmax = 700.0;
84 const double ng = 47.11;
85 const int npe = 1;
86 const double cpow = 2.156;
87
89
90 const double dx = 1.5;
91 const int nx = (
int) ((wmax - wmin) /
dx);
92
95
96
97 double R[] = { 0.0, 0.0 };
98 double W[] = { 0.0, 0.0 };
99
100 const string option[] = { "1Dx1D", "2D" };
101
102 for (
double x = -1.0,
dx = 0.02;
x <= +1.0;
x +=
dx) {
104 }
105
106 double Y = 1.0;
107
110
112
113 Y *= cpu.getSurvivalProbability(npe);
114 Y *= 0.5e-3;
115
116
117 double A[] = { 0.0, 0.0 };
118
120
121 const double w = h0.GetXaxis()->GetBinCenter(
ix);
122 const double dw = h0.GetXaxis()->GetBinWidth (
ix);
123
124 W[1] = 0.0;
125
126 for (
double x = -1.0,
dx = 0.02;
x <= +1.0;
x +=
dx) {
128 }
129
131
134 }
135 if (f1.IsValid()) {
136 U *= f1.Eval(w);
137 }
138
141 A[0] += W[0] * U *
dw *
getQE(w);
142 A[1] += W[1] * U *
dw;
143
146 }
147
148 double labs[] = { 0.0, 0.0 };
149
150 cout <<
"PMT survival probability: " << cpu.getSurvivalProbability(npe) <<
endl;
151
152 for (int i = 0; i != sizeof(R)/sizeof(R[0]); ++i) {
153
155
156 const double corr = R[i]*(1.0-
exp(-MODULE_RADIUS_M/
labs[i]));
157
158 cout <<
setw(6) << left << option[i] +
":" << right
159 <<
" rate " <<
FIXED(7,3) << R[i] <<
" [kHz]"
160 <<
" corrected " <<
FIXED(7,3) << R[i] -
corr <<
" [kHz]"
162 }
163
164 out.Write();
165 out.Close();
166}
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
Double_t g1(const Double_t x)
Function.
Data structure for PMT parameters.
JProperties getProperties(const JEquationParameters &equation=JPMTParameters::getEquationParameters())
Get properties of this class.
Utility class to parse parameter values.
Template definition of a multi-dimensional oscillation probability interpolation table.
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.
static const JZero zero
Function object to assign zero value.
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.
Auxiliary data structure for floating point format specification.
PMT analogue signal processor.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...