1#ifndef __JRECONSTRUCTION__JMUONSTART__
2#define __JRECONSTRUCTION__JMUONSTART__
82 using JRegressor_t::operator();
128 const storage_type& storage,
130 const int debug = 0):
136 roadWidth_m = this->getRmax();
139 JRegressor_t::debug =
debug;
140 JRegressor_t::T_ns.setRange(parameters.
TMin_ns, parameters.
TMax_ns);
165 const JBuildL0 <JHitR0> buildL0;
172 for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
174 if (router.
hasModule(i->getModuleID())) {
176 buffer(*i, router.
getModule(i->getModuleID()));
178 buildL0(buffer, back_inserter(data[i->getModuleID()]));
183 if (!module.empty()) {
221 double getZ()
const {
return z; }
222 double getP()
const {
return p; }
230 for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
237 for (
const auto& module : input.
data) {
248 const double p =
module.getProbability(rates_Hz.getMultiplesRates(), JRegressor_t::T_ns + t);
253 for (
size_t i = 0; i !=
module->size(); ++i) {
255 if (module.getStatus(i)) {
257 JPMT pmt =
module->getPMT(i);
261 const double npe = this->getY1(pmt);
271 data.push_back({ z, p, y1, yx });
284 vector<JHit_t>::const_iterator q1 = start.
find(data. begin(), data. end());
285 vector<JHit_t>::const_reverse_iterator q2 = start.
find(data.rbegin(), data.rend());
287 if (q1 != data.end() && q2 != data.rend()) {
289 vector<JHit_t>::const_iterator
p1 = q1;
if (
p1 != data. begin()) { --
p1; }
290 vector<JHit_t>::const_reverse_iterator p2 = q2;
if (p2 != data.rbegin()) { --p2; }
292 Zmin = 0.5 * (
p1->getZ() + q1->getZ());
293 Zmax = 0.5 * (p2->getZ() + q2->getZ());
295 for (vector<JHit_t>::const_iterator i = q1; i != q2.base(); ++i) {
304 fit.push_back(event());
314 out.rbegin()->setW(track->getW());
326 copy(input.
in.begin(), input.
in.end(), back_inserter(out));
Coverage of dynamical detector calibration.
Auxiliary class to extract a subset of optical modules from a detector.
Data structure for detector geometry and calibration.
Data regression method for JFIT::JEnergy.
Basic data structure for L0 hit.
Reduced data structure for L1 hit.
Maximum likelihood estimator (M-estimators).
Direct access to module in detector data structure.
Auxiliary method to locate start and end point of muon trajectory.
Router for direct addressing of module data in detector data structure.
bool hasModule(const JObjectID &id) const
Has module.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Data structure for PMT geometry, calibration and status.
Data structure for fit of energy.
Data structure for set of track fit results.
void select(const JSelector_t &selector)
Select fits.
Data structure for track fit results with history and optional associated values.
void move(const double step, const double velocity)
Move vertex along this track with given velocity.
Data structure for fit of straight line paralel to z-axis.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
void transform(const JAxis3D &axis)
Transform axis to reference frame of given axis.
Data structure for position in three dimensions.
void transform(const JRotation3D &R, const JVector3D &pos)
Transform position.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
const JPosition3D & getPosition() const
Get position.
double getZ() const
Get z position.
double getX() const
Get x position.
const JClass_t & getReference() const
Get reference to object.
Auxiliary class to determine start and end position of muon trajectory.
std::vector< module_type > detector_type
JEvt operator()(const input_type &input)
Fit function.
JRegressor< JEnergy > JRegressor_t
input_type getInput(const JModuleRouter &router, const JSummaryRouter &summary, const JDAQEvent &event, const JEvt &in, const coverage_type &coverage)
Get input data.
JMuonStart(const JMuonStartParameters_t ¶meters, const storage_type &storage, const JK40Rates &rates_Hz, const int debug=0)
Constructor.
Router for fast addressing of summary data in KM3NETDAQ::JDAQSummaryslice data structure as a functio...
const JDAQSummaryFrame & getSummaryFrame() const
Get default summary frame.
JPMT_t getPMT() const
Get PMT.
2-dimensional frame with time calibrated data from one optical module.
unsigned char JPMT_t
PMT channel in FPGA.
Data storage class for rate measurements of all PMTs in one module.
static const int JMUONSTART
static const int JSTART_NPE_MIP_TOTAL
number of photo-electrons along the whole track from JStart.cc
static const int JPP_COVERAGE_POSITION
coverage of dynamic position calibration from any Jpp application
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 JSTART_NPE_MIP_MISSED
number of photo-electrons missed from JStart.cc
void copy(const Head &from, JHead &to)
Copy header from from to to.
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.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
double getKappaC()
Get average R-dependence of arrival time of Cherenkov light (a.k.a.
const double getInverseSpeedOfLight()
Get inverse speed of light.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
const double getSpeedOfLight()
Get speed of light.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JPosition3D getPosition(const JFit &fit)
Get position.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JDirection3D getDirection(const JFit &fit)
Get direction.
Auxiliary classes and methods for triggering.
Data structure for coverage of detector by dynamical calibrations.
double position
coverage of detector by available position calibration [0,1]
double orientation
coverage of detector by available orientation calibration [0,1]
Auxiliary class for historical event.
Auxiliary class to test history.
Template definition of a data regressor of given model.
Auxiliary class for K40 rates.
Auxiliary class for handling module response.
Data structure for fit parameters.
double roadWidth_m
road width [m]
size_t numberOfPrefits
number of prefits
int Nmax2
maximal number for twofold observations
double Pmin1
minimal probability single observation
double TMin_ns
minimal time w.r.t. Cherenkov hypothesis [ns]
double Pmin2
minimal probability for twofold observations
double TMax_ns
maximal time w.r.t. Cherenkov hypothesis [ns]
Auxiliary class for start or end point evaluation.
T find(T __begin, T __end) const
Get start point of muon trajectory.
Auxiliary class to set-up Hit.