Fit function.
199 {
202
204
206
207
208
210
212
213 if (!in.empty()) {
215 }
216
218
220
221 double getZ() const { return z; }
222 double getP()
const {
return p; }
223
224 double z;
225 double p;
226 double y1;
227 double yx;
228 };
229
230 for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
231
234
236
237 for (const auto& module : input.data) {
238
240
241 pos.transform(R, tz.getPosition());
242
244
245 const double z = pos.getZ() - pos.getX() /
getTanThetaC();
247
248 const double p = module.getProbability(rates_Hz.getMultiplesRates(), JRegressor_t::T_ns + t);
249
250 double y1 = 0.0;
251 double yx = 0.0;
252
253 for (size_t i = 0; i != module->size(); ++i) {
254
255 if (module.getStatus(i)) {
256
257 JPMT pmt =
module->getPMT(i);
258
260
261 const double npe = this->getY1(pmt);
262
263 y1 += npe;
264
266 yx += npe;
267 }
268 }
269 }
270
271 data.push_back({ z, p, y1, yx });
272 }
273 }
274
275 double Zmin = 0.0;
276 double Zmax = 0.0;
277 double y1 = 0.0;
278 double yx = 0.0;
279
281
283
284 vector<JHit_t>::const_iterator q1 = start.find(
data. begin(),
data. end());
285 vector<JHit_t>::const_reverse_iterator q2 = start.find(
data.rbegin(),
data.rend());
286
287 if (q1 !=
data.end() && q2 !=
data.rend()) {
288
289 vector<JHit_t>::const_iterator
p1 = q1;
if (
p1 !=
data. begin()) { --
p1; }
290 vector<JHit_t>::const_reverse_iterator p2 = q2;
if (p2 !=
data.rbegin()) { --p2; }
291
292 Zmin = 0.5 * (
p1->getZ() + q1->getZ());
293 Zmax = 0.5 * (p2->getZ() + q2->getZ());
294
295 for (vector<JHit_t>::const_iterator i = q1; i != q2.base(); ++i) {
296 y1 += i->y1;
297 yx += i->yx;
298 }
299 }
300 }
301
303
304 fit.push_back(event());
305
306
307
309
310 out.push_back(fit);
311
312
313
314 out.rbegin()->setW(track->getW());
320 }
321
322
323
325
326 copy(input.in.begin(), input.in.end(), back_inserter(out));
327
328 return out;
329 }
Data structure for PMT geometry, calibration and status.
Data structure for fit of straight line paralel to z-axis.
void transform(const JAxis3D &axis)
Transform axis to reference frame of given axis.
Data structure for position in three dimensions.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
JPMT_t getPMT() const
Get PMT.
unsigned char JPMT_t
PMT channel in FPGA.
static const int JMUONSTART
static const int JSTART_NPE_MIP_TOTAL
number of photo-electrons along the whole track from JStart.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 JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration from any Jpp application
static const int JSTART_NPE_MIP_MISSED
number of photo-electrons missed from JStart.cc
void copy(const Head &from, JHead &to)
Copy header from from to to.
double getP(const double expval, bool hit)
Get Poisson probability to observe a hit or not for given expectation value for the number of hits.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
double getKappaC()
Get average R-dependence of arrival time of Cherenkov light (a.k.a.
const double getInverseSpeedOfLight()
Get inverse speed of light.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
const double getSpeedOfLight()
Get speed of light.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JPosition3D getPosition(const JFit &fit)
Get position.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JDirection3D getDirection(const JFit &fit)
Get direction.
Auxiliary class to test history.
size_t numberOfPrefits
number of prefits
int Nmax2
maximal number for twofold observations
double Pmin1
minimal probability single observation
double Pmin2
minimal probability for twofold observations
Auxiliary class for start or end point evaluation.
Auxiliary class to set-up Hit.