Fit function.
207 {
210
212
214
216
218
219 if (!in.empty()) {
221 }
222
223 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
224
226
228 const double time = shower->getT();
229
230 for (const auto& module : input.data) {
231
233 pos.sub(vertex);
234
235 if(pos.getLength() <=
DMax_m){
236
238
239 for (size_t i = 0; i != module->size(); ++i) {
240 if (module.getStatus(i)) {
241 struct {
242
244 {
245 return (hit.
getPMT() == pmt && T_ns(hit.
getT()));
246 }
247
249 const size_t pmt;
250
251 } match = { JRegressor_t::T_ns + t1, i };
252
253 JPMT pmt =
module->getPMT(i);
254
256
257 data.push_back(
JPMTW0(pmt, module.frame.getRate(i), count_if(module.begin(), module.end(), match)));
258
259 }
260 }
261 }
262 }
263
265 for (vector<JPMTW0>::const_iterator i =
data.begin(); i !=
data.end(); ++i) {
266 if (i->getN() != 0) start_dir.add(i->getPosition());
267 }
268
272
274
275 for (JOmega3D_t::const_iterator dir = scan_directions.begin(); dir != scan_directions.end(); ++dir) {
276
278
280
281 for (vector<JPMTW0>::const_iterator i =
data.begin(); i !=
data.end(); ++i) {
282
285
286 JNPE_t::result_type H1 = (*this).getH1(sh, pmt);
287 JNPE_t::result_type H0 = (*this).getH0(pmt.
getR());
288 const bool hit = pmt.
getN() != 0;
289
291
292 for (
size_t j=0;
j!=chi2.size(); ++
j) {
293
295
296 }
297
298 }
299
300
301
302 auto p = std::min_element(chi2.begin(), chi2.end());
303
308 Ev[p-chi2.begin()]));
309
310
313
314 }
315 }
316
317
318
320
321 copy(input.in.begin(), input.in.end(), back_inserter(out));
322
323 return out;
324
325 }
Data structure for PMT geometry, calibration and status.
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 & sub(const JVector3D &vector)
Subtract vector.
Data structure for normalised vector in positive z-direction.
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 from any Jpp application
static const int JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration from any Jpp application
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.
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.
Auxiliary class for handling PMT geometry, rate and response.
int getN() const
Get number of hits.
double getR() const
Get rate.
double scanAngle_deg
scanning angle step in [deg]
size_t numberOfPrefits
number of prefits
double DMax_m
maximal distance to optical module [m]