Fit function.
178 {
181
183
185
188
189
190
192
194
195 if (!in.empty()) {
197 }
198
199 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
200
202
204
206
207 data.reserve(dataL0.size() + dataL1.size());
208
209 for (buffer_type::const_iterator i = dataL1.begin(); i != dataL1.end(); ++i) {
210
211 if (match(*i)) {
213 }
214 }
215
216 buffer_type::iterator __end =
data.end();
217
218 for (buffer_type::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
220 if (match(*i)) {
222 }
223 }
224 }
225
226 const int NDF =
getCount(
data.begin(),
data.end()) - this->parameters.size();
227
228 if (NDF > 0) {
229
230 double chi2 = (*this)(vx,
data.begin(),
data.end());
231
233
235
236
237
240 }
241 }
243
244 JEvt::iterator __end = out.end();
245
247
248 __end = out.begin();
249
251
252 JEvt::iterator p2 =
p1;
253
254 for (JEvt::iterator i =
p1; i != out.end(); ++i) {
256 p2 = i;
257 }
258 }
259
261
263
265
266 sort(
p1, out.end(), point);
267
268 for (double Q = p2->getQ();
273 }
274
275 swap(*(__end++), *p2);
276 }
277
278 } else {
279
281
283 }
284
285 out.erase(__end, out.end());
286
287 } else {
288
290 }
291
292 copy(input.in.begin(), input.in.end(), back_inserter(out));
293
294 return out;
295 }
Data structure for vertex fit.
Data structure for direction in three dimensions.
Auxiliary class to compare fit results with respect to a reference 4D-position.
int getModuleID() const
Get module identifier.
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
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [ns]).
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.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
Auxiliary class to test history.
Auxiliary class to match data points with given model.
double TMin_ns
minimum time for local coincidences [ns]
double Qwatershed
quality threshold
double TMax_ns
maximum time for local coincidences [ns]
double DMax_m
maximal distance to optical module [m]
size_t numberOfPostfits
number of postfits
size_t numberOfPrefits
number of prefits