Jpp 20.0.0-rc.2
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"
30#include "JMath/JMathToolkit.hh"
31#include "JMath/JConstants.hh"
32#include "JTools/JRange.hh"
34
35#include "JFit/JLine1Z.hh"
36#include "JFit/JShower3EZ.hh"
37
41
42
43/**
44 * \author mdejong
45 */
46namespace JRECONSTRUCTION {}
47namespace JPP { using namespace JRECONSTRUCTION; }
48
49/**
50 * Model fits to data.
51 */
52namespace JRECONSTRUCTION {
53
66 using JTOOLS::JRange;
67 using JFIT::JLine1Z;
68 using JFIT::JShower3Z;
69
70
71 /**
72 * Auxiliary data structure to get weight of given fit.
73 */
74 static struct JWeight :
75 public std::map<std::string, int>
76 {
77 /**
78 * Default constructor.
79 */
81 {
82#define MAKE_ENTRY(A) std::make_pair(#A, A)
83
84 this->insert(MAKE_ENTRY(JGANDALF_BETA0_RAD));
85 this->insert(MAKE_ENTRY(JGANDALF_BETA1_RAD));
88 this->insert(MAKE_ENTRY(JENERGY_ENERGY));
89 this->insert(MAKE_ENTRY(JENERGY_CHI2));
90 this->insert(MAKE_ENTRY(JGANDALF_LAMBDA));
92 this->insert(MAKE_ENTRY(JSTART_NPE_MIP_TOTAL));
93 this->insert(MAKE_ENTRY(JSTART_NPE_MIP_MISSED));
94 this->insert(MAKE_ENTRY(JSTART_LENGTH_METRES));
96 this->insert(MAKE_ENTRY(JVETO_NPE));
97 this->insert(MAKE_ENTRY(JVETO_NUMBER_OF_HITS));
100 this->insert(MAKE_ENTRY(JENERGY_NDF));
101 this->insert(MAKE_ENTRY(JENERGY_NUMBER_OF_HITS));
102 this->insert(MAKE_ENTRY(JCOPY_Z_M));
104 this->insert(MAKE_ENTRY(JPP_COVERAGE_POSITION));
105 this->insert(MAKE_ENTRY(JENERGY_MINIMAL_ENERGY));
106 this->insert(MAKE_ENTRY(JENERGY_MAXIMAL_ENERGY));
107 this->insert(MAKE_ENTRY(JSHOWERFIT_ENERGY));
108 this->insert(MAKE_ENTRY(AASHOWERFIT_ENERGY));
110
111#undef MAKE_ENTRY
112 }
113
114
115 /**
116 * Has weight.
117 *
118 * \param key key
119 * \return true if valid key; else false
120 */
121 bool operator()(const std::string& key) const
122 {
123 return this->count(key) != 0;
124 }
125
126
127 /**
128 * Get weight.
129 *
130 * \param fit fit
131 * \param key key
132 * \param value default value
133 * \return value
134 */
135 double operator()(const JFit& fit, const std::string& key, const double value) const
136 {
137 const_iterator p = this->find(key);
138
139 if (p != this->end() && fit.hasW(p->second))
140 return fit.getW(p->second);
141 else
142 return value;
143 }
144
146
147
148 /**
149 * Get position.
150 *
151 * \param fit fit
152 * \return position
153 */
154 inline JPosition3D getPosition(const JFit& fit)
155 {
156 return JPosition3D(fit.getX(), fit.getY(), fit.getZ());
157 }
158
159
160 /**
161 * Get direction.
162 *
163 * \param fit fit
164 * \return direction
165 */
166 inline JDirection3D getDirection(const JFit& fit)
167 {
168 return JDirection3D(fit.getDX(), fit.getDY(), fit.getDZ());
169 }
170
171
172 /**
173 * Get vertex.
174 *
175 * \param fit fit
176 * \return vertex
177 */
178 inline JVertex3D getVertex(const JFit& fit)
179 {
180 return JVertex3D(getPosition(fit), fit.getT());
181 }
182
183
184 /**
185 * Get axis.
186 *
187 * \param fit fit
188 * \return axis
189 */
190 inline JAxis3D getAxis(const JFit& fit)
191 {
192 return JAxis3D(getPosition(fit), getDirection(fit));
193 }
194
195
196 /**
197 * Get track.
198 *
199 * \param fit fit
200 * \return track
201 */
202 inline JTrack3E getTrack(const JFit& fit)
203 {
204 return JTrack3E(JTrack3D(getAxis(fit), fit.getT()), fit.getE());
205 }
206
207
208 /**
209 * Get shower.
210 *
211 * \param fit fit
212 * \return shower
213 */
214 inline JShower3E getShower(const JFit& fit)
215 {
216 return JShower3E(JShower3D(getVertex(fit), getDirection(fit)), fit.getE());
217 }
218
219
220 /**
221 * Get fit.
222 *
223 * \param history history
224 * \param track track
225 * \param Q quality
226 * \param NDF number of degrees of freedom
227 * \param energy Energy, which would be set as 0, if the fit does not reconstruct energy
228 * \param status status of the fit as defined in enum JFitStatus.hh
229 * \return fit
230 */
231 inline JFit getFit(const JHistory& history,
232 const JTrack3D& track,
233 const double Q,
234 const int NDF,
235 const double energy = 0.0,
236 const int status = SINGLE_STAGE)
237 {
238 return JFit(history,
239 track.getX(), track.getY(), track.getZ(),
240 track.getDX(), track.getDY(), track.getDZ(),
241 track.getT(),
242 Q, NDF,
243 energy, status);
244 }
245
246
247 /**
248 * Get fit.
249 *
250 * \param history history
251 * \param track track
252 * \param angle angle
253 * \param Q quality
254 * \param NDF number of degrees of freedom
255 * \param energy Energy, which would be set as 0, if the fit does not reconstruct energy
256 * \param status status of the fit as defined in JFitStatus.hh
257 * \return fit
258 */
259 inline JFit getFit(const JHistory& history,
260 const JLine1Z& track,
261 const JAngle3D& angle,
262 const double Q,
263 const int NDF,
264 const double energy = 0.0,
265 const int status = SINGLE_STAGE)
266 {
267 return JFit(history,
268 track.getX(), track.getY(), track.getZ(),
269 angle.getDX(), angle.getDY(), angle.getDZ(),
270 track.getT(),
271 Q, NDF,
272 energy, status);
273 }
274
275
276 /**
277 * Get fit.
278 *
279 * \param history history
280 * \param shower shower
281 * \param Q quality
282 * \param NDF number of degrees of freedom
283 * \param energy Energy, which would be set as 0, if the fit does not reconstruct energy
284 * \param status status of the fit as defined in enum JFitStatus.hh
285 * \return fit
286 */
287 inline JFit getFit(const JHistory& history,
288 const JShower3D& shower,
289 const double Q,
290 const int NDF,
291 const double energy = 0.0,
292 const int status = SINGLE_STAGE)
293 {
294 return JFit(history,
295 shower.getX(), shower.getY(), shower.getZ(),
296 shower.getDX(), shower.getDY(), shower.getDZ(),
297 shower.getT(),
298 Q, NDF,
299 energy, status);
300 }
301
302
303 /**
304 * Get dot product.
305 *
306 * \param first first fit
307 * \param second second fit
308 * \return dot product
309 */
310 inline double getDot(const JFit& first, const JFit& second)
311 {
312 return JMATH::getDot(getDirection(first), getDirection(second));
313 }
314
315
316 /**
317 * Get dot product.
318 *
319 * \param fit fit
320 * \param dir direction
321 * \return dot product
322 */
323 inline double getDot(const JFit& fit, const JDirection3D& dir)
324 {
325 return JMATH::getDot(getDirection(fit), dir);
326 }
327
328
329 /**
330 * Get space angle.
331 *
332 * \param first first fit
333 * \param second second fit
334 * \return angle [deg]
335 */
336 inline double getAngle(const JFit& first, const JFit& second)
337 {
338 return JMATH::getAngle(getDirection(first), getDirection(second));
339 }
340
341
342 /**
343 * Get space angle.
344 *
345 * \param fit fit
346 * \param dir direction
347 * \return angle [deg]
348 */
349 inline double getAngle(const JFit& fit, const JDirection3D& dir)
350 {
351 return JMATH::getAngle(getDirection(fit), dir);
352 }
353
354
355 /**
356 * Get quality of fit.\n
357 * The larger the quality, the better the fit.
358 *
359 * \param chi2 chi2
360 * \param N number of hits
361 * \param NDF number of degrees of freedom
362 * \return quality
363 */
364 inline double getQuality(const double chi2, const int N, const int NDF)
365 {
366 return N - 0.25 * chi2 / NDF;
367 }
368
369
370 /**
371 * Get quality of fit.\n
372 * The larger the quality, the better the fit.
373 *
374 * \param chi2 chi2
375 * \param NDF number of degrees of freedom
376 * \return quality
377 */
378 inline double getQuality(const double chi2, const int NDF)
379 {
380 return NDF - 0.25 * chi2 / NDF;
381 }
382
383
384 /**
385 * Get quality of fit.\n
386 * The larger the quality, the better the fit.
387 *
388 * \param chi2 chi2
389 * \return quality
390 */
391 inline double getQuality(const double chi2)
392 {
393 return -chi2;
394 }
395
396
397 /**
398 * Comparison of fit results.
399 *
400 * \param first first fit
401 * \param second second fit
402 * \return true if first fit has better quality than second; else false
403 */
404 inline bool qualitySorter(const JFit& first, const JFit& second)
405 {
406 if (first.getHistory().size() == second.getHistory().size())
407 return first.getQ() > second.getQ();
408 else
409 return first.getHistory().size() > second.getHistory().size();
410 }
411
412
413 /**
414 * General purpose sorter of fit results.
415 *
416 * The default constructor will sort fit results according the method JRECONSTRUCTION::qualitySorter.\n
417 * A different method can dynamically be loaded from a (shared) library using class JEEP::JFunctionAdaptor.
418 * For the definition of an alternative method, see e.g.\ quality_sorter.cc
419 */
421 public JFunctionAdaptor<bool, const JFit&, const JFit&>
422 {
425
426
427 /**
428 * Default constructor.
429 */
433 };
434
435
436 /**
437 * Test whether given fit has specified history.
438 *
439 * \param fit fit
440 * \param type application type
441 * \return true if type in history; else false
442 */
443 inline bool has_history(const JFit& fit, const int type)
444 {
445 return std::find_if(fit.getHistory().begin(),
446 fit.getHistory().end(),
447 JLANG::make_predicate(&JEvent::type, type)) != fit.getHistory().end();
448 }
449
450
451 /**
452 * Test whether given fit has specified history.
453 *
454 * \param fit fit
455 * \param range application type range
456 * \return true if type in history; else false
457 */
458 inline bool has_history(const JFit& fit, const JRange<int>& range)
459 {
460 return std::find_if(fit.getHistory().begin(),
461 fit.getHistory().end(),
462 JLANG::make_find_if(&JEvent::type, range)) != fit.getHistory().end();
463 }
464
465
466 /**
467 * Test whether given fit has muon prefit in history.
468 *
469 * \param fit fit
470 * \return true if muon prefit in history; else false
471 */
472 inline bool has_muon_prefit(const JFit& fit)
473 {
474 return has_history(fit, JMUONPREFIT);
475 }
476
477
478 /**
479 * Test whether given fit has muon simplex in history.
480 *
481 * \param fit fit
482 * \return true if muon simplex in history; else false
483 */
484 inline bool has_muon_simplex(const JFit& fit)
485 {
486 return has_history(fit, JMUONSIMPLEX);
487 }
488
489
490 /**
491 * Test whether given fit has muon gandalf in history.
492 *
493 * \param fit fit
494 * \return true if muon gandalf in history; else false
495 */
496 inline bool has_muon_gandalf(const JFit& fit)
497 {
498 return has_history(fit, JMUONGANDALF);
499 }
500
501
502 /**
503 * Test whether given fit has muon energy in history.
504 *
505 * \param fit fit
506 * \return true if muon energy in history; else false
507 */
508 inline bool has_muon_energy(const JFit& fit)
509 {
510 return has_history(fit, JMUONENERGY);
511 }
512
513
514 /**
515 * Test whether given fit has muon start in history.
516 *
517 * \param fit fit
518 * \return true if muon start in history; else false
519 */
520 inline bool has_muon_start(const JFit& fit)
521 {
522 return has_history(fit, JMUONSTART);
523 }
524
525
526 /**
527 * Test whether given fit has muon fit in history.
528 *
529 * \param fit fit
530 * \return true if muon fit in history; else false
531 */
532 inline bool has_muon_fit(const JFit& fit)
533 {
535 }
536
537
538 /**
539 * Test whether given fit has shower prefit in history.
540 *
541 * \param fit fit
542 * \return true if shower prefit in history; else false
543 */
544 inline bool has_shower_prefit(const JFit& fit)
545 {
546 return has_history(fit, JSHOWERPREFIT);
547 }
548
549
550 /**
551 * Test whether given fit has shower position fit in history.
552 *
553 * \param fit fit
554 * \return true if shower position fit in history; else false
555 */
556 inline bool has_shower_positionfit(const JFit& fit)
557 {
558 return has_history(fit, JSHOWERPOSITIONFIT);
559 }
560
561
562 /**
563 * Test whether given fit has shower complete fit in history.
564 *
565 * \param fit fit
566 * \return true if shower complete fit in history; else false
567 */
568 inline bool has_shower_completefit(const JFit& fit)
569 {
570 return has_history(fit, JSHOWERCOMPLETEFIT);
571 }
572
573
574 /**
575 * Test whether given fit has shower fit in history.
576 *
577 * \param fit fit
578 * \return true if shower fit in history; else false
579 */
580 inline bool has_shower_fit(const JFit& fit)
581 {
583 }
584
585
586 /**
587 * Test whether given event has a track according selection.\n
588 * The track selector corresponds to the function operator <tt>bool selector(const JFit&);</tt>.
589 *
590 * \param evt event
591 * \param selector track selector
592 * \return true if at least one corresponding track; else false
593 */
594 template<class JTrackSelector_t>
595 inline bool has_reconstructed_track(const JEvt& evt, JTrackSelector_t selector)
596 {
597 return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
598 }
599
600
601 /**
602 * Test whether given event has a track with muon reconstruction.
603 *
604 * \param evt event
605 * \return true if at least one reconstructed muon; else false
606 */
607 inline bool has_reconstructed_muon(const JEvt& evt)
608 {
610 }
611
612
613 /**
614 * Test whether given event has a track with shower reconstruction.
615 *
616 * \param evt event
617 * \return true if at least one reconstructed shower; else false
618 */
619 inline bool has_reconstructed_shower(const JEvt& evt)
620 {
622 }
623
624
625 /**
626 * Get best reconstructed track.\n
627 * The track selector corresponds to the function operator <tt>bool selector(const Trk&);</tt> and
628 * the track comparator to <tt>bool comparator(const Trk&, const Trk&);</tt>.
629 *
630 * \param evt event
631 * \param selector track selector
632 * \param comparator track comparator
633 * \return track
634 */
635 template<class JTrackSelector_t, class JQualitySorter_t>
636 inline const JFit& get_best_reconstructed_track(const JEvt& evt,
637 JTrackSelector_t selector,
638 JQualitySorter_t comparator)
639 {
640 JEvt::const_iterator p = std::find_if(evt.begin(), evt.end(), selector);
641
642 for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
643 if (selector(*i) && comparator(*i, *p)) {
644 p = i;
645 }
646 }
647
648 if (p != evt.end())
649 return *p;
650 else
651 THROW(JIndexOutOfRange, "This event has no fit with given selector.");
652 }
653
654
655 /**
656 * Get best reconstructed muon.
657 *
658 * \param evt event
659 * \return track
660 */
661 inline const JFit& get_best_reconstructed_muon(const JEvt& evt)
662 {
664 }
665
666
667 /**
668 * Get best reconstructed shower.
669 *
670 * \param evt event
671 * \return track
672 */
673 inline const JFit& get_best_reconstructed_shower(const JEvt& evt)
674 {
676 }
677
678
679 /**
680 * Auxiliary class to compare fit results with respect to a reference direction (e.g.\ true muon).
681 * The sort operation results in an ordered set of fit results with increasing angle between
682 * the reference direction and that of the fit results.
683 */
684 class JPointing {
685 public:
686 /**
687 * Default constructor.
688 */
690 {}
691
692
693 /**
694 * Constructor.
695 *
696 * \param dir reference direction
697 */
699 {
700 this->dir = dir;
701 }
702
703
704 /**
705 * Constructor.
706 *
707 * \param fit fit
708 */
709 JPointing(const JFit& fit)
710 {
712 }
713
714
715 /**
716 * Get direction.
717 *
718 * \return direction
719 */
721 {
722 return dir;
723 }
724
725
726 /**
727 * Get angle between reference direction and fit result.
728 *
729 * \param fit fit
730 * \return angle [deg]
731 */
732 inline double getAngle(const JFit& fit) const
733 {
734 const double dot = getDot(fit, dir);
735
736 if (dot >= +1.0)
737 return 0.0;
738 else if (dot <= -1.0)
739 return 180.0;
740 else
741 return acos(dot) * 180.0 / JMATH::PI;
742 }
743
744
745 /**
746 * Comparison of fit results.
747 *
748 * \param first first fit
749 * \param second second fit
750 * \return true if first fit better; else false
751 */
752 inline bool operator()(const JFit& first, const JFit& second) const
753 {
754 return getDot(first, dir) > getDot(second, dir);
755 }
756
757
758 /**
759 * Select best fit result.
760 *
761 * \param __begin begin of fit results
762 * \param __end end of fit results
763 * \return best fit result
764 */
765 template<class T>
766 inline T operator()(T __begin, T __end) const
767 {
768 return std::min_element(__begin, __end, *this);
769 }
770
771 protected:
773 };
774
775
776 /**
777 * Auxiliary class to compare fit results with respect to a reference position.
778 * The sort operation results in an ordered set of fit results with increasing distance between
779 * the reference position and that of the fit results.
780 */
781 class JPosition {
782 public:
783 /**
784 * Constructor.
785 *
786 * \param pos reference position
787 */
789 {
790 this->pos = pos;
791 }
792
793 /**
794 * Comparison of fit results.
795 *
796 * \param first first fit
797 * \param second second fit
798 * \return true if first fit better; else false
799 */
800 inline bool operator()(const JFit& first, const JFit& second) const
801 {
802 return this->pos.getDistance(getPosition(first)) < this->pos.getDistance(getPosition(second));
803 }
804
805 /**
806 * Select best fit result.
807 *
808 * \param __begin begin of fit results
809 * \param __end end of fit results
810 * \return best fit result
811 */
812 template<class T>
813 inline T operator()(T __begin, T __end) const
814 {
815 return std::min_element(__begin, __end, *this);
816 }
817
818 protected:
820 };
821
822
823 /**
824 * Auxiliary class to compare fit results with respect to a reference energy.
825 * The sort operation results in an ordered set of fit results with increasing difference between
826 * the reference energy and that of the fit results.
827 */
829 public:
830 /**
831 * Constructor.
832 *
833 * \param E reference energy
834 */
836 {
837 this->energy = E;
838 }
839
840 /**
841 * Comparison of fit results.
842 *
843 * \param first first fit
844 * \param second second fit
845 * \return true if first fit better; else false
846 */
847 inline bool operator()(const JFit& first, const JFit& second) const
848 {
849 return fabs(this->energy - first.getE()) < fabs(this->energy - second.getE());
850 }
851
852 /**
853 * Select best fit result.
854 *
855 * \param __begin begin of fit results
856 * \param __end end of fit results
857 * \return best fit result
858 */
859 template<class T>
860 inline T operator()(T __begin, T __end) const
861 {
862 return std::min_element(__begin, __end, *this);
863 }
864
865 protected:
866 double energy;
867 };
868
869
870 /**
871 * Gridify set of fits.
872 *
873 * \param __begin begin of fits
874 * \param __end end of fits
875 * \param N number of directions in grid
876 * \return end of fits sorted by quality
877 */
878 inline JEvt::iterator gridify(JEvt::iterator __begin, JEvt::iterator __end, const int N)
879 {
880 using namespace std;
881 using namespace JPP;
882
883 static const double MINIMAL_ANGLE_DEG = 60.0;
884
885 // estimate grid angle
886
887 double angle_deg = 10.0 * sqrt((double) 240 / (double) N);
888
889 if (angle_deg > MINIMAL_ANGLE_DEG) {
890 angle_deg = MINIMAL_ANGLE_DEG;
891 }
892
893 const JOmega3D ps(angle_deg * PI/180.0);
894
895 JEvt::iterator out = __begin;
896
897 for (JOmega3D_t::const_iterator dir = ps.begin(); dir != ps.end() && out != __end; ++dir) {
898
899 const JPointing pointing(*dir);
900
901 sort(out, __end, pointing);
902
903 JEvt::iterator p = out;
904
905 for (JEvt::iterator i = out; i != __end && pointing.getAngle(*i) <= angle_deg; ++i) {
906 if (qualitySorter(*i, *p)) {
907 p = i;
908 }
909 }
910
911 swap(*(out++), *p);
912 }
913
914 sort(__begin, out, qualitySorter);
915
916 return out;
917 }
918
919
920 /**
921 * Auxiliary class to evaluate atmospheric muon hypothesis.
922 * The hypothesis is tested by means of the difference in quality
923 * between the best upward and best downward track.
924 */
926 public:
927 /**
928 * Default constructor.
929 */
931 dot1(0.0),
932 dot2(0.0)
933 {}
934
935
936 /**
937 * Constructor.
938 *
939 * \param theta1 upper hemisphere angle [deg]
940 * \param theta2 lower hemisphere angle [deg]
941 */
942 JAtmosphericMuon(const double theta1,
943 const double theta2) :
944 dot1(cos(theta1 * JMATH::PI/180.0)),
945 dot2(cos(theta2 * JMATH::PI/180.0))
946 {}
947
948
949 /**
950 * Test is event is atmospheric muon.
951 *
952 * \param __begin begin of data
953 * \param __end end of data
954 * \return negative if preferably down / positive if preferably up
955 */
956 double operator()(JEvt::const_iterator __begin,
957 JEvt::const_iterator __end) const
958 {
959 double Qup = 0.0;
960 double Qdown = 0.0;
961
962 for (JEvt::const_iterator i = __begin; i != __end; ++i) {
963
964 if (i->getDZ() >= dot1) {
965
966 if (i->getQ() > Qup) {
967 Qup = i->getQ();
968 }
969
970 } else if (i->getDZ() <= dot2) {
971
972 if (i->getQ() > Qdown) {
973 Qdown = i->getQ();
974 }
975 }
976 }
977
978 return Qup - Qdown;
979 }
980
981
982 /**
983 * Read atmospheric muon analyser from input.
984 *
985 * \param in input stream
986 * \param object atmospheric muon analyser
987 * \return input stream
988 */
989 friend inline std::istream& operator>>(std::istream& in, JAtmosphericMuon& object)
990 {
991 double theta1, theta2;
992
993 in >> theta1 >> theta2;
994
995 object.dot1 = cos(theta1 * JMATH::PI/180.0);
996 object.dot2 = cos(theta2 * JMATH::PI/180.0);
997
998 return in;
999 }
1000
1001
1002 /**
1003 * Write atmospheric muon analyser to output.
1004 *
1005 * \param out output stream
1006 * \param object atmospheric muon analyser
1007 * \return output stream
1008 */
1009 friend inline std::ostream& operator<<(std::ostream& out, const JAtmosphericMuon& object)
1010 {
1011 out << acos(object.dot1) * 180.0 / JMATH::PI << ' '
1012 << acos(object.dot2) * 180.0 / JMATH::PI;
1013
1014 return out;
1015 }
1016
1017
1018 double dot1;
1019 double dot2;
1020 };
1021}
1022
1023#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)
static const int JMUONBEGIN
begin range of reconstruction stages
static const int JSHOWEREND
end range of reconstruction stages
static const int JSHOWERBEGIN
begin range of reconstruction stages
static const int JMUONEND
end range of reconstruction stages
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.
Direction set covering (part of) solid angle.
Definition JOmega3D.hh:68
Data structure for position in three dimensions.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition JShower3D.hh:97
3D shower with energy.
Definition JShower3E.hh:31
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition JTrack3D.hh:87
3D track with energy.
Definition JTrack3E.hh:34
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
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.
JPointing(const JDirection3D &dir)
Constructor.
JDirection3D getDirection() const
Get direction.
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 JGANDALF_LIKELIHOOD_RATIO
likelihood ratio between this and best alternative fit from JMuonGandalf
static const int JENERGY_NDF
number of degrees of freedom from JMuonEnergy
static const int JGANDALF_LAMBDA
largest eigenvalue of error matrix from JMuonGandalf
static const int JENERGY_ENERGY
uncorrected energy [GeV] from JMuonEnergy
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 JMuonEnergy
static const int JENERGY_CHI2
chi2 from JMuonEnergy
static const int JSTART_NPE_MIP_TOTAL
number of photo-electrons along the whole track from JMuonStart
static const int JENERGY_MUON_RANGE_METRES
range of a muon with the reconstructed energy [m] from JMuonEnergy
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 JMuonEnergy
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.1-2-g905a24d https://git.km3net.de/common/km3net-dataformat.
static const int JGANDALF_NUMBER_OF_ITERATIONS
number of iterations from JMuonGandalf
static const int JVETO_NUMBER_OF_HITS
number of hits from JVeto.cc
static const int JSHOWERFIT_ENERGY
uncorrected energy [GeV] from JShowerFit
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 JGANDALF_BETA1_RAD
uncertainty on the reconstructed track direction from the error matrix [rad] (to be deprecated) from ...
static const int JENERGY_MINIMAL_ENERGY
minimal energy [GeV] from JMuonEnergy
static const int AASHOWERFIT_ENERGY
uncorrected energy [GeV]
static const int JSTART_NPE_MIP_MISSED
number of photo-electrons missed from JMuonStart
static const int JENERGY_MAXIMAL_ENERGY
maximal energy [GeV] from JMuonEnergy
static const int JGANDALF_NUMBER_OF_HITS
number of hits from JMuonGandalf
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).
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.
JVertex3D getVertex(const JFit &fit)
Get vertex.
JShower3E getShower(const JFit &fit)
Get shower.
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.
JEvt::iterator gridify(JEvt::iterator __begin, JEvt::iterator __end, const int N)
Gridify set of fits.
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:136
Container for historical events.
Definition JHistory.hh:151
const JHistory & getHistory() const
Get history.
Definition JHistory.hh:301
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.