Jpp in_tag_pdf_generation
the software that should make you happy
Loading...
Searching...
No Matches
JReconstruction/JEvtToolkit.hh
Go to the documentation of this file.
1#ifndef __JRECONSTRUCTION__JEVTTOOLKIT__
2#define __JRECONSTRUCTION__JEVTTOOLKIT__
3
4#include <string>
5#include <istream>
6#include <ostream>
7#include <map>
8#include <algorithm>
9#include <cmath>
10
13
14#include "JLang/JException.hh"
15#include "JLang/JPredicate.hh"
16#include "JLang/JFind_if.hh"
17#include "JTools/JRange.hh"
26#include "JMath/JMathToolkit.hh"
27#include "JMath/JConstants.hh"
28#include "JTools/JRange.hh"
30
31#include "JFit/JLine1Z.hh"
32#include "JFit/JShower3EZ.hh"
33
37
38
39/**
40 * \author mdejong
41 */
42
43using namespace std;
44
45namespace JRECONSTRUCTION {}
46namespace JPP { using namespace JRECONSTRUCTION; }
47
48/**
49 * Model fits to data.
50 */
51namespace JRECONSTRUCTION {
52
63 using JTOOLS::JRange;
64 using JFIT::JLine1Z;
65 using JFIT::JShower3Z;
66
67
68 /**
69 * Auxiliary data structure to get weight of given fit.
70 */
71 static struct JWeight :
72 public std::map<std::string, int>
73 {
74 /**
75 * Default constructor.
76 */
78 {
79#define MAKE_ENTRY(A) std::make_pair(#A, A)
80
81 this->insert(MAKE_ENTRY(JGANDALF_BETA0_RAD));
82 this->insert(MAKE_ENTRY(JGANDALF_BETA1_RAD));
83 this->insert(MAKE_ENTRY(JGANDALF_CHI2));
85 this->insert(MAKE_ENTRY(JENERGY_ENERGY));
86 this->insert(MAKE_ENTRY(JENERGY_CHI2));
87 this->insert(MAKE_ENTRY(JGANDALF_LAMBDA));
89 this->insert(MAKE_ENTRY(JSTART_NPE_MIP));
90 this->insert(MAKE_ENTRY(JSTART_NPE_MIP_TOTAL));
91 this->insert(MAKE_ENTRY(JSTART_NPE_MIP_MISSED));
92 this->insert(MAKE_ENTRY(JSTART_LENGTH_METRES));
93 this->insert(MAKE_ENTRY(JVETO_NPE));
94 this->insert(MAKE_ENTRY(JVETO_NUMBER_OF_HITS));
97 this->insert(MAKE_ENTRY(JENERGY_NDF));
99 this->insert(MAKE_ENTRY(JCOPY_Z_M));
101 this->insert(MAKE_ENTRY(JPP_COVERAGE_POSITION));
102 this->insert(MAKE_ENTRY(JENERGY_MINIMAL_ENERGY));
103 this->insert(MAKE_ENTRY(JENERGY_MAXIMAL_ENERGY));
104 this->insert(MAKE_ENTRY(JSHOWERFIT_ENERGY));
105 this->insert(MAKE_ENTRY(AASHOWERFIT_ENERGY));
107
108#undef MAKE_ENTRY
109 }
110
111
112 /**
113 * Has weight.
114 *
115 * \param key key
116 * \return true if valid key; else false
117 */
118 bool operator()(const std::string& key) const
119 {
120 return this->count(key) != 0;
121 }
122
123
124 /**
125 * Get weight.
126 *
127 * \param fit fit
128 * \param key key
129 * \param value default value
130 * \return value
131 */
132 double operator()(const JFit& fit, const std::string& key, const double value) const
133 {
134 const_iterator p = this->find(key);
135
136 if (p != this->end() && fit.hasW(p->second))
137 return fit.getW(p->second);
138 else
139 return value;
140 }
141
143
144
145 /**
146 * Get position.
147 *
148 * \param fit fit
149 * \return position
150 */
151 inline JPosition3D getPosition(const JFit& fit)
152 {
153 return JPosition3D(fit.getX(), fit.getY(), fit.getZ());
154 }
155
156
157 /**
158 * Get direction.
159 *
160 * \param fit fit
161 * \return direction
162 */
163 inline JDirection3D getDirection(const JFit& fit)
164 {
165 return JDirection3D(fit.getDX(), fit.getDY(), fit.getDZ());
166 }
167
168
169 /**
170 * Get axis.
171 *
172 * \param fit fit
173 * \return axis
174 */
175 inline JAxis3D getAxis(const JFit& fit)
176 {
177 return JAxis3D(getPosition(fit), getDirection(fit));
178 }
179
180
181 /**
182 * Get track.
183 *
184 * \param fit fit
185 * \return track
186 */
187 inline JTrack3E getTrack(const JFit& fit)
188 {
189 return JTrack3E(JTrack3D(getAxis(fit), fit.getT()), fit.getE());
190 }
191
192
193 /**
194 * Get fit.
195 *
196 * \param history history
197 * \param track track
198 * \param Q quality
199 * \param NDF number of degrees of freedom
200 * \param energy Energy, which would be set as 0, if the fit does not reconstruct energy
201 * \param status status of the fit as defined in enum JFitStatus.hh
202 * \return fit
203 */
204 inline JFit getFit(const JHistory& history,
205 const JTrack3D& track,
206 const double Q,
207 const int NDF,
208 const double energy = 0.0,
209 const int status = SINGLE_STAGE)
210 {
211 return JFit(history,
212 track.getX(), track.getY(), track.getZ(),
213 track.getDX(), track.getDY(), track.getDZ(),
214 track.getT(),
215 Q, NDF,
216 energy, status);
217 }
218
219
220 /**
221 * Get fit.
222 *
223 * \param history history
224 * \param track track
225 * \param angle angle
226 * \param Q quality
227 * \param NDF number of degrees of freedom
228 * \param energy Energy, which would be set as 0, if the fit does not reconstruct energy
229 * \param status status of the fit as defined in JFitStatus.hh
230 * \return fit
231 */
232 inline JFit getFit(const JHistory& history,
233 const JLine1Z& track,
234 const JAngle3D& angle,
235 const double Q,
236 const int NDF,
237 const double energy = 0.0,
238 const int status = SINGLE_STAGE)
239 {
240 return JFit(history,
241 track.getX(), track.getY(), track.getZ(),
242 angle.getDX(), angle.getDY(), angle.getDZ(),
243 track.getT(),
244 Q, NDF,
245 energy, status);
246 }
247
248
249 /**
250 * Get dot product.
251 *
252 * \param first first fit
253 * \param second second fit
254 * \return dot product
255 */
256 inline double getDot(const JFit& first, const JFit& second)
257 {
258 return JMATH::getDot(getDirection(first), getDirection(second));
259 }
260
261
262 /**
263 * Get dot product.
264 *
265 * \param fit fit
266 * \param dir direction
267 * \return dot product
268 */
269 inline double getDot(const JFit& fit, const JVersor3D& dir)
270 {
271 return JMATH::getDot(getDirection(fit), dir);
272 }
273
274
275 /**
276 * Get space angle.
277 *
278 * \param first first fit
279 * \param second second fit
280 * \return angle [deg]
281 */
282 inline double getAngle(const JFit& first, const JFit& second)
283 {
284 return JMATH::getAngle(getDirection(first), getDirection(second));
285 }
286
287
288 /**
289 * Get space angle.
290 *
291 * \param fit fit
292 * \param dir direction
293 * \return angle [deg]
294 */
295 inline double getAngle(const JFit& fit, const JVersor3D& dir)
296 {
297 return JMATH::getAngle(getDirection(fit), dir);
298 }
299
300
301 /**
302 * Get quality of fit.\n
303 * The larger the quality, the better the fit.
304 *
305 * \param chi2 chi2
306 * \param N number of hits
307 * \param NDF number of degrees of freedom
308 * \return quality
309 */
310 inline double getQuality(const double chi2, const int N, const int NDF)
311 {
312 return N - 0.25 * chi2 / NDF;
313 }
314
315
316 /**
317 * Get quality of fit.\n
318 * The larger the quality, the better the fit.
319 *
320 * \param chi2 chi2
321 * \param NDF number of degrees of freedom
322 * \return quality
323 */
324 inline double getQuality(const double chi2, const int NDF)
325 {
326 return NDF - 0.25 * chi2 / NDF;
327 }
328
329
330 /**
331 * Get quality of fit.\n
332 * The larger the quality, the better the fit.
333 *
334 * \param chi2 chi2
335 * \return quality
336 */
337 inline double getQuality(const double chi2)
338 {
339 return -chi2;
340 }
341
342
343 /**
344 * Comparison of fit results.
345 *
346 * \param first first fit
347 * \param second second fit
348 * \return true if first fit has better quality than second; else false
349 */
350 inline bool qualitySorter(const JFit& first, const JFit& second)
351 {
352 if (first.getHistory().size() == second.getHistory().size())
353 return first.getQ() > second.getQ();
354 else
355 return first.getHistory().size() > second.getHistory().size();
356 }
357
358
359 /**
360 * General purpose sorter of fit results.
361 *
362 * The default constructor will sort fit results according the method JRECONSTRUCTION::qualitySorter.\n
363 * A different method can dynamically be loaded from a (shared) library using class JEEP::JFunctionAdaptor.
364 * For the definition of an alternative method, see e.g.\ quality_sorter.cc
365 */
367 public JFunctionAdaptor<bool, const JFit&, const JFit&>
368 {
371
372
373 /**
374 * Default constructor.
375 */
379 };
380
381
382 /**
383 * Test whether given fit has specified history.
384 *
385 * \param fit fit
386 * \param type application type
387 * \return true if type in history; else false
388 */
389 inline bool has_history(const JFit& fit, const int type)
390 {
391 return std::find_if(fit.getHistory().begin(),
392 fit.getHistory().end(),
393 JLANG::make_predicate(&JEvent::type, type)) != fit.getHistory().end();
394 }
395
396
397 /**
398 * Test whether given fit has specified history.
399 *
400 * \param fit fit
401 * \param range application type range
402 * \return true if type in history; else false
403 */
404 inline bool has_history(const JFit& fit, const JRange<int>& range)
405 {
406 return std::find_if(fit.getHistory().begin(),
407 fit.getHistory().end(),
408 JLANG::make_find_if(&JEvent::type, range)) != fit.getHistory().end();
409 }
410
411
412 /**
413 * Test whether given fit has muon prefit in history.
414 *
415 * \param fit fit
416 * \return true if muon prefit in history; else false
417 */
418 inline bool has_muon_prefit(const JFit& fit)
419 {
420 return has_history(fit, JMUONPREFIT);
421 }
422
423
424 /**
425 * Test whether given fit has muon simplex in history.
426 *
427 * \param fit fit
428 * \return true if muon simplex in history; else false
429 */
430 inline bool has_muon_simplex(const JFit& fit)
431 {
432 return has_history(fit, JMUONSIMPLEX);
433 }
434
435
436 /**
437 * Test whether given fit has muon gandalf in history.
438 *
439 * \param fit fit
440 * \return true if muon gandalf in history; else false
441 */
442 inline bool has_muon_gandalf(const JFit& fit)
443 {
444 return has_history(fit, JMUONGANDALF);
445 }
446
447
448 /**
449 * Test whether given fit has muon energy in history.
450 *
451 * \param fit fit
452 * \return true if muon energy in history; else false
453 */
454 inline bool has_muon_energy(const JFit& fit)
455 {
456 return has_history(fit, JMUONENERGY);
457 }
458
459
460 /**
461 * Test whether given fit has muon start in history.
462 *
463 * \param fit fit
464 * \return true if muon start in history; else false
465 */
466 inline bool has_muon_start(const JFit& fit)
467 {
468 return has_history(fit, JMUONSTART);
469 }
470
471
472 /**
473 * Test whether given fit has muon fit in history.
474 *
475 * \param fit fit
476 * \return true if muon fit in history; else false
477 */
478 inline bool has_muon_fit(const JFit& fit)
479 {
481 }
482
483
484 /**
485 * Test whether given fit has shower prefit in history.
486 *
487 * \param fit fit
488 * \return true if shower prefit in history; else false
489 */
490 inline bool has_shower_prefit(const JFit& fit)
491 {
492 return has_history(fit, JSHOWERPREFIT);
493 }
494
495
496 /**
497 * Test whether given fit has shower position fit in history.
498 *
499 * \param fit fit
500 * \return true if shower position fit in history; else false
501 */
502 inline bool has_shower_positionfit(const JFit& fit)
503 {
504 return has_history(fit, JSHOWERPOSITIONFIT);
505 }
506
507
508 /**
509 * Test whether given fit has shower complete fit in history.
510 *
511 * \param fit fit
512 * \return true if shower complete fit in history; else false
513 */
514 inline bool has_shower_completefit(const JFit& fit)
515 {
516 return has_history(fit, JSHOWERCOMPLETEFIT);
517 }
518
519
520 /**
521 * Test whether given fit has shower fit in history.
522 *
523 * \param fit fit
524 * \return true if shower fit in history; else false
525 */
526 inline bool has_shower_fit(const JFit& fit)
527 {
529 }
530
531
532 /**
533 * Test whether given event has a track according selection.\n
534 * The track selector corresponds to the function operator <tt>bool selector(const JFit&);</tt>.
535 *
536 * \param evt event
537 * \param selector track selector
538 * \return true if at least one corresponding track; else false
539 */
540 template<class JTrackSelector_t>
541 inline bool has_reconstructed_track(const JEvt& evt, JTrackSelector_t selector)
542 {
543 return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
544 }
545
546
547 /**
548 * Test whether given event has a track with muon reconstruction.
549 *
550 * \param evt event
551 * \return true if at least one reconstructed muon; else false
552 */
553 inline bool has_reconstructed_muon(const JEvt& evt)
554 {
556 }
557
558
559 /**
560 * Test whether given event has a track with shower reconstruction.
561 *
562 * \param evt event
563 * \return true if at least one reconstructed shower; else false
564 */
565 inline bool has_reconstructed_shower(const JEvt& evt)
566 {
568 }
569
570
571 /**
572 * Get best reconstructed track.\n
573 * The track selector corresponds to the function operator <tt>bool selector(const Trk&);</tt> and
574 * the track comparator to <tt>bool comparator(const Trk&, const Trk&);</tt>.
575 *
576 * \param evt event
577 * \param selector track selector
578 * \param comparator track comparator
579 * \return track
580 */
581 template<class JTrackSelector_t, class JQualitySorter_t>
582 inline const JFit& get_best_reconstructed_track(const JEvt& evt,
583 JTrackSelector_t selector,
584 JQualitySorter_t comparator)
585 {
586 JEvt::const_iterator p = std::find_if(evt.begin(), evt.end(), selector);
587
588 for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
589 if (selector(*i) && comparator(*i, *p)) {
590 p = i;
591 }
592 }
593
594 if (p != evt.end())
595 return *p;
596 else
597 THROW(JIndexOutOfRange, "This event has no fit with given selector.");
598 }
599
600
601 /**
602 * Get best reconstructed muon.
603 *
604 * \param evt event
605 * \return track
606 */
607 inline const JFit& get_best_reconstructed_muon(const JEvt& evt)
608 {
610 }
611
612
613 /**
614 * Get best reconstructed shower.
615 *
616 * \param evt event
617 * \return track
618 */
619 inline const JFit& get_best_reconstructed_shower(const JEvt& evt)
620 {
622 }
623
624
625 /**
626 * Auxiliary class to compare fit results with respect to a reference direction (e.g.\ true muon).
627 * The sort operation results in an ordered set of fit results with increasing angle between
628 * the reference direction and that of the fit results.
629 */
630 class JPointing {
631 public:
632 /**
633 * Default constructor.
634 */
636 {}
637
638
639 /**
640 * Constructor.
641 *
642 * \param dir reference direction
643 */
645 {
646 this->dir = dir;
647 }
648
649
650 /**
651 * Constructor.
652 *
653 * \param fit fit
654 */
655 JPointing(const JFit& fit)
656 {
658 }
659
660
661 /**
662 * Get direction.
663 *
664 * \return direction
665 */
667 {
668 return dir;
669 }
670
671
672 /**
673 * Get angle between reference direction and fit result.
674 *
675 * \param fit fit
676 * \return angle [deg]
677 */
678 inline double getAngle(const JFit& fit) const
679 {
680 const double dot = getDot(fit, dir);
681
682 if (dot >= +1.0)
683 return 0.0;
684 else if (dot <= -1.0)
685 return 180.0;
686 else
687 return acos(dot) * 180.0 / JMATH::PI;
688 }
689
690
691 /**
692 * Comparison of fit results.
693 *
694 * \param first first fit
695 * \param second second fit
696 * \return true if first fit better; else false
697 */
698 inline bool operator()(const JFit& first, const JFit& second) const
699 {
700 return getDot(first, dir) > getDot(second, dir);
701 }
702
703
704 /**
705 * Select best fit result.
706 *
707 * \param __begin begin of fit results
708 * \param __end end of fit results
709 * \return best fit result
710 */
711 template<class T>
712 inline T operator()(T __begin, T __end) const
713 {
714 return std::min_element(__begin, __end, *this);
715 }
716
717 protected:
719 };
720
721
722 /**
723 * Auxiliary class to compare fit results with respect to a reference position.
724 * The sort operation results in an ordered set of fit results with increasing distance between
725 * the reference position and that of the fit results.
726 */
727 class JPosition {
728 public:
729 /**
730 * Constructor.
731 *
732 * \param pos reference position
733 */
735 {
736 this->pos = pos;
737 }
738
739 /**
740 * Comparison of fit results.
741 *
742 * \param first first fit
743 * \param second second fit
744 * \return true if first fit better; else false
745 */
746 inline bool operator()(const JFit& first, const JFit& second) const
747 {
748 return this->pos.getDistance(getPosition(first)) < this->pos.getDistance(getPosition(second));
749 }
750
751 /**
752 * Select best fit result.
753 *
754 * \param __begin begin of fit results
755 * \param __end end of fit results
756 * \return best fit result
757 */
758 template<class T>
759 inline T operator()(T __begin, T __end) const
760 {
761 return std::min_element(__begin, __end, *this);
762 }
763
764 protected:
766 };
767
768
769 /**
770 * Auxiliary class to compare fit results with respect to a reference energy.
771 * The sort operation results in an ordered set of fit results with increasing difference between
772 * the reference energy and that of the fit results.
773 */
775 public:
776 /**
777 * Constructor.
778 *
779 * \param E reference energy
780 */
782 {
783 this->energy = E;
784 }
785
786 /**
787 * Comparison of fit results.
788 *
789 * \param first first fit
790 * \param second second fit
791 * \return true if first fit better; else false
792 */
793 inline bool operator()(const JFit& first, const JFit& second) const
794 {
795 return fabs(this->energy - first.getE()) < fabs(this->energy - second.getE());
796 }
797
798 /**
799 * Select best fit result.
800 *
801 * \param __begin begin of fit results
802 * \param __end end of fit results
803 * \return best fit result
804 */
805 template<class T>
806 inline T operator()(T __begin, T __end) const
807 {
808 return std::min_element(__begin, __end, *this);
809 }
810
811 protected:
812 double energy;
813 };
814
815
816 /**
817 * Auxiliary class to evaluate atmospheric muon hypothesis.
818 * The hypothesis is tested by means of the difference in quality
819 * between the best upward and best downward track.
820 */
822 public:
823 /**
824 * Default constructor.
825 */
827 dot1(0.0),
828 dot2(0.0)
829 {}
830
831
832 /**
833 * Constructor.
834 *
835 * \param theta1 upper hemisphere angle [deg]
836 * \param theta2 lower hemisphere angle [deg]
837 */
838 JAtmosphericMuon(const double theta1,
839 const double theta2) :
840 dot1(cos(theta1 * JMATH::PI/180.0)),
841 dot2(cos(theta2 * JMATH::PI/180.0))
842 {}
843
844
845 /**
846 * Test is event is atmospheric muon.
847 *
848 * \param __begin begin of data
849 * \param __end end of data
850 * \return negative if preferably down / positive if preferably up
851 */
852 double operator()(JEvt::const_iterator __begin,
853 JEvt::const_iterator __end) const
854 {
855 double Qup = 0.0;
856 double Qdown = 0.0;
857
858 for (JEvt::const_iterator i = __begin; i != __end; ++i) {
859
860 if (i->getDZ() >= dot1) {
861
862 if (i->getQ() > Qup) {
863 Qup = i->getQ();
864 }
865
866 } else if (i->getDZ() <= dot2) {
867
868 if (i->getQ() > Qdown) {
869 Qdown = i->getQ();
870 }
871 }
872 }
873
874 return Qup - Qdown;
875 }
876
877
878 /**
879 * Read atmospheric muon analyser from input.
880 *
881 * \param in input stream
882 * \param object atmospheric muon analyser
883 * \return input stream
884 */
885 friend inline std::istream& operator>>(std::istream& in, JAtmosphericMuon& object)
886 {
887 double theta1, theta2;
888
889 in >> theta1 >> theta2;
890
891 object.dot1 = cos(theta1 * JMATH::PI/180.0);
892 object.dot2 = cos(theta2 * JMATH::PI/180.0);
893
894 return in;
895 }
896
897
898 /**
899 * Write atmospheric muon analyser to output.
900 *
901 * \param out output stream
902 * \param object atmospheric muon analyser
903 * \return output stream
904 */
905 friend inline std::ostream& operator<<(std::ostream& out, const JAtmosphericMuon& object)
906 {
907 out << acos(object.dot1) * 180.0 / JMATH::PI << ' '
908 << acos(object.dot2) * 180.0 / JMATH::PI;
909
910 return out;
911 }
912
913
914 double dot1;
915 double dot2;
916 };
917}
918
919#endif
Exceptions.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition for fit results.
Binary methods for member methods.
Mathematical constants.
Auxiliary class to define a range between two values.
#define MAKE_ENTRY(A)
Data structure for set of track fit results.
Data structure for track fit results with history and optional associated values.
double getDZ() const
Get Z-slope.
double getDY() const
Get Y-slope.
double getZ() const
Get Z-position.
double getE() const
Get energy.
double getDX() const
Get X-slope.
double getY() const
Get Y-position.
double getQ() const
Get quality.
const std::vector< double > & getW() const
Get associated values.
double getT() const
Get time.
bool hasW(const int i) const
Check availability of value.
double getX() const
Get X-position.
Data structure for fit of straight line paralel to z-axis.
Definition JLine1Z.hh:29
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition JLine1Z.hh:114
double getZ(const JPosition3D &pos) const
Get point of emission of Cherenkov light along muon path.
Definition JLine1Z.hh:134
Data structure for cascade in positive z-direction.
Definition JShower3Z.hh:36
Data structure for angles in three dimensions.
Definition JAngle3D.hh:35
double getDY() const
Get y direction.
Definition JAngle3D.hh:119
double getDZ() const
Get z direction.
Definition JAngle3D.hh:130
double getDX() const
Get x direction.
Definition JAngle3D.hh:108
Axis object.
Definition JAxis3D.hh:41
Data structure for direction in three dimensions.
Data structure for position in three dimensions.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition JTrack3D.hh:126
3D track with energy.
Definition JTrack3E.hh:32
Data structure for vector in three dimensions.
Definition JVector3D.hh:36
double getY() const
Get y position.
Definition JVector3D.hh:104
double getDistance(const JVector3D &pos) const
Get distance to point.
Definition JVector3D.hh:270
double getZ() const
Get z position.
Definition JVector3D.hh:115
double getX() const
Get x position.
Definition JVector3D.hh:94
Data structure for normalised vector in three dimensions.
Definition JVersor3D.hh:28
double getDY() const
Get y direction.
Definition JVersor3D.hh:106
double getDX() const
Get x direction.
Definition JVersor3D.hh:95
double getDZ() const
Get z direction.
Definition JVersor3D.hh:117
Exception for accessing an index in a collection that is outside of its range.
Auxiliary class to evaluate atmospheric muon hypothesis.
friend std::ostream & operator<<(std::ostream &out, const JAtmosphericMuon &object)
Write atmospheric muon analyser to output.
JAtmosphericMuon(const double theta1, const double theta2)
Constructor.
friend std::istream & operator>>(std::istream &in, JAtmosphericMuon &object)
Read atmospheric muon analyser from input.
double operator()(JEvt::const_iterator __begin, JEvt::const_iterator __end) const
Test is event is atmospheric muon.
Auxiliary class to compare fit results with respect to a reference direction (e.g....
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
JPointing(const JFit &fit)
Constructor.
T operator()(T __begin, T __end) const
Select best fit result.
JVersor3D getDirection() const
Get direction.
JPointing(const JVersor3D &dir)
Constructor.
double getAngle(const JFit &fit) const
Get angle between reference direction and fit result.
Auxiliary class to compare fit results with respect to a reference position.
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
T operator()(T __begin, T __end) const
Select best fit result.
Auxiliary class to compare fit results with respect to a reference energy.
T operator()(T __begin, T __end) const
Select best fit result.
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
Range of values.
Definition JRange.hh:42
static const int JMUONBEGIN
begin range of reconstruction stages
static const int JSHOWERPOSITIONFIT
static const int JSHOWEREND
end range of reconstruction stages
static const int JMUONGANDALF
static const int JMUONPREFIT
static const int JMUONENERGY
static const int JSHOWERCOMPLETEFIT
static const int JSHOWERPREFIT
static const int JMUONSIMPLEX
static const int JSHOWERBEGIN
begin range of reconstruction stages
static const int JMUONSTART
static const int JMUONEND
end range of reconstruction stages
static const int JENERGY_NDF
number of degrees of freedom from JEnergy.cc
static const int JGANDALF_LAMBDA
control parameter from JGandalf.cc
static const int JENERGY_ENERGY
uncorrected energy [GeV] from JEnergy.cc
static const int AASHOWERFIT_NUMBER_OF_HITS
number of hits used
static const int JENERGY_NOISE_LIKELIHOOD
log likelihood of every hit being K40 from JEnergy.cc
static const int JENERGY_CHI2
chi2 from JEnergy.cc
static const int JSTART_NPE_MIP_TOTAL
number of photo-electrons along the whole track from JStart.cc
static const int JENERGY_MUON_RANGE_METRES
range of a muon with the reconstructed energy [m] from JEnergy.cc
static const int JCOPY_Z_M
true vertex position along track [m] from JCopy.cc
static const int JVETO_NPE
number of photo-electrons from JVeto.cc
static const int JPP_COVERAGE_POSITION
coverage of dynamic position calibration from any Jpp application
static const int JENERGY_NUMBER_OF_HITS
number of hits from JEnergy.cc
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 JGANDALF_BETA0_RAD
KM3NeT Data Definitions v3.6.0 https://git.km3net.de/common/km3net-dataformat.
static const int JGANDALF_NUMBER_OF_ITERATIONS
number of iterations from JGandalf.cc
static const int JVETO_NUMBER_OF_HITS
number of hits from JVeto.cc
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
static const int JGANDALF_BETA1_RAD
angular resolution [rad] from JGandalf.cc
static const int JENERGY_MINIMAL_ENERGY
minimal energy [GeV] from JEnergy.cc
static const int AASHOWERFIT_ENERGY
uncorrected energy [GeV]
static const int JSTART_NPE_MIP_MISSED
number of photo-electrons missed from JStart.cc
static const int JENERGY_MAXIMAL_ENERGY
maximal energy [GeV] from JEnergy.cc
static const int JSTART_NPE_MIP
number of photo-electrons up to the barycentre from JStart.cc
static const int JGANDALF_NUMBER_OF_HITS
number of hits from JGandalf.cc
static const int JGANDALF_CHI2
chi2 from JGandalf.cc
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
JFind_if< JResult_t T::*, JPredicate_t > make_find_if(JResult_t T::*member, const JPredicate_t &predicate)
Helper method to create find_if for data member.
Definition JFind_if.hh:119
Auxiliary classes and methods for mathematical operations.
Definition JEigen3D.hh:88
double getAngle(const JFirst_t &first, const JSecond_t &second)
Get space angle between objects.
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
static const double PI
Mathematical constants.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Model fits to data.
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
bool has_shower_fit(const JFit &fit)
Test whether given fit has shower fit in history.
bool has_muon_gandalf(const JFit &fit)
Test whether given fit has muon gandalf in history.
JPosition3D getPosition(const JFit &fit)
Get position.
const JFit & get_best_reconstructed_muon(const JEvt &evt)
Get best reconstructed muon.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JAxis3D getAxis(const JFit &fit)
Get axis.
double getDot(const JFit &first, const JFit &second)
Get dot product.
const JFit & get_best_reconstructed_track(const JEvt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
Get best reconstructed track.
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.
JTrack3E getTrack(const JFit &fit)
Get track.
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
double getAngle(const JFit &first, const JFit &second)
Get space angle.
bool has_shower_prefit(const JFit &fit)
Test whether given fit has shower prefit in history.
bool has_muon_energy(const JFit &fit)
Test whether given fit has muon energy in history.
bool has_muon_fit(const JFit &fit)
Test whether given fit has muon fit in history.
JDirection3D getDirection(const JFit &fit)
Get direction.
JRECONSTRUCTION::JWeight getWeight
bool has_reconstructed_shower(const JEvt &evt)
Test whether given event has a track with shower reconstruction.
bool has_shower_completefit(const JFit &fit)
Test whether given fit has shower complete fit in history.
bool has_muon_prefit(const JFit &fit)
Test whether given fit has muon prefit in history.
bool has_muon_start(const JFit &fit)
Test whether given fit has muon start in history.
bool has_shower_positionfit(const JFit &fit)
Test whether given fit has shower position fit in history.
const JFit & get_best_reconstructed_shower(const JEvt &evt)
Get best reconstructed shower.
bool has_muon_simplex(const JFit &fit)
Test whether given fit has muon simplex in history.
bool has_reconstructed_track(const JEvt &evt, JTrackSelector_t selector)
Test whether given event has a track according selection.
bool has_reconstructed_muon(const JEvt &evt)
Test whether given event has a track with muon reconstruction.
JReturn_t(*) pF(Args...)
Type definition of method.
int type
application type
Definition JHistory.hh:117
Container for historical events.
Definition JHistory.hh:130
const JHistory & getHistory() const
Get history.
Definition JHistory.hh:280
General purpose sorter of fit results.
JFunctionAdaptor< bool, const JFit &, const JFit & > function_adaptor_type
Auxiliary data structure to get weight of given fit.
bool operator()(const std::string &key) const
Has weight.
double operator()(const JFit &fit, const std::string &key, const double value) const
Get weight.