Fit function.
194 {
196 using namespace JFIT;
198
200
202
204
205
206
208
210
211 if (!in.empty()) {
213 }
214
215 for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
216
220
224 }
225
227
228
229
231
232 for (buffer_type::const_iterator i =
data.begin(); i !=
data.end(); ++i) {
233
235
236 hit.rotate(R);
237
238 if (match(hit)) {
239 buffer.push_back(hit);
240 }
241 }
242
243
244
246
247 buffer_type::iterator __end = unique(buffer.begin(), buffer.end(), equal_to<JDAQPMTIdentifier>());
248
249
250 const int NDF =
distance(buffer.begin(), __end) - this->parameters.size();
251
252 if (NDF > 0) {
253
254
255
256 if (track->getE() > 0.1)
257 JRegressor_t::E_GeV = track->getE();
258 else
260
261 const double chi2 = (*this)(
JLine3Z(tz), buffer.begin(), __end);
262
263
264
265 bool status = true;
266
267 for (size_t i = 0; i != this->V.size(); ++i) {
268 if (std::isnan(this->V(i,i)) || this->V(i,i) < 0.0) {
269 status = false;
270 }
271 }
272
273 if (status) {
274
276
277 tb.rotate_back(R);
278
280
281
282
283 out.rbegin()->setV(this->V.size(), this->V);
284
285 out.rbegin()->setW(track->getW());
286 out.rbegin()->setW(
JGANDALF_BETA0_RAD, sqrt(this->error.getDX() * this->error.getDX() +
287 this->error.getDY() * this->error.getDY()));
288 out.rbegin()->setW(
JGANDALF_BETA1_RAD, sqrt(this->error.getDX() * this->error.getDY()));
295 }
296 }
297 }
298
299
300
302
303 copy(input.in.begin(), input.in.end(), back_inserter(out));
304
305 return out;
306 }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
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 JMUONGANDALF
static const int JGANDALF_LAMBDA
control parameter from JGandalf.cc
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.0 https://git.km3net.de/common/km3net-dataformat.
static const int JGANDALF_NUMBER_OF_ITERATIONS
number of iterations from JGandalf.cc
static const int JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration from any Jpp application
static const int JGANDALF_BETA1_RAD
angular resolution [rad] from JGandalf.cc
static const int JGANDALF_NUMBER_OF_HITS
number of hits from JGandalf.cc
static const int JGANDALF_CHI2
chi2 from JGandalf.cc
void copy(const Head &from, JHead &to)
Copy header from from to to.
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.
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.
Model for fit to acoustics data.
Auxiliary class to test history.
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.