Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
JDrawPDE.cc File Reference

Auxiliary program to draw PDF of Cherenkov light from EM-shower including shower profile. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "JPhysics/JPDF.hh"
#include "JPhysics/Antares.hh"
#include "JPhysics/KM3NeT.hh"
#include "JTools/JSpline.hh"
#include "JTools/JQuantiles.hh"
#include "JTools/JAbstractHistogram.hh"
#include "JGeometry3D/JAngle3D.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

double getAbsorptionLength (const double lambda)
 
double getScatteringLength (const double lambda)
 
int main (int argc, char **argv)
 

Variables

double absorptionLengthFactor
 Scaling of absorption and scattering length. More...
 
double scatteringLengthFactor
 

Detailed Description

Auxiliary program to draw PDF of Cherenkov light from EM-shower including shower profile.

Author
mdejong

Definition in file JDrawPDE.cc.

Function Documentation

double getAbsorptionLength ( const double  lambda)
inline

Definition at line 28 of file JDrawPDE.cc.

29 {
31 }
double absorptionLengthFactor
Scaling of absorption and scattering length.
Definition: JDrawPD0.cc:24
double getAbsorptionLength(const double lambda)
Absoption length.
Definition: Antares.hh:53
double getScatteringLength ( const double  lambda)
inline

Definition at line 34 of file JDrawPDE.cc.

35 {
37 }
double getScatteringLength(const double lambda)
Scattering length.
Definition: Antares.hh:138
double scatteringLengthFactor
Definition: JDrawPD0.cc:25
int main ( int  argc,
char **  argv 
)

Definition at line 46 of file JDrawPDE.cc.

