Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
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.
 
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

◆ getAbsorptionLength()

double getAbsorptionLength ( const double lambda)
inline

Definition at line 28 of file JDrawPDE.cc.

29{
30 return absorptionLengthFactor * NAMESPACE::getAbsorptionLength(lambda);
31}
double absorptionLengthFactor
Scaling of absorption and scattering length.
Definition JDrawPDE.cc:25

◆ getScatteringLength()

double getScatteringLength ( const double lambda)
inline

Definition at line 34 of file JDrawPDE.cc.

35{
36 return scatteringLengthFactor * NAMESPACE::getScatteringLength(lambda);
37}
double scatteringLengthFactor
Definition JDrawPDE.cc:26

◆ main()

int main ( int argc,
char ** argv )

Definition at line 46 of file JDrawPDE.cc.

47{
48 using namespace std;
49 using namespace JPP;
50
52
53 string outputFile;
55 double epsilon;
56 double E;
57 double D;
58 double cd;
59 JAngle3D dir;
60 vector<int> function;
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
89 pdf(NAMESPACE::getPhotocathodeArea(),
90 NAMESPACE::getQE,
91 NAMESPACE::getAngularAcceptance,
94 NAMESPACE::getScatteringProbability,
95 NAMESPACE::getAmbientPressure(),
99 epsilon);
100
101
102 if (outputFile == "") {
103
104 cout << "enter time (^C to exit) > " << flush;
105
106 for (double dt; cin >> dt; ) {
107
108 for (vector<int>::const_iterator F = function.begin(); F != function.end(); ++F) {
109
110 cout << setw(2) << *F << ' '
111 << SCIENTIFIC(7,1) << E << ' '
112 << FIXED(5,1) << D << ' '
113 << FIXED(5,2) << cd << ' '
114 << FIXED(5,2) << dir.getTheta() << ' '
115 << FIXED(5,2) << dir.getPhi() << ' '
116 << FIXED(5,1) << dt << ' '
117 << SCIENTIFIC(9,3) << pdf.getLightFromEMshower(*F, E, D, cd, dir.getTheta(), dir.getPhi(), dt) * E << endl;
118 }
119 }
120
121 return 0;
122 }
123
124
125 TFile out(outputFile.c_str(), "recreate");
126
127 //const double t0 = D * getIndexOfRefraction() / C; // time [ns]
128 const double t0 = 0.0; // time [ns]
129
130 if (!histogram.is_valid()) {
131
132 if (function.size() == 1 && function[0] == DIRECT_LIGHT_FROM_EMSHOWER) {
133
134 histogram = JHistogram_t(t0 - 20.0, t0 + 50.0);
135
136 histogram.setBinWidth(0.1);
137
138 } else {
139
140 histogram = JHistogram_t(t0 - 20.0, t0 + 500.0);
141
142 histogram.setBinWidth(0.5);
143 }
144 }
145
146 TH1D h0("h0", NULL, histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit());
147
149
150 for (int i = 1; i <= h0.GetNbinsX(); ++i) {
151
152 const double dt = h0.GetBinCenter(i) - t0;
153
154 double value = 0.0;
155
156 for (vector<int>::const_iterator F = function.begin(); F != function.end(); ++F) {
157 value += pdf.getLightFromEMshower(*F, E, D, cd, dir.getTheta(), dir.getPhi(), dt);
158 }
159
160 h0.SetBinContent(i, value);
161
162 f1[dt] = value;
163 }
164
165 f1.compile();
166
167 try {
168
170
171 DEBUG("int " << quantiles.getIntegral() << endl);
172 DEBUG("x " << quantiles.getX() << endl);
173 DEBUG("y " << quantiles.getY() << endl);
174 DEBUG("FWHM " << quantiles.getFWHM() << endl);
175 }
176 catch(const exception&) {}
177
178 out.Write();
179 out.Close();
180}
string outputFile
double getAbsorptionLength(const double lambda)
Definition JDrawPDE.cc:28
double getScatteringLength(const double lambda)
Definition JDrawPDE.cc:34
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int numberOfPoints
Definition JResultPDF.cc:22
Data structure for angles in three dimensions.
Definition JAngle3D.hh:35
double getTheta() const
Get theta angle.
Definition JAngle3D.hh:86
double getPhi() const
Get phi angle.
Definition JAngle3D.hh:97
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
Definition JParser.hh:1698
Probability Density Functions of the time response of a PMT with an implementation of the JAbstractPM...
Definition JPDF.hh:2186
Quantile calculator for a given interpolating function.
Definition JQuantiles.hh:34
double getMinimalWavelength()
Get minimal wavelength for PDF evaluations.
double getMaximalWavelength()
Get maximal wavelength for PDF evaluations.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448
Type definition of a spline interpolation method based on a JCollection with double result type.
Auxiliary data structure for floating point format specification.
Definition JManip.hh:488

Variable Documentation

◆ absorptionLengthFactor

double absorptionLengthFactor

Scaling of absorption and scattering length.

Definition at line 25 of file JDrawPDE.cc.

◆ scatteringLengthFactor

double scatteringLengthFactor

Definition at line 26 of file JDrawPDE.cc.