36{
39
41
43 double bequerel;
45 container_type fd;
46 TFormula f1;
49
50 try {
51
53
55
56 JParser<> zap(
"Example program to calculate singles rate.");
57
59 zap[
'b'] =
make_field(bequerel,
"radioactivity") = 14687.6;
63
65
66 zap(argc, argv);
67 }
68 catch(const exception &error) {
69 FATAL(error.what() << endl);
70 }
71
73
75
76 for (const auto& i : fd) {
77 g1[i.first] = i.second;
78 }
79
82
84
85
86
87 const double wmin = 280.0;
88 const double wmax = 700.0;
89 const double ng = 47.11;
90 const int npe = 1;
91 const double cpow = 2.156;
92
94
95 const double dx = 1.5;
96 const int nx = (int) ((wmax - wmin) / dx);
97
98 TH1D h0("h0", NULL, nx, wmin, wmax);
99 TH1D h1("h1", NULL, nx, wmin, wmax);
100
101
102 double R[] = { 0.0, 0.0 };
103 double W[] = { 0.0, 0.0 };
104
105 const string option[] = { "1Dx1D", "2D" };
106
107 for (
double x = -1.0, dx = 0.02;
x <= +1.0;
x += dx) {
109 }
110
111 double Y = 1.0;
112
113 Y *= cpow - 1.0;
114 Y /=
pow(wmin, 1.0 - cpow) -
pow(wmax, 1.0 - cpow);
115
116 Y *= bequerel * ng;
117
118 Y *= cpu.getSurvivalProbability(npe);
119 Y *= 0.5e-3;
120
121
122 double A[] = { 0.0, 0.0 };
123
124 for (int ix = 1; ix <= h0.GetXaxis()->GetNbins(); ++ix) {
125
126 const double w = h0.GetXaxis()->GetBinCenter(ix);
127 const double dw = h0.GetXaxis()->GetBinWidth (ix);
128
129 W[1] = 0.0;
130
131 for (
double x = -1.0, dx = 0.02;
x <= +1.0;
x += dx) {
133 }
134
135 double U = Y /
pow(w,cpow);
136
139 }
140 if (f1.IsValid()) {
141 U *= f1.Eval(w);
142 }
143
146 A[0] += W[0] * U * dw *
getQE(w);
147 A[1] += W[1] * U * dw;
148
151 }
152 double labs[] = { 0.0, 0.0 };
153
154 cout << "PMT survival probability: " << cpu.getSurvivalProbability(npe) << endl;
155
156 for (int i = 0; i != sizeof(R)/sizeof(R[0]); ++i) {
157
158 labs[i] = R[i]/A[i];
159
160 const double corr = R[i]*(1.0-exp(-MODULE_RADIUS_M/labs[i]));
161
162 cout << setw(6) << left << option[i] + ":" << right
163 <<
" rate " <<
FIXED(7,3) << R[i] <<
" [kHz]"
164 <<
" corrected " <<
FIXED(7,3) << R[i] - corr <<
" [kHz]"
165 <<
" <l_abs> " <<
FIXED(7,3) << labs[i] <<
" [m]" << endl;
166 }
167
168 out.Write();
169 out.Close();
170}
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement 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)...
Auxiliary data structure to customize absorption length.
static double getAbsorptionLength(const double lambda)
Get absorption length.