34{
37
39
41 double bequerel;
43 container_type fd;
44 TFormula f1;
46
47 try {
48
50
51 JParser<> zap(
"Example program to calculate singles rate.");
52
54 zap[
'b'] =
make_field(bequerel,
"radioactivity") = 13.75e3;
59
60 zap(argc, argv);
61 }
62 catch(const exception &error) {
63 FATAL(error.what() << endl);
64 }
65
66
67 using namespace NAMESPACE;
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
93 TH1D h0("h0", NULL, nx, wmin, wmax);
94 TH1D h1("h1", NULL, nx, wmin, wmax);
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
108 Y *= cpow - 1.0;
109 Y /=
pow(wmin, 1.0 - cpow) -
pow(wmax, 1.0 - cpow);
110
111 Y *= bequerel * ng;
112
113 Y *= cpu.getSurvivalProbability(npe);
114 Y *= 0.5e-3;
115
116
117 double A[] = { 0.0, 0.0 };
118
119 for (int ix = 1; ix <= h0.GetXaxis()->GetNbins(); ++ix) {
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
130 double U = Y /
pow(w,cpow);
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
154 labs[i] = R[i]/A[i];
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]"
161 <<
" <l_abs> " <<
FIXED(7,3) << labs[i] <<
" [m]" << endl;
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.
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.
Auxiliary wrapper for I/O of container with optional comment (see JComment).
Empty structure for specification of parser element that is initialised (i.e. does not require input)...