Fit function.
301 {
304
306
308
310
312
313 if (!in.empty()) {
315 }
316
317 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
318
320
322 const double time = shower->getT();
323
324 for (const auto& module : input.data) {
325
327
328 pos.sub(vertex);
329
330 if (pos.getLength() <=
DMax_m) {
331
333
334 for (size_t i = 0; i != module->size(); ++i) {
335
336 if (module.getStatus(i)) {
337
338 struct {
339
341 {
342 return (hit.
getPMT() == pmt && T_ns(hit.
getT()));
343 }
344
346 const size_t pmt;
347
348 } match = { JRegressor_t::T_ns + t1, i };
349
351
353
354 const size_t ns = count_if(module.begin(), module.end(), match);
355 const double QE = wip.
QE;
356
357 JPMT pmt =
module->getPMT(i);
358
360
361 data.push_back(
JPMTW0(pmt, QE, module.frame.getRate(i), ns));
362
363 }
364 }
365 }
366 }
367
369
370 for (vector<JPMTW0>::const_iterator i =
data.begin(); i !=
data.end(); ++i) {
371 if (i->getN() != 0) start_dir.add(i->getPosition());
372 }
373
377
379
380 for (JOmega3D_t::const_iterator dir = scan_directions.begin(); dir != scan_directions.end(); ++dir) {
381
383
385
391
392
395
396 }
397 }
398
399
400
402
403 copy(input.in.begin(), input.in.end(), back_inserter(out));
404
405 return out;
406
407 }
const JPMTParameters & getPMTParameters(const JPMTIdentifier &id) const
Get PMT parameters.
Data structure for PMT parameters.
double QE
relative quantum efficiency
Data structure for PMT geometry, calibration and status.
Data structure for fit of straight line in positive z-direction with energy.
Data structure for direction in three dimensions.
Direction set covering (part of) solid angle.
Data structure for position in three dimensions.
Data structure for vector in three dimensions.
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Data structure for normalised vector in positive z-direction.
std::pair< double, double > findBestEnergy(std::vector< double > Ev, const std::vector< JFIT::JPMTW0 > &data, const JGEOMETRY3D::JRotation3D &R, const JShower3EZ &sh)
Find best energy iteratively increasing the upper threshold if there is suspicion the best-fit is out...
JEvt operator()(const input_type &input)
Fit function.
Reduced data structure for L0 hit.
JPMT_t getPMT() const
Get PMT.
double getT() const
Get calibrated time of hit.
static const int JPP_COVERAGE_POSITION
coverage of dynamic position calibration of this event
static const int JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration of this event
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
const double getInverseSpeedOfLight()
Get inverse speed of light.
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
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.
JFit getFit(const JHistory &history, const JTrack3D &track, const double Q, const int NDF, const double energy=0.0, const int status=SINGLE_STAGE)
Get fit.
Auxiliary class to test history.
double scanAngle_deg
scanning angle step in [deg]
size_t numberOfPrefits
number of prefits
double DMax_m
maximal distance to optical module [m]