Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
JRateK40.cc
Go to the documentation of this file.
1#include <string>
2#include <iostream>
3
4#include "JPhysics/KM3NeT.hh"
6#include "JPhysics/Antares.hh"
8
9#include "Jeep/JParser.hh"
10#include "Jeep/JMessage.hh"
11
12
13/**
14 * \file
15 *
16 * Example program to calculate singles rate.
17 * The calculation is based on the Antares internal note ANTARES-PHYS-2006-005 by Jurgen Brunner.
18 * According Antares internal note ANTARES-PHYS-2012-013, the absorption length is used (and not the attenuation length).
19 * \author mdejong
20 */
21int main(int argc, char* argv[])
22{
23 using namespace std;
24 using namespace JPP;
25
26 double bequerel;
27 JPMTParameters parameters;
28 int debug;
29
30 try {
31
32 JProperties properties = parameters.getProperties();
33
34 JParser<> zap("Example program to calculate singles rate.");
35
36 zap['b'] = make_field(bequerel) = 13.75e3; // [m^-3 s^-1]
37 zap['P'] = make_field(properties) = JPARSER::initialised();
38 zap['d'] = make_field(debug) = 3;
39
40 zap(argc, argv);
41 }
42 catch(const exception &error) {
43 FATAL(error.what() << endl);
44 }
45
46
47 using namespace NAMESPACE;
48
49 JPMTAnalogueSignalProcessor cpu(parameters);
50
51 const double wmin = 280.0; // minimal wavelength [nm]
52 const double wmax = 700.0; // maximal wavelength [nm]
53 double ng = 41.0; // average number of photons per decay in given wavelength range
54 const int npe = 1; // number of photo-electrons for each decay
55
56 ng *= (wmax-wmin) / (wmin*wmax) * (300.0*600.0)/(600.0-300.0);
57
58 double R[] = { 0.0, 0.0 };
59 double W[] = { 0.0, 0.0 };
60
61 const char* option[] = { "1Dx1D", "2D" };
62
63 for (double x = -1.0, dx = 0.02; x <= +1.0; x += dx) {
64 W[0] += getPhotocathodeArea() * getAngularAcceptance(x) * dx;
65 }
66
67
68 const double dw = 1.5; // [nm]
69
70 for (double w = wmin; w <= wmax; w += dw) {
71
72 W[1] = 0.0;
73
74 for (double x = -1.0, dx = 0.02; x <= +1.0; x += dx) {
75 W[1] += KM3NET2D::getPhotocathodeArea2D(x, w) * dx;
76 }
77
78 R[0] += W[0] * dw * getQE(w) * getAbsorptionLength(w) / (w*w);
79 R[1] += W[1] * dw * getAbsorptionLength(w) / (w*w);
80 }
81
82 for (int i = 0; i != sizeof(R)/sizeof(R[0]); ++i) {
83
84 R[i] *= wmax*wmin / (wmax - wmin);
85 R[i] *= bequerel * ng;
86
87 R[i] *= cpu.getSurvivalProbability(npe);
88 R[i] *= 0.5e-3;
89
90 cout << "Rate " << setw(6) << left << option[i] << " [kHz]: " << R[i] << endl;
91 }
92}
Properties of Antares PMT and deep-sea water.
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
Definition JDrawLED.cc:68
double getAbsorptionLength(const double lambda)
Definition JDrawPD0.cc:27
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:69
PMT analogue signal processor.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int main(int argc, char *argv[])
Definition JRateK40.cc:21
Properties of KM3NeT PMT and deep-sea water.
Properties of KM3NeT PMT and deep-sea water.
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.
Definition JParser.hh:1698
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.
Definition KM3NeT2D.hh:5235
virtual double getSurvivalProbability(const int NPE) const override
Probability that a hit survives the simulation of the PMT.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68