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
257 }
258
261
262 double zmin = numeric_limits<double>::lowest();
263
266 }
267
269
270 for (const auto& module : input.data) {
271
273
274 pos.transform(R, tz.getPosition());
275
277
278 const double z1 = pos.getZ() - pos.getX() /
getTanThetaC();
280
281 if (z1 >= zmin) {
282
283 for (size_t i = 0; i != module->size(); ++i) {
284
285 if (module.getStatus(i)) {
286
287 const struct {
288
290 {
291 return (hit.
getPMT() == pmt && T_ns(hit.
getT()));
292 }
293
295 const size_t pmt;
296
297 } match = { T_ns + t1, i };
298
300
302
303 JPMT pmt =
module->getPMT(i);
304
306
307 const JNPEHit hit(this->
getNPE(pmt, module.frame.getRate(i)), count_if(module.begin(), module.end(), match), ps);
308
309 DEBUG(
"hit: " << setw(8) << module->getID() <<
'.' <<
FILL(2,
'0') << i <<
' '
311 <<
FIXED(7,3) << module.frame.getRate(i) * 1.0e-3 <<
' '
316 << setw(2) << hit.
getN() << endl);
317
319 }
320 }
321 }
322 }
323 }
324
326
327 if (NDF >= 0) {
328
329
330
331 const int N = 5;
332
334
335 for (int i = 0; i != N; ++i) {
337 }
338
340
341 do {
342
344
345 for (int i = 0; i != N; ++i) {
346
348
350 const double chi2 = (*this)(
x,
data.begin(),
data.end());
351
353 buffer[chi2] =
x.getE();
354 }
355
358 }
359 }
360
361
362 for (int i = 0; i != N; ++i) {
364 }
366
367
368
370
371 case 0:
375 break;
376
377 case 1:
380 break;
381
382 case 2:
385 break;
386
387 case 3:
390 break;
391
392 case 4:
396 break;
397 }
398
401
403
404
406
409
410 }
411
412 const double chi2 =
result[2].chi2;
413 const double E =
result[2].x.getE();
414
415
416
417 double Emin = numeric_limits<double>::max();
418 double Emax = numeric_limits<double>::lowest();
419
421 if (i->second < Emin) { Emin = i->second; }
422 if (i->second > Emax) { Emax = i->second; }
423 }
424
425 const double mu_range =
gWater(E);
426
427 double noise_likelihood = 0.0;
428 int number_of_hits = 0;
429
430 for (vector<JNPEHit>::const_iterator i =
data.begin(); i !=
data.end(); ++i) {
431 noise_likelihood += log10(
getP(i->getY0(), i->getN()));
432 number_of_hits += i->getN();
433 }
434
435 fit.push_back(event());
436
437
438
440
441 out.push_back(fit);
442
443
444
445 out.rbegin()->setW(track->getW());
456 }
457 }
458
459
460
462
463 copy(input.in.begin(), input.in.end(), back_inserter(out));
464
465 return out;
466 }
#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 JENERGY_NDF
number of degrees of freedom from JMuonEnergy
static const int JENERGY_ENERGY
uncorrected energy [GeV] from JMuonEnergy
static const int JENERGY_NOISE_LIKELIHOOD
log likelihood of every hit being K40 from JMuonEnergy
static const int JENERGY_CHI2
chi2 from JMuonEnergy
static const int JENERGY_MUON_RANGE_METRES
range of a muon with the reconstructed energy [m] from JMuonEnergy
static const int JPP_COVERAGE_POSITION
coverage of dynamic position calibration from any Jpp application
static const int JENERGY_NUMBER_OF_HITS
number of hits from 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 JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration from any Jpp application
static const int JENERGY_MINIMAL_ENERGY
minimal energy [GeV] from JMuonEnergy
static const int JENERGY_MAXIMAL_ENERGY
maximal energy [GeV] from 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.
static const int JSTART_ZMIN_M
start position of track
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.