Fit function.
185 {
188
190
192
194
195 for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
196
200
202
203 for (buffer_type::const_iterator i =
data.begin(); i !=
data.end(); ++i) {
204
206
207 hit.rotate(R);
208
209 if (match(hit)) {
210 top[hit.getModuleID()].insert(hit.getPMTAddress());
211 }
212 }
213
215
216 double getZ() const { return z; }
217 double getP()
const {
return p; }
218
219 double z;
220 double p;
221 };
222
224
225 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
226
228
230
232
233 pos.transform(R, tz.getPosition());
234
236
237 const double z = pos.getZ() - pos.getX() /
getTanThetaC();
238
240
241 data.push_back({ z, p });
242 }
243 }
244 }
245
246 double Zmin = 0.0;
247 double Zmax = 0.0;
248 double npe_total = 0.0;
249 double npe_missed = 0.0;
250
252
254
255 vector<JHit_t>::const_iterator track_start = start.find(
data. begin(),
data. end());
256 vector<JHit_t>::const_reverse_iterator track_end = start.find(
data.rbegin(),
data.rend());
257
258 if (track_start !=
data. end()) { Zmin = track_start->getZ(); }
259 if (track_end !=
data.rend()) { Zmax = track_end ->getZ(); }
260
261
262
263 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
264
266
267 pos.transform(R, tz.getPosition());
268
270
271 const double z = pos.getZ() - pos.getX() /
getTanThetaC();
272
273 if (z >= Zmin && z <= Zmax) {
274
275 for (size_t i = 0; i != module->size(); ++i) {
276
278
283
284 JPMT pmt =
module->getPMT(i);
285
287
288 const double ya = this->
getNPE(pmt, 0.0).getYA();
289
290 npe_total += ya;
291
292 if (top[module->getID()].count(i) == 0) {
293 npe_missed += ya;
294 }
295 }
296 }
297 }
298 }
299 }
300 }
301
303
304
305
307
309
310 out.rbegin()->setW(track->getW());
314 }
315
316 return out;
317 }
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.
const JClass_t & getReference() const
Get reference to object.
bool hasSummaryFrame(const JDAQModuleIdentifier &module) const
Has summary frame.
const JDAQSummaryFrame & getSummaryFrame() const
Get default summary frame.
Data storage class for rate measurements of all PMTs in one module.
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 JSTART_LENGTH_METRES
distance between first and last hits in metres from JStart.cc
static const int JSTART_NPE_MIP_MISSED
number of photo-electrons missed from JStart.cc
double getNPE(const Hit &hit)
Get true charge of hit.
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 getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
const double getSpeedOfLight()
Get speed of light.
JPosition3D getPosition(const JFit &fit)
Get position.
JDirection3D getDirection(const JFit &fit)
Get direction.
double getProbability(const JModule &module, const JDAQSummaryFrame &frame, const JRateL1_t &R_Hz, const double T_ns, const std::multiset< int > &top)
Get probability of given response in optical module due to random background.
bool is_valid(const json &js)
Check validity of JSon data.
bool getDAQStatus(const JDAQFrameStatus &frame, const JStatus &status)
Test status of DAQ.
bool getPMTStatus(const JStatus &status)
Test status of PMT.
static const int PMT_DISABLE
KM3NeT Data Definitions v3.4.0-8-ge14cb17 https://git.km3net.de/common/km3net-dataformat.
Auxiliary class to match data points with given model.
const JRateL1_t & getMultiplesRates() const
Get multiples rate.
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.