Fit function.
198 {
201
203
205
206
207
209
211
213
215
217
219 }
220
221 in.erase(__end, in.end());
222 }
223
224 if (!in.empty()) {
226 }
227
229
231
232 double getZ() const { return z; }
233 double getP()
const {
return p; }
234
235 double z;
236 double p;
237 double y1;
238 double yx;
239 };
240
241 for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
242
245
247
248 for (const auto& module : input.data) {
249
251
252 pos.transform(R, tz.getPosition());
253
255
256 const double z = pos.getZ() - pos.getX() /
getTanThetaC();
258
259 const double p = module.getProbability(rates_Hz.getMultiplesRates(), T_ns + t);
260
261 double y1 = 0.0;
262 double yx = 0.0;
263
264 for (size_t i = 0; i != module->size(); ++i) {
265
266 if (module.getStatus(i)) {
267
268 JPMT pmt =
module->getPMT(i);
269
271
272 const double npe = this->getY1(pmt);
273
274 y1 += npe;
275
277 yx += npe;
278 }
279 }
280 }
281
282 data.push_back({ z, p, y1, yx });
283 }
284 }
285
286 double Zmin = 0.0;
287 double Zmax = 0.0;
288 double y1 = 0.0;
289 double yx = 0.0;
290 double pb = 0.0;
291
293
295
296 vector<JHit_t>::const_iterator q1 = start.find(
data. begin(),
data. end());
297 vector<JHit_t>::const_reverse_iterator q2 = start.find(
data.rbegin(),
data.rend());
298
299 if (q1 !=
data.end() && q2 !=
data.rend()) {
300
301 vector<JHit_t>::const_iterator
p1 = q1;
if (
p1 !=
data. begin()) { --
p1; }
302 vector<JHit_t>::const_reverse_iterator p2 = q2;
if (p2 !=
data.rbegin()) { --p2; }
303
304 Zmin = 0.5 * (
p1->getZ() + q1->getZ());
305 Zmax = 0.5 * (p2->getZ() + q2->getZ());
306
307 for (vector<JHit_t>::const_iterator i = q1; i != q2.base(); ++i) {
308 y1 += i->y1;
309 yx += i->yx;
310 pb += log(i->p >
Pmin ? i->p :
Pmin);
311 }
312 }
313 }
314
316
317 fit.push_back(event());
318
319
320
322
323 out.push_back(fit);
324
325
326
327 out.rbegin()->setW(track->getW());
334 }
335
336
337
339
340 copy(input.in.begin(), input.in.end(), back_inserter(out));
341
342 return out;
343 }
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 JSTART_NPE_MIP_TOTAL
number of photo-electrons along the whole track from JMuonStart
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_BACKGROUND_LOGP
summed logarithm of background probabilities from JMuonStart
static const int JSTART_NPE_MIP_MISSED
number of photo-electrons missed from JMuonStart
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.
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.
JDirection3D getDirection(const JFit &fit)
Get direction.
JEvt::iterator gridify(JEvt::iterator __begin, JEvt::iterator __end, const int N)
Gridify set of fits.
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 Pmin
minimal probability
double Pmin2
minimal probability for twofold observations
size_t numberOfPostfits
number of postfits
Auxiliary class for start or end point evaluation.
Auxiliary class to set-up Hit.