53 typedef JAbstractHistogram<double> JHistogram_t;
62 JHistogram_t histogram;
71 JParser<> zap(
"Auxiliary program to draw PDF of Cherenkov light from muon.");
79 zap[
'E'] =
make_field(
E,
"muon energy [GeV]") = 1.0;
80 zap[
'R'] =
make_field(
R,
"distance of approach [m]");
81 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
83 zap[
'H'] =
make_field(histogram,
"histogram binning") = JHistogram_t();
88 catch(
const exception &error) {
89 FATAL(error.what() << endl);
109 for (
double dt; cin >> dt; ) {
113 cout << setw(2) << *
F <<
' '
116 <<
FIXED(5,2) << dir.getTheta() <<
' '
117 <<
FIXED(5,2) << dir.getPhi() <<
' '
118 <<
FIXED(5,1) << dt <<
' '
119 <<
SCIENTIFIC(9,3) << pdf.getLightFromMuon(*
F,
E,
R, dir.getTheta(), dir.getPhi(), dt) *
E << endl;
131 const double t0 = 0.0;
133 if (!histogram.is_valid()) {
137 histogram = JHistogram_t(t0 - 20.0, t0 + 50.0);
139 histogram.setBinWidth(0.1);
143 histogram = JHistogram_t(t0 - 20.0, t0 + 500.0);
145 histogram.setBinWidth(0.5);
149 TH1D h0(
"h0", NULL, histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit());
151 JSplineFunction1S_t
f1;
153 for (
int i = 1;
i <= h0.GetNbinsX(); ++
i) {
155 const double dt = h0.GetBinCenter(
i) - t0;
160 value += pdf.getLightFromMuon(*
F,
E,
R, dir.getTheta(), dir.getPhi(), dt);
163 h0.SetBinContent(
i, value);
168 f1.setExceptionHandler(
new JSplineFunction1S_t::JDefaultResult(
JMATH::zero));
173 JQuantiles quantiles(
f1);
175 const double t1 = quantiles.getX();
176 const double y =
f1(t1 +
T).v -
f1(t1 -
T).v;
180 DEBUG(
"theta " << dir.getTheta() << endl);
181 DEBUG(
"phi " << dir.getPhi() << endl);
182 DEBUG(
"int " << quantiles.getIntegral() << endl);
183 DEBUG(
"t1 " << t1 << endl);
184 DEBUG(
"max " << quantiles.getY() << endl);
185 DEBUG(
"FWHM " << quantiles.getFWHM() << endl);
186 DEBUG(
"int[] " <<
y << endl);
Utility class to parse command line options.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Utility class to parse parameter values.
double absorptionLengthFactor
Scaling of absorption and scattering length.
double getScatteringProbability(const double x)
Function to describe light scattering in water.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
static const JZero zero
Function object to assign zero value.
double getMinimalWavelength()
Get minimal wavelength for PDF evaluations.
Auxiliary data structure for floating point format specification.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
static double MODULE_RADIUS_M
Radius of optical module [m].
double getMaximalWavelength()
Get maximal wavelength for PDF evaluations.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
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...
do set_variable OUTPUT_DIRECTORY $WORKDIR T
double getAmbientPressure()
Get ambient pressure.
double getPhotocathodeArea()
Get photo-cathode area of PMT.
then JCookie sh JDataQuality D $DETECTOR_ID R
double getAbsorptionLength(const double lambda)
Get absorption length.
double getScatteringLength(const double lambda)
Get scattering length.
double scatteringLengthFactor
Auxiliary data structure for floating point format specification.
#define DEBUG(A)
Message macros.
double getAngularAcceptance(const double x)
Angular acceptence of PMT.