1#ifndef JSHOWERDIRECTIONPREFIT_INCLUDE
2#define JSHOWERDIRECTIONPREFIT_INCLUDE
79 public JRegressor<JShower3EZ, JAbstractMinimiser>
85 using JRegressor_t::operator();
132 const storage_type& storage,
133 const int debug = 0):
139 JRegressor_t::debug =
debug;
140 JRegressor_t::T_ns.setRange(parameters.
TMin_ns, parameters.
TMax_ns);
149 for (
int i = 0; i !=
En; ++i) {
175 const JBuildL0 <JHitR0> buildL0;
182 for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
184 if (router.
hasModule(i->getModuleID())) {
186 buffer(*i, router.
getModule(i->getModuleID()));
188 buildL0(buffer, back_inserter(data[i->getModuleID()]));
193 if (!module.empty()) {
224 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
229 const double time = shower->getT();
231 for (
const auto& module : input.
data) {
240 for (
size_t i = 0; i !=
module->size(); ++i) {
241 if (module.getStatus(i)) {
246 return (hit.
getPMT() == pmt && T_ns(hit.
getT()));
252 } match = { JRegressor_t::T_ns + t1, i };
254 JPMT pmt =
module->getPMT(i);
258 data.push_back(
JPMTW0(pmt, module.frame.getRate(i), count_if(module.begin(), module.end(), match)));
266 for (vector<JPMTW0>::const_iterator i = data.begin(); i != data.end(); ++i) {
267 if (i->getN() != 0) start_dir.
add(i->getPosition());
276 for (JOmega3D_t::const_iterator dir = scan_directions.begin(); dir != scan_directions.end(); ++dir) {
282 for (vector<JPMTW0>::const_iterator i = data.begin(); i != data.end(); ++i) {
287 JNPE_t::result_type H1 = (*this).getH1(sh, pmt);
288 JNPE_t::result_type H0 = (*this).getH0(pmt.
getR());
289 const bool hit = pmt.
getN() != 0;
293 for (
size_t j=0;
j!=chi2.size(); ++
j) {
303 auto p = std::min_element(chi2.begin(), chi2.end());
309 Ev[p-chi2.begin()]));
322 copy(input.
in.begin(), input.
in.end(), back_inserter(out));
Algorithms for hit clustering and sorting.
Coverage of dynamical detector calibration.
Auxiliary class to extract a subset of optical modules from a detector.
Data structure for detector geometry and calibration.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Basic data structure for L0 hit.
Basic data structure for L1 hit.
Basic data structure for L0 hit.
Reduced data structure for L1 hit.
Match operator for Cherenkov light from shower in any direction.
Data regression method for JFIT::JShower3EZ.
Basic data structure for time and time over threshold information of hit.
Properties of KM3NeT PMT and deep-sea water.
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 fit of straight line in positive z-direction with energy.
JAxis3D & rotate(const JRotation3D &R)
Rotate axis.
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 & add(const JVector3D &vector)
Add vector.
double getLength() const
Get length.
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Data structure for normalised vector in positive z-direction.
const JClass_t & getReference() const
Get reference to object.
class to handle the direction fit of the shower reconstruction, mainly dedicated for ORCA
std::vector< module_type > detector_type
input_type getInput(const JModuleRouter &router, const JSummaryRouter &summary, const JDAQEvent &event, const JEvt &in, const coverage_type &coverage) const
Get input data.
JEvt operator()(const input_type &input)
Fit function.
JShowerDirectionPrefit(const JShowerDirectionPrefitParameters_t ¶meters, const storage_type &storage, const int debug=0)
Parameterized constructor.
JRegressor< JShower3EZ, JAbstractMinimiser > JRegressor_t
Router for fast addressing of summary data in KM3NETDAQ::JDAQSummaryslice data structure as a functio...
const JDAQSummaryFrame & getSummaryFrame(const JDAQModuleIdentifier &module) const
Get summary frame.
Reduced data structure for L0 hit.
JPMT_t getPMT() const
Get PMT.
double getT() const
Get calibrated time of hit.
2-dimensional frame with time calibrated data from one optical module.
Data storage class for rate measurements of all PMTs in one module.
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 getChi2(const double P)
Get chi2 corresponding to given probability.
static const double PI
Mathematical constants.
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
const double getInverseSpeedOfLight()
Get inverse speed of light.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
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 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.
Auxiliary class for handling PMT geometry, rate and response.
int getN() const
Get number of hits.
double getR() const
Get rate.
Template definition of a data regressor of given model.
Auxiliary class for handling module response.
Data structure for fit parameters.
double scanAngle_deg
scanning angle step in [deg]
double Emin_GeV
minimum energy to scan
double TMin_ns
minimum time for local coincidences [ns]
double TMax_ns
maximum time for local coincidences [ns]
double R_Hz
default rate [Hz]
double Emax_GeV
maximum energy to scan
int En
number of points to scan in energy range
double VMax_npe
maximum number of of photo-electrons
size_t numberOfPrefits
number of prefits
double DMax_m
maximal distance to optical module [m]