Fit function.
208 {
211
213
215
217
219
220 if (!in.empty()) {
222 }
223
224 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
225
227
229 const double time = shower->getT();
230
231 for (const auto& module : input.data) {
232
234 pos.sub(vertex);
235
236 if(pos.getLength() <=
DMax_m){
237
239
240 for (size_t i = 0; i != module->size(); ++i) {
241 if (module.getStatus(i)) {
242 struct {
243
245 {
246 return (hit.
getPMT() == pmt && T_ns(hit.
getT()));
247 }
248
250 const size_t pmt;
251
252 } match = { JRegressor_t::T_ns + t1, i };
253
254 JPMT pmt =
module->getPMT(i);
255
257
258 data.push_back(
JPMTW0(pmt, module.frame.getRate(i), count_if(module.begin(), module.end(), match)));
259
260 }
261 }
262 }
263 }
264
266 for (vector<JPMTW0>::const_iterator i =
data.begin(); i !=
data.end(); ++i) {
267 if (i->getN() != 0) start_dir.add(i->getPosition());
268 }
269
273
275
276 for (JOmega3D_t::const_iterator dir = scan_directions.begin(); dir != scan_directions.end(); ++dir) {
277
279
281
282 for (vector<JPMTW0>::const_iterator i =
data.begin(); i !=
data.end(); ++i) {
283
286
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;
290
292
293 for (
size_t j=0;
j!=chi2.size(); ++
j) {
294
296
297 }
298
299 }
300
301
302
303 auto p = std::min_element(chi2.begin(), chi2.end());
304
309 Ev[p-chi2.begin()]));
310
311
314
315 }
316 }
317
318
319
321
322 copy(input.in.begin(), input.in.end(), back_inserter(out));
323
324 return out;
325
326 }
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 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.
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]