32{
35
37
40 double epsilon;
44 double E;
45 double R;
46 double z;
51
52 try {
53
55
60
61 JParser<> zap(
"Auxiliary program to draw PDF of Cherenkov light from muon.");
62
64 <<
"possible options absorptionLength: " <<
get_keys(absorptionLength) << endl
65 <<
"possible options scatteringLength: " <<
get_keys(scatteringLength) << endl
69 zap[
'e'] =
make_field(epsilon,
"precision for integration") = 1.0e-10;
70 zap[
'E'] =
make_field(E,
"muon energy at vertex [GeV]") = 1.0;
71 zap[
'R'] =
make_field(R,
"distance of approach [m]");
72 zap[
'z'] =
make_field(z,
"PMT z-position [m]");
73 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
77
78 zap(argc, argv);
79 }
80 catch(const exception &error) {
81 FATAL(error.what() << endl);
82 }
83
84
86 pdf(NAMESPACE::getPhotocathodeArea(),
87 NAMESPACE::getQE,
88 NAMESPACE::getAngularAcceptance,
89 JAbsorptionLength::getAbsorptionLength,
90 JScatteringLength::getScatteringLength,
91 JScatteringProbability::getScatteringProbability,
92 NAMESPACE::getAmbientPressure(),
96 epsilon);
97
98 const double z_0 = z - R/getTanThetaC();
99 const double E_0 = gWater.getE(E, z_0);
100
101
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 << ' '
112 <<
FIXED(5,1) << R <<
' '
113 <<
FIXED(5,1) << z <<
' '
116 <<
FIXED(5,1) << dt <<
' '
118 }
119 }
120
121 return 0;
122 }
123
124
126
127 const double t0 = 0.0;
128
130
131 if (function.size() == 1 && function[0] == DIRECT_LIGHT_FROM_MUON) {
132
134
136
137 } else {
138
140
142 }
143 }
144
146
148
149 if (E_0 >= MASS_MUON* (1.0/SIN_THETA_C_WATER)) {
150
151 if (z_0 >= 0 && z_0 <= gWater(E)) {
152
153 for (int i = 1; i <= h0.GetNbinsX(); ++i) {
154
155 const double dt = h0.GetBinCenter(i) - t0;
156
157 double value = 0.0;
158
159 for (vector<int>::const_iterator F = function.begin(); F != function.end(); ++F) {
160 value += pdf.getLightFromMuon(*F, E_0, R, dir.
getTheta(), dir.
getPhi(), dt);
161 }
162
163 h0.SetBinContent(i, value);
164
165 f1[dt] = value;
166 }
167 }
168 }
169
171 f1.compile();
172
173 try {
174
175 const double T_ns = 5;
176
178
179 const double t1 = quantiles.getX();
180 const double y = f1(t1 + T_ns).v - f1(t1 - T_ns).v;
181
182 DEBUG(
"E " << E << endl);
183 DEBUG(
"E_0 " << E_0 << endl);
184 DEBUG(
"R " << R << endl);
185 DEBUG(
"z " << z << endl);
188 DEBUG(
"int " << quantiles.getIntegral() << endl);
189 DEBUG(
"t1 " << t1 << endl);
190 DEBUG(
"max " << quantiles.getY() << endl);
191 DEBUG(
"FWHM " << quantiles.getFWHM() << endl);
192 DEBUG(
"int[] " << y << endl);
193 }
194 catch(const exception&) {}
195
196 out.Write();
197 out.Close();
198}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Utility class to parse parameter values.
Data structure for angles in three dimensions.
double getTheta() const
Get theta angle.
double getPhi() const
Get phi angle.
Utility class to parse command line options.
Probability Density Functions of the time response of a PMT with an implementation of the JAbstractPM...
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
static const JZero zero
Function object to assign zero value.
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.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure to customize absorption length.
Auxiliary data structure to customize scattering length.
Auxiliary data structure to customize scattering probability.
Auxiliary data structure for floating point format specification.