Jpp  18.0.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JEMShower.cc File Reference

Auxiliary program to draw npe as a function of EM-energy. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "JPhysics/JPDF.hh"
#include "JPhysics/KM3NeT.hh"
#include "JPhysics/JConstants.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
#include <cmath>
#include "JTools/JFunction1D_t.hh"
#include "JPhysics/JDispersion.hh"
#include "JPhysics/JPDFToolkit.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to draw npe as a function of EM-energy.

Author
mdejong

Definition in file JEMShower.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 147 of file JEMShower.cc.

148 {
149  using namespace std;
150 
151  string outputFile;
152  int numberOfPoints;
153  double epsilon;
154  int debug;
155 
156  try {
157 
158  JParser<> zap("Auxiliary program to draw npe as a function of EM-energy.");
159 
160  zap['o'] = make_field(outputFile) = "geanc.root";
161  zap['n'] = make_field(numberOfPoints) = 25;
162  zap['e'] = make_field(epsilon) = 1.0e-10;
163  zap['d'] = make_field(debug) = 2;
164 
165  zap(argc, argv);
166  }
167  catch(const exception &error) {
168  FATAL(error.what() << endl);
169  }
170 
171 
172  using namespace JPP;
173 
174  const JPDF_C
185  epsilon);
186 
187 
188  double xmin = -4.0;
189  double xmax = 0.0;
190 
191  const double precision = 1.0e-10;
192 
193  while (fabs(xmax - xmin) > precision) {
194 
195  const double x = 0.5 * (xmin + xmax);
196  const double E = pow(10.0, x);
197 
198  const double y = getEMShowerCorrection(E);
199 
200  if (y < 0.5)
201  xmin = x;
202  else
203  xmax = x;
204  }
205 
206  const double EMIN = pow(10.0, 0.5*(xmax + xmin));
207 
208  NOTICE("Threshold kinetic energy [GeV] " << sqrt((EMIN + MASS_ELECTRON) * (EMIN - MASS_ELECTRON)) << endl);
209 
210 
211  TFile out(outputFile.c_str(), "recreate");
212 
213  TH1D h0("h0", NULL, 10000, -4.0, +4.0);
214  TH1D h1("h1", NULL, 10000, -4.0, +4.0);
215 
216  for (int i = 1; i <= h0.GetNbinsX(); ++i) {
217 
218  const Double_t x = h0.GetBinCenter(i);
219  const Double_t E = pow(10.0, x);
220 
221  h0.SetBinContent(i, E * geanc() * pdf.getNumberOfPhotons());
222  h1.SetBinContent(i, getEMShowerCorrection(E));
223  }
224 
225  out.Write();
226  out.Close();
227 }
const double xmax
Definition: JQuadrature.cc:24
Utility class to parse command line options.
Definition: JParser.hh:1514
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:36
double geanc()
Equivalent muon track length per unit shower energy.
Definition: JGeane.hh:28
double getScatteringProbability(const double x)
Function to describe light scattering in water.
Definition: Antares.hh:210
double getMinimalWavelength()
Get minimal wavelength for PDF evaluations.
Definition: JPDFToolkit.hh:26
string outputFile
double getMaximalWavelength()
Get maximal wavelength for PDF evaluations.
Definition: JPDFToolkit.hh:37
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
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...
double getAmbientPressure()
Get ambient pressure.
Definition: Antares.hh:40
#define NOTICE(A)
Definition: JMessage.hh:64
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:97
double getPhotocathodeArea()
Get photo-cathode area of PMT.
Definition: Antares.hh:51
static const double MASS_ELECTRON
electron mass [GeV]
#define FATAL(A)
Definition: JMessage.hh:67
const double xmin
Definition: JQuadrature.cc:23
double getAbsorptionLength(const double lambda)
Get absorption length.
Definition: Antares.hh:63
double getScatteringLength(const double lambda)
Get scattering length.
Definition: Antares.hh:148
int numberOfPoints
Definition: JResultPDF.cc:22
const double epsilon
Definition: JQuadrature.cc:21
int debug
debug level
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
Definition: JDrawLED.cc:68