Fit function.
212 {
215
217
219
221
223
224 if (!in.empty()) {
226 }
227
228 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
229
231
233 const double time = shower->getT();
236
237 for (const auto& module : input.data) {
238
240 pos.sub(vertex);
241
243
244 for (size_t i = 0; i != module->size(); ++i) {
245 if (module.getStatus(i)) {
246
248
249 struct {
250
252 {
253 return (hit.
getPMT() == pmt && T_ns(hit.
getT()));
254 }
255
257 const size_t pmt;
258
259 } match = { JRegressor_t::T_ns + t1, i };
260
261 JPMT pmt =
module->getPMT(i);
264
265 data.push_back(
JPMTW0(pmt, module.frame.getRate(i), count_if(module.begin(), module.end(), match)));
266 }
267 }
268 }
269 }
270
271
273 shower->getE()),
data.begin(),
data.end());
274
276
277 JShower3E sh_fit(this->value.getPosition(), this->value.getDirection(),
278 this->value.getT(),
correct(this->value.getE()));
279
280
281 bool status = true;
282
283 for (size_t i = 0; i != this->V.size(); ++i) {
284 if (std::isnan(this->V(i,i)) || this->V(i,i) < 0.0) {
285 status = false;
286 }
287 }
288
289 if (status) {
290 sh_fit.rotate_back(R);
291
292 sh_fit.add(vertex.getPosition());
293
295 NDF, sh_fit.getE()));
296 out.rbegin()->setV(this->V.size(), this->V);
300 }
301 }
302
303
304
306
307 copy(input.in.begin(), input.in.end(), back_inserter(out));
308
309 return out;
310 }
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 PMT geometry, calibration and status.
Data structure for fit of straight line in positive z-direction with energy.
JAxis3D & rotate(const JRotation3D &R)
Rotate axis.
Data structure for position in three dimensions.
Data structure for vector in three dimensions.
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Data structure for normalised vector in positive z-direction.
JEvt operator()(const input_type &input)
Fit function.
Reduced data structure for L0 hit.
JPMT_t getPMT() const
Get PMT.
double getT() const
Get calibrated time of hit.
static const int JSHOWERDIRECTIONPREFIT
static const int JSHOWERCOMPLETEFIT
static const int JPP_COVERAGE_POSITION
coverage of dynamic position calibration from any Jpp application
static const int JSHOWERFIT_ENERGY
uncorrected energy [GeV] from JShowerFit.cc
static const int JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration from any Jpp application
void copy(const Head &from, JHead &to)
Copy header from from to to.
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
const double getInverseSpeedOfLight()
Get inverse speed of light.
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.
Auxiliary class to test history.
JHistory & add(const int type)
Add event to history.
Auxiliary class for handling PMT geometry, rate and response.
double DMax_m
maximal distance to optical module [m]
double DStep_m
step increase for the distance to optical module [m]
size_t numberOfPrefits
number of prefits