Fit function.
197 {
199 using namespace JFIT;
201
203
205
207
208
209
211
213
214 if (!in.empty()) {
216 }
217
218 for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
219
223
227 }
228
230
231
232
234
235 for (buffer_type::const_iterator i =
data.begin(); i !=
data.end(); ++i) {
236
238
239 hit.rotate(R);
240
241 if (match(hit)) {
242 buffer.push_back(hit);
243 }
244 }
245
246
247
249
250 buffer_type::iterator __end = unique(buffer.begin(), buffer.end(), equal_to<JDAQPMTIdentifier>());
251
252
253 const int NDF =
distance(buffer.begin(), __end) - this->parameters.size();
254
255 if (NDF > 0) {
256
257
258
259 if (track->getE() > 0.1)
260 JRegressor_t::E_GeV = track->getE();
261 else
263
264 const double chi2 = (*this)(
JLine3Z(tz), buffer.begin(), __end);
265
266
267
268 bool status = true;
269
270 for (size_t i = 0; i != this->V.size(); ++i) {
271 if (std::isnan(this->V(i,i)) || this->V(i,i) <= 0.0) {
272 status = false;
273 }
274 }
275
276 if (status) {
277
279
280 tb.rotate_back(R);
281
283
284
285
286 const size_t N = this->V.size();
287
288 TMatrixDSym M(N);
289
290 for (size_t row = 0; row != N; ++row) {
291 for (size_t col = 0; col != N; ++col) {
292 M(row,col) = this->V(row,col);
293 }
294 }
295
296 const TMatrixDSymEigen E(M);
297 const TVectorD& Y = E.GetEigenValues();
298
299 out.rbegin()->setV(this->V.size(), this->V);
300
301 out.rbegin()->setW(track->getW());
302 out.rbegin()->setW(
JGANDALF_BETA0_RAD, sqrt(this->error.getDX() * this->error.getDX() +
303 this->error.getDY() * this->error.getDY()));
304 out.rbegin()->setW(
JGANDALF_BETA1_RAD, sqrt(this->error.getDX() * this->error.getDY()));
310 }
311 }
312 }
313
314 {
315 for (JEvt::iterator i = out.begin(); i != out.end(); ++i) {
316
317 double Q = numeric_limits<double>::max();
318
319 for (JEvt::iterator p = out.begin(); p != out.end(); ++p) {
320 if (p != i) {
322 if (i->getQ() - p->getQ() < Q) {
323 Q = i->getQ() - p->getQ();
324 }
325 }
326 }
327 }
328
330 }
331 }
332
333
334
336
337 copy(input.in.begin(), input.in.end(), back_inserter(out));
338
339 return out;
340 }
Data structure for fit of straight line paralel to z-axis.
Data structure for fit of straight line in positive z-direction.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
static const int JGANDALF_LIKELIHOOD_RATIO
likelihood ratio between this and best alternative fit from JMuonGandalf
static const int JGANDALF_LAMBDA
largest eigenvalue of error matrix from JMuonGandalf
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 JGANDALF_BETA0_RAD
KM3NeT Data Definitions v3.6.1-2-g905a24d https://git.km3net.de/common/km3net-dataformat.
static const int JGANDALF_NUMBER_OF_ITERATIONS
number of iterations from JMuonGandalf
static const int JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration from any Jpp application
static const int JGANDALF_BETA1_RAD
uncertainty on the reconstructed track direction from the error matrix [rad] (to be deprecated) from ...
static const int JGANDALF_NUMBER_OF_HITS
number of hits from JMuonGandalf
Auxiliary classes and methods for linear and iterative data regression.
JTOOLS::JRange< double > JZRange
Auxiliary classes and methods for 3D geometrical objects and operations.
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.
double getDot(const JFit &first, const JFit &second)
Get dot product.
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.
Model for fit to acoustics data.
Transmission with position.
Auxiliary class to test history.
double cosLR
maximal cosine space angle likelihood ratio test
double ZMax_m
maximal z-positon [m]
double ZMin_m
minimal z-positon [m]
size_t numberOfPrefits
number of prefits
Auxiliary data structure for sorting of hits.