77{
80
82
88
89 try {
90
91 JParser<> zap(
"Program to histogram event-by-event data of shower light for making PDFs.");
92
95
100
102 return 1;
103 }
104 catch(const exception &error) {
106 }
107
109
115 }
119 }
120
121 try {
123 }
126 }
127
129
131
132 NOTICE(
"Apply detector offset " << offset <<
endl);
133
135
137
138 const double P_atm = NAMESPACE::getAmbientPressure();
141
143
144 const double ng[] = {
dispersion.getIndexOfRefractionGroup(wmax),
146
148
155
157
158 JMultiHistogram_t h0;
159 JMultiHistogram_t h1;
160
162
164
166
168 C.insert(i->getX());
169 }
170
171 C.insert(-1.01);
172 C.insert(-1.00);
173 C.insert( 1.00);
174 C.insert( 1.01);
175
176 const double E_b[] = {0.01, 0.2, 0.4, 0.6, 0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0, 40.0, 55.0, 70.0, 85.0, 100.0};
177
178 const double R[] = {0.0, 1.0, 2.5, 5.0, 7.5, 10.0, 12.5, 15.0, 17.5, 20.0, 25.0, 30.0, 35.0, 40.0, 50.0, 65.0, 80.0};
179 const double Dmax_m = R[sizeof(R)/sizeof(R[0]) - 1];
180
181 for (
int iE = 0;
iE !=
sizeof(
E_b)/
sizeof(
E_b[0]); ++
iE) {
182
184
185 for (int i = 0; i != sizeof(R)/sizeof(R[0]); ++i) {
186
187 const double R_m = R[i];
188
190
191 const double cd = *c;
192
193 const double grid = 10.0 + 0.0 *
R_m/100.0;
194 const double alpha = 2.0 * sqrt(1.0 -
cos(
grid * PI / 180.0));
195
198
202
204
205 for (JMultiHistogram_t* p : { &h0, &h1 }) {
207 }
208 }
209 }
210 }
211 }
212 }
213
214 double buffer[] = {-15.0,-10.0,-7.5,-5,-4,-3,-2,-1.5,-1.0,-0.5,-0.1, 0.0,0.1, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 7.5, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 85.0, 100.0 };
215 for (JMultiHistogram_t::super_iterator
216 i1 = h1.super_begin();
i1 != h1.super_end(); ++
i1) {
217 for (
int j = 0;
j !=
sizeof(buffer)/
sizeof(buffer[0]); ++
j) {
218 i1.getValue()[buffer[
j]];
219 }
220 }
221
222
225
226 while (inputFile.hasNext()) {
227
228
229
230
231 const Evt*
event = inputFile.next();
233
235
236
237
238
242 }
248 if(i->type == 14){
250 break;
251 }
253 }
255 }
256
257
258 double t0 = (*mc_tracks)[1].t;
259
261
262 try {
263
264 if(
hit->origin >= (
int)(*mc_tracks).size()){
265 std::out_of_range err("Hit origin not in tracklist. Avoided segfault");
266 throw err;
267 }
268
275
280 const double theta = axis.
getTheta();
281 const double phi = fabs(axis.
getPhi());
284
286 h1.fill(E,
D_m,
cd, theta, phi,
dt, npe);
288 }
289 }
290 catch(const exception& error) {
291 std::cout << "Fatal error for event: " << inputFile.getCounter() << std::endl;
293 }
294 }
295
296
298
300 continue;
301 }
302
303
304
305
308
310
312
314
316
318
319 for (JModule::const_iterator pmt =
module->begin(); pmt !=
module->end(); ++pmt) {
320
323
326 }
327 }
328 }
329 }
330
332 std::cout << "WARNING: recorded hits in normalization histogram that were not recorded in normalization histogram. This should not happen." << std::endl;
334 }
335 };
336
337 double integral = 0;
338 for (JMultiHistogram_t::super_iterator i = h0.super_begin(); i != h0.super_end(); ++i) {
339 integral+=i.getValue().getIntegral();
340 }
341 DEBUG(
"Integral:\t" << integral <<
endl);
342
343
344
346
348
349 for (const JMultiHistogram_t* p : { &h0, &h1 }) {
350 out.store(*p);
351 }
352
353 out.close();
355 return 1;
356}
std::vector< Int_t > getHitRemapping(const std::vector< Trk > *tracklist)
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Router for direct addressing of PMT data in detector data structure.
void transform(const JAxis3D &axis)
Transform axis to reference frame of given axis.
Data structure for direction in three dimensions.
Data structure for position in three dimensions.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
double getLength() const
Get length.
double getZ() const
Get z position.
JVector3D & sub(const JVector3D &vector)
Subtract vector.
double getTheta() const
Get theta angle.
double getPhi() const
Get phi angle.
Binary buffered file output.
JReader & read(JReader &in) override final
Read from input.
Implementation of dispersion for water in deep sea.
Function object for the probability density function of photon emission from EM-shower as a function ...
Probability density function of photon emission from EM-shower as a function of cosine of the emissio...
JDirection3D getDirection(const Vec &dir)
Get direction.
JPosition3D getPosition(const Vec &pos)
Get position.
double getNPE(const Hit &hit)
Get true charge of hit.
Vec getOffset(const JHead &header)
Get offset.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
std::string to_string(const T &value)
Convert value to string.
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
double getMinimalWavelength()
Get minimal wavelength for PDF evaluations.
const double getInverseSpeedOfLight()
Get inverse speed of light.
double getMaximalWavelength()
Get maximal wavelength for PDF evaluations.
static const double C
Physics constants.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
const char * getTime()
Get current local time conform ISO-8601 standard.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
The Vec class is a straightforward 3-d vector, which also works in pyroot.