Fit function.
196 {
198 using namespace JFIT;
200
202
204
206
208
209 if (!in.empty()) {
211 }
212
213
214
215 struct {
216 size_t nhits = 0;
217 int id = -1;
218 } snapshot;
219
220 for (const auto& module : input.data) {
221 if (module.size() != 0) {
222
223 size_t snapshot_hits = 0;
224
225 for (size_t i = 0; i != module->size(); ++i) {
226
227 if (module.getStatus(i)) {
228
229 const size_t nhits = std::count_if(
230 module.begin(),
231 module.end(),
233 return hit.getPMT() == i;
234 }
235 );
236
237 if (nhits > 0) snapshot_hits++;
238 }
239 }
240
241 if (snapshot_hits > snapshot.nhits){
242 snapshot.nhits = snapshot_hits;
243 snapshot.id = module->getID();
244 }
245 }
246 }
247
248 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
249
250
251 struct {
252 double Dmin = numeric_limits<double>::max();
253 int id = -1;
254 } vertex;
255
256 for (const auto& module : input.data) {
257 if (module->getFloor() != 0) {
258
260
261 if (D < vertex.Dmin) {
262
263 vertex.Dmin = D;
264 vertex.id = module->getID();
265
266 }
267 }
268 }
269
275
276 }
277
278
279
281
282 copy(input.in.begin(), input.in.end(), back_inserter(out));
283
284 return out;
285 }
JFit & add(const int type)
Add event to history.
Reduced data structure for L0 hit.
static const int JSHOWERFEATURES_DMIN
mininal distance between shower vertex and any optical module [m] see JRECONSTRUCTION::JShowerFeature...
static const int JSHOWERFEATURES_NSNAPSHOT
maximum number of PMT with at least one snapshot hit in any DOM see JRECONSTRUCTION::JShowerFeatures
static const int JSHOWERFEATURES_DMIN_MODULEID
optical module identifier for which the distance to the shower vertex was mininal see JRECONSTRUCTION...
static const int JSHOWERFEATURES_NSNAPSHOT_MODULEID
optical module identifier for which the number of PMT with at least one snapshot hit was maximal see ...
Auxiliary classes and methods for 3D geometrical objects and operations.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
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.
Auxiliary class to test history.
size_t numberOfPrefits
number of prefits