Fit function.
231 {
234
236
238
239
240
242
244
245 if (!in.empty()) {
247 }
248
249 for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
250
252
253
254
256
258
261 }
262
265
266 double zmin = numeric_limits<double>::lowest();
267
270 }
271
273
274 for (const auto& module : input.data) {
275
277
278 pos.transform(R, tz.getPosition());
279
281
282 const double z1 = pos.getZ() - pos.getX() /
getTanThetaC();
284
285 if (z1 >= zmin) {
286
287 for (size_t i = 0; i != module->size(); ++i) {
288
289 if (module.getStatus(i)) {
290
291 const struct {
292
294 {
295 return (hit.
getPMT() == pmt && T_ns(hit.
getT()));
296 }
297
299 const size_t pmt;
300
301 } match = { T_ns + t1, i };
302
304
306
307 JPMT pmt =
module->getPMT(i);
308
310
311 const JNPEHit hit(this->
getNPE(pmt, module.frame.getRate(i)), count_if(module.begin(), module.end(), match), ps);
312
313 DEBUG(
"hit: " << setw(8) << module->getID() <<
'.' <<
FILL(2,
'0') << i <<
' '
315 <<
FIXED(7,3) << module.frame.getRate(i) * 1.0e-3 <<
' '
320 << setw(2) << hit.
getN() << endl);
321
323 }
324 }
325 }
326 }
327 }
328
330
331 if (NDF >= 0) {
332
333
334
335 const int N = 5;
336
338
339 for (int i = 0; i != N; ++i) {
341 }
342
344
345 do {
346
348
349 for (int i = 0; i != N; ++i) {
350
352
354 const double chi2 = (*this)(
x,
data.begin(),
data.end());
355
357 buffer[chi2] =
x.getE();
358 }
359
362 }
363 }
364
365
366 for (int i = 0; i != N; ++i) {
368 }
370
371
372
374
375 case 0:
379 break;
380
381 case 1:
384 break;
385
386 case 2:
389 break;
390
391 case 3:
394 break;
395
396 case 4:
400 break;
401 }
402
405
407
408
410
413
414 }
415
416 const double chi2 =
result[2].chi2;
417 const double E =
result[2].x.getE();
418
419
420
421 double Emin = numeric_limits<double>::max();
422 double Emax = numeric_limits<double>::lowest();
423
425 if (i->second < Emin) { Emin = i->second; }
426 if (i->second > Emax) { Emax = i->second; }
427 }
428
429 const double mu_range =
gWater(E);
430
431 double noise_likelihood = 0.0;
432 int number_of_hits = 0;
433
434 for (vector<JNPEHit>::const_iterator i =
data.begin(); i !=
data.end(); ++i) {
435 noise_likelihood += log10(
getP(i->getY0(), i->getN()));
436 number_of_hits += i->getN();
437 }
438
439 fit.push_back(event());
440
441
442
444
445 out.push_back(fit);
446
447
448
459 }
460 }
461
462
463
465
466 copy(input.in.begin(), input.in.end(), back_inserter(out));
467
468 return out;
469 }
#define DEBUG(A)
Message macros.
const JPMTParameters & getPMTParameters(const JPMTIdentifier &id) const
Get PMT parameters.
Data structure for PMT geometry, calibration and status.
Data structure for fit of energy.
Data structure for fit of straight line paralel to z-axis.
void transform(const JAxis3D &axis)
Transform axis to reference frame of given axis.
Data structure for position in three dimensions.
double getY() const
Get y position.
double getX() const
Get x position.
JEvt operator()(const input_type &input)
Fit function.
Reduced data structure for L0 hit.
JPMT_t getPMT() const
Get PMT.
int getN() const
Get count.
double getT() const
Get calibrated time of hit.
static const int JSTART_ZMAX_M
end position of track see JRECONSTRUCTION::JMuonStart
static const int JENERGY_NDF
number of degrees of freedom see JRECONSTRUCTION::JMuonEnergy
static const int JENERGY_ENERGY
uncorrected energy [GeV] see JRECONSTRUCTION::JMuonEnergy
static const int JENERGY_NOISE_LIKELIHOOD
log likelihood of every hit being K40 see JRECONSTRUCTION::JMuonEnergy
static const int JENERGY_CHI2
chi2 see JRECONSTRUCTION::JMuonEnergy
static const int JENERGY_MUON_RANGE_METRES
range of a muon with the reconstructed energy [m] see JRECONSTRUCTION::JMuonEnergy
static const int JPP_COVERAGE_POSITION
coverage of dynamic position calibration of this event
static const int JENERGY_NUMBER_OF_HITS
number of hits see JRECONSTRUCTION::JMuonEnergy
static const int JSTART_LENGTH_METRES
distance between projected positions on the track of optical modules for which the response does not ...
static const int JSTART_ZMIN_M
start position of track see JRECONSTRUCTION::JMuonStart
static const int JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration of this event
static const int JENERGY_MINIMAL_ENERGY
minimal energy [GeV] see JRECONSTRUCTION::JMuonEnergy
static const int JENERGY_MAXIMAL_ENERGY
maximal energy [GeV] see JRECONSTRUCTION::JMuonEnergy
double getNPE(const Hit &hit)
Get true charge of hit.
double getSurvivalProbability(const JPMTParameters ¶meters)
Get model dependent probability that a one photo-electron hit survives the simulation of the PMT assu...
double getP(const double expval, bool hit)
Get Poisson probability to observe a hit or not for given expectation value for the number of hits.
T pow(const T &x, const double y)
Power .
double getKappaC()
Get average R-dependence of arrival time of Cherenkov light (a.k.a.
const double getInverseSpeedOfLight()
Get inverse speed of light.
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
JPosition3D getPosition(const JFit &fit)
Get position.
void copy(const JFIT::JEvt::const_iterator __begin, const JFIT::JEvt::const_iterator __end, Evt &out)
Copy tracks.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JDirection3D getDirection(const JFit &fit)
Get direction.
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
Auxiliary class to test history.
Auxiliary class for simultaneously handling light yields and response of PMT.
size_t numberOfPrefits
number of prefits
double resolution
energy resolution [log10(GeV)]
double EMin_log
minimal energy [log10(GeV)]
double ZMin_m
minimal z-position [m]
double EMax_log
maximal energy [log10(GeV)]
Auxiliary data structure for floating point format specification.