Jpp
Functions
JRateK40.cc File Reference
#include <string>
#include <iostream>
#include "JPhysics/KM3NeT.hh"
#include "JPhysics/Antares.hh"
#include "JDetector/JPMTAnalogueSignalProcessor.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Example program to calculate singles rate. The calculation is based on the Antares internal note ANTARES-PHYS-2006-005 by Jurgen Brunner. According Antares internal note ANTARES-PHYS-2012-013, the absorption length is used (and not the attenuation length).

Author
mdejong

Definition in file JRateK40.cc.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 20 of file JRateK40.cc.

21 {
22  using namespace std;
23  using namespace JPP;
24 
25  double bequerel;
26  JPMTParameters parameters;
27  int debug;
28 
29  try {
30 
31  JProperties properties = parameters.getProperties();
32 
33  JParser<> zap("Example program to calculate singles rate.");
34 
35  zap['b'] = make_field(bequerel) = 13.75e3; // [m^-3 s^-1]
36  zap['P'] = make_field(properties) = JPARSER::initialised();
37  zap['d'] = make_field(debug) = 3;
38 
39  zap(argc, argv);
40  }
41  catch(const exception &error) {
42  FATAL(error.what() << endl);
43  }
44 
45 
46  using namespace KM3NET;
47  //using namespace ANTARES;
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] += 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 }
JTOOLS::w
data_type w[N+1][M+1]
Definition: JPolint.hh:708
KM3NET::getPhotocathodeArea2D
static const JPhotocathodeArea2D getPhotocathodeArea2D
Function object for photo-cathode area 3 inch PMT.
Definition: KM3NeT.hh:5820
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e.
Definition: JParser.hh:63
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JDETECTOR::getQE
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.
Definition: JPMTParametersToolkit.hh:89
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
debug
int debug
debug level
Definition: JSirene.cc:59
ANTARES::getAbsorptionLength
double getAbsorptionLength(const double lambda)
Absoption length.
Definition: Antares.hh:53
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
JEEP::JProperties
Utility class to parse parameter values.
Definition: JProperties.hh:496
std
Definition: jaanetDictionary.h:36
getAngularAcceptance
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
Definition: JDrawLED.cc:84
FATAL
#define FATAL(A)
Definition: JMessage.hh:67
ANTARES::getPhotocathodeArea
const double getPhotocathodeArea()
Photo-cathode area 10 inch PMT.
Definition: Antares.hh:41
KM3NET
Name space for KM3NeT.
Definition: JDAQClock.hh:310