32{
35
37
40 double E;
41 double R;
42 double z;
44 double TTS_ns;
47
48 try {
49
50 JParser<> zap(
"Auxiliary program to plot PDF of Cherenkov light from muon using interpolation tables.");
51
54 zap[
'E'] =
make_field(E,
"muon energy at vertex [GeV]") = 1.0;
55 zap[
'R'] =
make_field(R,
"distance of approach [m]");
56 zap[
'z'] =
make_field(z,
"PMT z-position [m]");
57 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
58 zap[
'T'] =
make_field(TTS_ns,
"PMT time smearing [ns]") = 0.0;
61
62 zap(argc, argv);
63 }
64 catch(const exception &error) {
65 FATAL(error.what() << endl);
66 }
67
68
74
75 const int N = inputFile.size();
76
77 int type[N];
78 JPDF_t pdf [N];
79
80 try {
81
82 for (int i = 0; i != N; ++i) {
83
84 NOTICE(
"loading input from file " << inputFile[i] <<
"... " << flush);
85
87
88 pdf [i].load(inputFile[i].c_str());
89
90 pdf [i].setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
91
92 if (TTS_ns > 0.0) {
93 pdf[i].blur(TTS_ns);
94 }
95
97 }
98 }
101 }
102
103 const double z_emission = z - R/getTanThetaC();
104 const double E_emission = gWater.getE(E, z_emission);
105
107
108 cout << "enter time (^C to exit) > " << flush;
109
110 for (double dt; cin >> dt; ) {
111
112 for (int i = 0; i != N; ++i) {
113
114 JFunction1D_t::result_type
y = pdf[i](R, dir.
getTheta(), dir.
getPhi(), dt);
115
119 y *= JDeltaRays::getEnergyLossFromMuon(E_emission);
120 }
121
122 cout << setw(2) << type[i] << ' '
124 <<
FIXED(5,1) << R <<
' '
125 <<
FIXED(5,1) << z <<
' '
128 <<
FIXED(5,1) << dt <<
' '
130 }
131 }
132
133 return 0;
134 }
135
137
138 int function = 0;
139
140 if (inputFile.size() == 1 &&
getPDFType(inputFile[0]) == DIRECT_LIGHT_FROM_MUON) {
141 function = 1;
142 }
143
144 const double t0 = 0.0;
145
147
148 if (function == 1) {
149
151
153
154 } else {
155
157
159 }
160 }
161
165
166 for (int i = 1; i <= h0.GetNbinsX(); ++i) {
167
168 const double dt = h0.GetBinCenter(i) - t0;
169
171
172 for (
int j = 0;
j != N; ++
j) {
173
174 if ( E_emission >= MASS_MUON* (1/SIN_THETA_C_WATER ) ) {
175
176 if (z_emission >= 0 && z_emission <= gWater(E)) {
177
179
183 y *= JDeltaRays::getEnergyLossFromMuon(E_emission);
184 }
186 }
187 }
188 }
189
190
191 h0.SetBinContent(i, get_value (Y));
193 h2.SetBinContent(i, get_integral (Y));
194 }
195
196 out.Write();
197 out.Close();
198}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for angles in three dimensions.
double getTheta() const
Get theta angle.
double getPhi() const
Get phi angle.
virtual const char * what() const override
Get error message.
Utility class to parse command line options.
Multi-dimensional PDF table for arrival time of Cherenkov light.
static const JZero zero
Function object to assign zero value.
bool is_deltarays(const int pdf)
Test if given PDF type corresponds to Cherenkov light from delta-rays.
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
int getPDFType(const std::string &file_name)
Get PDF type.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Auxiliary data structure for floating point format specification.