Jpp  pmt_effective_area_update_2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JRateK40.cc File Reference

Example program to calculate singles rate. More...

#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

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 }
Utility class to parse command line options.
Definition: JParser.hh:1500
data_type w[N+1][M+1]
Definition: JPolint.hh:741
const double getPhotocathodeArea()
Photo-cathode area 10 inch PMT.
Definition: Antares.hh:41
Utility class to parse parameter values.
Definition: JProperties.hh:496
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:66
#define KM3NET
Definition: Jpp.hh:32
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
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...
int debug
debug level
Definition: JSirene.cc:63
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
#define FATAL(A)
Definition: JMessage.hh:67
double getAbsorptionLength(const double lambda)
Absoption length.
Definition: Antares.hh:53
static const JPhotocathodeArea2D getPhotocathodeArea2D
Function object for photo-cathode area 3 inch PMT.
Definition: KM3NeT.hh:5598
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
Definition: JDrawLED.cc:84