Fit function.
202 {
205
207
209
211
213
214 if (!in.empty()) {
216 }
217
218 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
219
221
223 const double time = shower->getT();
226
227 for (const auto& module : input.data) {
228
230
231 pos.sub(vertex);
232
234
235 for (size_t i = 0; i != module->size(); ++i) {
236
237 if (module.getStatus(i)) {
238
240
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
254
256
257 const size_t ns = count_if(module.begin(), module.end(), match);
258 const double QE = wip.
QE;
259
260 JPMT pmt =
module->getPMT(i);
261
264
265 data.push_back(
JPMTW0(pmt, QE, module.frame.getRate(i), ns));
266 }
267 }
268 }
269 }
270
271
273 shower->getE()),
data.begin(),
data.end());
274
276
278
279
280 bool status = true;
281
282 for (size_t i = 0; i != this->V.size(); ++i) {
283 if (std::isnan(this->V(i,i)) || this->V(i,i) < 0.0) {
284 status = false;
285 }
286 }
287
288 if (status) {
289
291
292 result.add(vertex.getPosition());
293
294
296
297 out.rbegin()->setW(shower->getW());
298
299 const size_t N = this->V.size();
300
301 TMatrixDSym M(N);
302
303 for (size_t row = 0; row != N; ++row) {
304 for (size_t col = 0; col != N; ++col) {
305 M(row,col) = this->V(row,col);
306 }
307 }
308
309 const TMatrixDSymEigen E(M);
310 const TVectorD& Y = E.GetEigenValues();
311
312 out.rbegin()->setV(this->V.size(), this->V);
313
316
319
320 }
321 }
322
323
324
326
327 copy(input.in.begin(), input.in.end(), back_inserter(out));
328
329 return out;
330 }
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.
JAxis3D & rotate(const JRotation3D &R)
Rotate axis.
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 JSHOWERFIT_LAMBDA
largest eigenvalue of error matrix for direction and energy fit see JRECONSTRUCTION::JShowerFit
static const int JSHOWERFIT_ENERGY
uncorrected energy [GeV] see JRECONSTRUCTION::JShowerFit
static const int JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration of this event
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
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.
JDirection3D getDirection(const JFit &fit)
Get direction.
Auxiliary class to test history.
Auxiliary class for handling PMT geometry, rate and response.
double DMax_m
maximal distance to optical module [m]
double DStep_m
step increase for the distance to optical module [m]
size_t numberOfPrefits
number of prefits