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