92 double absorptionLength;
93 double scatteringLength;
98 JParser<> zap(
"Example program to draw PDF from LED beacon.");
104 zap[
'A'] =
make_field(absorptionLength) = 50.0;
105 zap[
'S'] =
make_field(scatteringLength) = 50.0;
114 catch(
const exception &error) {
115 FATAL(error.what() << endl);
119 const double theta = dir.first;
120 const double phi = dir.second;
126 const double P_atm = 240.0;
127 const double tmin = -10.0;
128 const double tmax = +10.0;
129 const double A = 440e-4;
130 const double R_Hz = 0.0e3;
132 const JDispersion dispersion(P_atm);
135 const double lm = scatteringLength / 0.83;
136 const double lr = scatteringLength / 0.17;
138 const double cs = 0.83 * 0.92;
140 const double l_abs = absorptionLength;
141 const double ls = scatteringLength;
142 const double l_att = l_abs * lr / (l_abs + lr);
147 cout <<
"Rayleigh scattering length " << lr <<
" m" << endl;
148 cout <<
"Mie scattering length " << lm <<
" m" << endl;
149 cout <<
"Absorption length " << l_abs <<
" m" << endl;
163 JCotangent(number_of_points),
180 JCotangent(number_of_points),
188 TH1D h0(
"h0", NULL, 430, -15.0, +200.0);
189 TH1D
h1(
"h1", NULL, 430, -15.0, +200.0);
190 TH1D h2(
"h2", NULL, 430, -15.0, +200.0);
191 TH1D h3(
"h3", NULL, 430, -15.0, +200.0);
192 TH1D ha(
"ha", NULL, 430, -15.0, +200.0);
194 JSplineFunction1S_t
f[4];
195 JSplineFunction1S_t
f1;
198 for (
int i = 1; i <=
h1.GetNbinsX(); ++i) {
200 const double t1 =
h1.GetBinCenter(i);
202 const double F1 = pdfMie .getDirectLightFromLED (
D, ct, theta, phi, t1);
203 const double F2 = pdfMie .getScatteredLightFromLED(
D, ct, theta, phi, t1);
204 const double F3 = pdfRayleigh.getScatteredLightFromLED(
D, ct, theta, phi, t1);
207 h0.SetBinContent(i, F1 + F2 + F3);
208 h1.SetBinContent(i, F1);
209 h2.SetBinContent(i, F2);
210 h3.SetBinContent(i, F3);
215 f[3][t1] = F1 + F2 + F3;
217 f1[t1] = F1 + F2 + F3;
222 for (
int i = 3; i !=
sizeof(
f)/
sizeof(
f[0]); ++i) {
226 JQuantiles quantiles(
f[i]);
229 const double lz = l_abs * ls / (l_abs*(1.0-cs) + ls);
231 NOTICE(
"int " << quantiles.getIntegral() *
D*
D *
exp(
D/lz) << endl);
234 DEBUG(
"ct " << ct << endl);
235 DEBUG(
"theta " << theta << endl);
236 DEBUG(
"phi " << phi << endl);
237 DEBUG(
"int " << quantiles.getIntegral() << endl);
238 DEBUG(
"t1 " << quantiles.getX() << endl);
239 DEBUG(
"max " << quantiles.getY() << endl);
240 DEBUG(
"FWHM " << quantiles.getFWHM() << endl);
244 const double Tmin = ha.GetXaxis()->GetXmin();
245 const double Tmax = ha.GetXaxis()->GetXmax();
247 const double V =
f1.rbegin()->
getIntegral() + R_Hz * 1e-9 * (Tmax - Tmin);
249 for (
int i = 1; i <= ha.GetNbinsX(); ++i) {
251 const double t1 = ha.GetBinCenter(i);
253 JSplineFunction1S_t::result_type p =
f1(t1);
255 double v = p.v + R_Hz * 1e-9 * (t1 - Tmin);
256 double y = p.f + R_Hz * 1e-9;
258 const double W =
exp(-v) * y / (1.0 -
exp(-
V));
260 ha.SetBinContent(i,W);
const JPolynome F1
Integral.
Utility class to parse command line options.
double getQE(const double lambda, const bool option)
Get quantum efficiency of PMT.
o $QUALITY_ROOT d $DEBUG!JPlot1D f
double rayleigh(const double a, const double x)
Auxiliary method to describe light scattering in water (Rayleigh).
then for HISTOGRAM in h0 h1
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
Light yield from LED (number of p.e.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
double getIntegral(const double x) const
Integral value.
double henyey_greenstein(const double g, const double x)
Auxiliary method to describe light scattering in water (Henyey-Greenstein).
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
do echo Generating $dir eval D
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
#define DEBUG(A)
Message macros.
double getAngularAcceptance(const double x)
Angular acceptence of PMT.