47 {
48  using namespace std;
49  using namespace JPP;
50 
51  typedef JAbstractHistogram<double> JHistogram_t;
52 
53  string outputFile;
54  int numberOfPoints;
55  double epsilon;
56  double E;
57  double D;
58  double cd;
59  JAngle3D dir;
60  vector<int> function;
61  JHistogram_t histogram;
62  int debug;
63 
64  try {
65 
66  JParser<> zap("Auxiliary program to draw PDF of Cherenkov light from EM-shower including shower profile.");
67 
68  zap['o'] = make_field(outputFile) = "pde.root";
69  zap['n'] = make_field(numberOfPoints, "points for integration") = 25;
70  zap['e'] = make_field(epsilon, "precision for integration") = 1.0e-10;
71  zap['A'] = make_field(absorptionLengthFactor, "scaling factor") = 1.0;
72  zap['S'] = make_field(scatteringLengthFactor, "scaling factor") = 1.0;
73  zap['E'] = make_field(E, "shower energy [GeV]");
74  zap['R'] = make_field(D, "distance [m]");
75  zap['c'] = make_field(cd, "cosine emission angle");
76  zap['D'] = make_field(dir, "(theta, phi) of PMT [rad]");
77  zap['F'] = make_field(function, "PDF type");
78  zap['H'] = make_field(histogram, "histogram binning") = JHistogram_t();
79  zap['d'] = make_field(debug) = 0;
80 
81  zap(argc, argv);
82  }
83  catch(const exception &error) {
84  FATAL(error.what() << endl);
85  }
86 
87 
88  const JPDF_C
99  epsilon);
100 
101 
102  if (outputFile == "") {
103 
104  for (double dt; cin >> dt; ) {
105 
106  for (vector<int>::const_iterator F = function.begin(); F != function.end(); ++F) {
107 
108  cout << setw(2) << *F << ' '
109  << SCIENTIFIC(7,1) << E << ' '
110  << FIXED(5,1) << D << ' '
111  << FIXED(5,2) << cd << ' '
112  << FIXED(5,2) << dir.getTheta() << ' '
113  << FIXED(5,2) << dir.getPhi() << ' '
114  << FIXED(5,1) << dt << ' '
115  << SCIENTIFIC(9,3) << pdf.getLightFromEMshower(*F, E, D, cd, dir.getTheta(), dir.getPhi(), dt) * E << endl;
116  }
117  }
118 
119  return 0;
120  }
121 
122 
123  TFile out(outputFile.c_str(), "recreate");
124 
125  const double t0 = D * getIndexOfRefraction() / C; // time [ns]
126  //const double t0 = 0.0; // time [ns]
127 
128  if (!histogram.is_valid()) {
129 
130  if (function.size() == 1 && function[0] == DIRECT_LIGHT_FROM_EMSHOWER) {
131 
132  histogram = JHistogram_t(t0 - 20.0, t0 + 50.0);
133 
134  histogram.setBinWidth(0.1);
135 
136  } else {
137 
138  histogram = JHistogram_t(t0 - 20.0, t0 + 500.0);
139 
140  histogram.setBinWidth(0.5);
141  }
142  }
143 
144  TH1D h0("h0", NULL, histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit());
145 
146  JSplineFunction1D_t f1;
147 
148  for (int i = 1; i <= h0.GetNbinsX(); ++i) {
149 
150  const double dt = h0.GetBinCenter(i) - t0;
151 
152  double value = 0.0;
153 
154  for (vector<int>::const_iterator F = function.begin(); F != function.end(); ++F) {
155  value += pdf.getLightFromEMshower(*F, E, D, cd, dir.getTheta(), dir.getPhi(), dt);
156  }
157 
158  h0.SetBinContent(i, value);
159 
160  f1[dt] = value;
161  }
162 
163  f1.compile();
164 
165  JQuantiles quantiles(f1);
166 
167  DEBUG("int " << quantiles.getIntegral() << endl);
168  DEBUG("x " << quantiles.getX() << endl);
169  DEBUG("y " << quantiles.getY() << endl);
170  DEBUG("FWHM " << quantiles.getFWHM() << endl);
171 
172 
173  out.Write();
174  out.Close();
175 }
Utility class to parse command line options.
Definition: JParser.hh:1493
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
const double getPhotocathodeArea()
Photo-cathode area 10 inch PMT.
Definition: Antares.hh:41
double getIndexOfRefraction()
Get average index of refraction of water.
Definition: JConstants.hh:111
then check_input_file $DETECTOR $INPUT_FILE for OPTION in A B C D E F
Definition: JFilter.sh:47
double absorptionLengthFactor
Scaling of absorption and scattering length.
Definition: JDrawPD0.cc:24
double getScatteringProbability(const double x)
Function to describe light scattering in water.
Definition: Antares.hh:292
double getMinimalWavelength()
Get minimal wavelength for PDF evaluations.
Definition: JPDFToolkit.hh:34
Auxiliary data structure for floating point format specification.
Definition: JPrint.hh:481
string outputFile
double getMaximalWavelength()
Get maximal wavelength for PDF evaluations.
Definition: JPDFToolkit.hh:45
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
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:30
direct light from EM shower
Definition: JPDFTypes.hh:40
int debug
debug level
Definition: JSirene.cc:61
#define FATAL(A)
Definition: JMessage.hh:67
double getAbsorptionLength(const double lambda)
Absoption length.
Definition: Antares.hh:53
double getScatteringLength(const double lambda)
Scattering length.
Definition: Antares.hh:138
int numberOfPoints
Definition: JResultPDF.cc:22
double scatteringLengthFactor
Definition: JDrawPD0.cc:25
static const double C
Speed of light in vacuum [m/ns].
Definition: JConstants.hh:22
Auxiliary data structure for floating point format specification.
Definition: JPrint.hh:518
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:37
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
Definition: JDrawLED.cc:84

Variable Documentation

double absorptionLengthFactor

Scaling of absorption and scattering length.

Definition at line 25 of file JDrawPDE.cc.

double scatteringLengthFactor

Definition at line 26 of file JDrawPDE.cc.