Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JEvtToolkit.hh
Go to the documentation of this file.
1 #ifndef __JFIT__JEVTTOOLKIT__
2 #define __JFIT__JEVTTOOLKIT__
3 
4 #include <istream>
5 #include <ostream>
6 #include <algorithm>
7 #include <cmath>
8 
10 
11 #include "JLang/JException.hh"
12 #include "JLang/JPredicate.hh"
13 #include "JLang/JFind_if.hh"
14 #include "JTools/JRange.hh"
15 #include "JTrigger/JHitL0.hh"
16 #include "JTrigger/JHitL1.hh"
17 #include "JTrigger/JHitR1.hh"
18 #include "JGeometry3D/JAngle3D.hh"
19 #include "JGeometry3D/JVector3D.hh"
20 #include "JGeometry3D/JVersor3D.hh"
23 #include "JGeometry3D/JAxis3D.hh"
24 #include "JGeometry3D/JTrack3D.hh"
25 #include "JGeometry3D/JTrack3E.hh"
26 #include "JMath/JMathToolkit.hh"
27 #include "JTools/JConstants.hh"
28 #include "JTools/JRange.hh"
29 #include "Jeep/JFunctionAdaptor.hh"
30 
31 #include "JFit/JLine1Z.hh"
32 #include "JFit/JShower3EZ.hh"
33 
34 #include "JReconstruction/JEvt.hh"
36 
37 
38 /**
39  * \author mdejong
40  */
41 
42 using namespace std;
43 
44 namespace JRECONSTRUCTION {}
45 namespace JPP { using namespace JRECONSTRUCTION; }
46 
47 namespace JRECONSTRUCTION {
48 
50  using JTRIGGER::JHitL0;
51  using JTRIGGER::JHitL1;
52  using JTRIGGER::JHitR1;
62  using JTOOLS::JRange;
63  using JFIT::JLine1Z;
64  using JFIT::JShower3Z;
65 
66 
67  /**
68  * Get position.
69  *
70  * \param fit fit
71  * \return position
72  */
73  inline JPosition3D getPosition(const JFit& fit)
74  {
75  return JPosition3D(fit.getX(), fit.getY(), fit.getZ());
76  }
77 
78 
79  /**
80  * Get direction.
81  *
82  * \param fit fit
83  * \return direction
84  */
85  inline JDirection3D getDirection(const JFit& fit)
86  {
87  return JDirection3D(fit.getDX(), fit.getDY(), fit.getDZ());
88  }
89 
90 
91  /**
92  * Get axis.
93  *
94  * \param fit fit
95  * \return axis
96  */
97  inline JAxis3D getAxis(const JFit& fit)
98  {
99  return JAxis3D(getPosition(fit), getDirection(fit));
100  }
101 
102 
103  /**
104  * Get track.
105  *
106  * \param fit fit
107  * \return track
108  */
109  inline JTrack3E getTrack(const JFit& fit)
110  {
111  return JTrack3E(JTrack3D(getAxis(fit), fit.getT()), fit.getE());
112  }
113 
114 
115  /**
116  * Get fit.
117  *
118  * \param history history
119  * \param track track
120  * \param Q quality
121  * \param NDF number of degrees of freedom
122  * \param energy Energy, which would be set as 0, if the fit does not reconstruct energy
123  * \param status status of the fit as defined in enum JFitStatus.hh
124  * \return fit
125  */
126  inline JFit getFit(const JHistory& history,
127  const JTrack3D& track,
128  const double Q,
129  const int NDF,
130  const double energy = 0.0,
131  const int status = 0)
132  {
133  return JFit(history,
134  track.getX(), track.getY(), track.getZ(),
135  track.getDX(), track.getDY(), track.getDZ(),
136  track.getT(),
137  Q, NDF,
138  energy, status);
139  }
140 
141 
142  /**
143  * Get fit.
144  *
145  * \param history history
146  * \param track track
147  * \param angle angle
148  * \param Q quality
149  * \param NDF number of degrees of freedom
150  * \param energy Energy, which would be set as 0, if the fit does not reconstruct energy
151  * \param status status of the fit as defined in JFitStatus.hh
152  * \return fit
153  */
154  inline JFit getFit(const JHistory& history,
155  const JLine1Z& track,
156  const JAngle3D& angle,
157  const double Q,
158  const int NDF,
159  const double energy = 0.0,
160  const int status = 0)
161  {
162  return JFit(history,
163  track.getX(), track.getY(), track.getZ(),
164  angle.getDX(), angle.getDY(), angle.getDZ(),
165  track.getT(),
166  Q, NDF,
167  energy, status);
168  }
169 
170 
171  /**
172  * Get dot product.
173  *
174  * \param first first fit
175  * \param second second fit
176  * \return dot product
177  */
178  inline double getDot(const JFit& first, const JFit& second)
179  {
180  return JMATH::getDot(getDirection(first), getDirection(second));
181  }
182 
183 
184  /**
185  * Get dot product.
186  *
187  * \param fit fit
188  * \param dir direction
189  * \return dot product
190  */
191  inline double getDot(const JFit& fit, const JDirection3D& dir)
192  {
193  return JMATH::getDot(getDirection(fit), dir);
194  }
195 
196 
197  /**
198  * Get quality of fit.\n
199  * The larger the quality, the better the fit.
200  *
201  * \param chi2 chi2
202  * \param N number of hits
203  * \param NDF number of degrees of freedom
204  * \return quality
205  */
206  inline double getQuality(const double chi2, const int N, const int NDF)
207  {
208  return N - 0.25 * chi2 / NDF;
209  }
210 
211 
212  /**
213  * Get quality of fit.\n
214  * The larger the quality, the better the fit.
215  *
216  * \param chi2 chi2
217  * \param NDF number of degrees of freedom
218  * \return quality
219  */
220  inline double getQuality(const double chi2, const int NDF)
221  {
222  return NDF - 0.25 * chi2 / NDF;
223  }
224 
225 
226  /**
227  * Get quality of fit.\n
228  * The larger the quality, the better the fit.
229  *
230  * \param chi2 chi2
231  * \return quality
232  */
233  inline double getQuality(const double chi2)
234  {
235  return -chi2;
236  }
237 
238 
239  /**
240  * Comparison of fit results.
241  *
242  * \param first first fit
243  * \param second second fit
244  * \return true if first fit has better quality than second; else false
245  */
246  inline bool qualitySorter(const JFit& first, const JFit& second)
247  {
248  if (first.getHistory().size() == second.getHistory().size())
249  return first.getQ() > second.getQ();
250  else
251  return first.getHistory().size() > second.getHistory().size();
252  }
253 
254 
255  /**
256  * General purpose sorter of fit results.
257  *
258  * The default constructor will sort fit results according the method JRECONSTRUCTION::qualitySorter.\n
259  * A different method can dynamically be loaded from a (shared) library using class JEEP::JFunctionAdaptor.
260  * For the definition of an alternative method, see e.g. quality_sorter.cc
261  */
262  struct JQualitySorter :
263  public JFunctionAdaptor<bool, const JFit&, const JFit&>
264  {
266  typedef function_adaptor_type::pF pF;
267 
268 
269  /**
270  * Default constructor.
271  */
274  {}
275  };
276 
277 
278  /**
279  * Test whether given fit has specified history.
280  *
281  * \param fit fit
282  * \param type application type
283  * \return true if type in history; else false
284  */
285  inline bool has_history(const JFit& fit, const int type)
286  {
287  return std::find_if(fit.getHistory().begin(),
288  fit.getHistory().end(),
289  JLANG::make_predicate(&JEvent::type, type)) != fit.getHistory().end();
290  }
291 
292 
293  /**
294  * Test whether given fit has specified history.
295  *
296  * \param fit fit
297  * \param range application type range
298  * \return true if type in history; else false
299  */
300  inline bool has_history(const JFit& fit, const JRange<int>& range)
301  {
302  return std::find_if(fit.getHistory().begin(),
303  fit.getHistory().end(),
304  JLANG::make_find_if(&JEvent::type, range)) != fit.getHistory().end();
305  }
306 
307 
308  /**
309  * Test whether given fit has muon prefit in history.
310  *
311  * \param fit fit
312  * \return true if muon prefit in history; else false
313  */
314  inline bool has_muon_prefit(const JFit& fit)
315  {
316  return has_history(fit, JMUONPREFIT);
317  }
318 
319 
320  /**
321  * Test whether given fit has muon simplex in history.
322  *
323  * \param fit fit
324  * \return true if muon simplex in history; else false
325  */
326  inline bool has_muon_simplex(const JFit& fit)
327  {
328  return has_history(fit, JMUONSIMPLEX);
329  }
330 
331 
332  /**
333  * Test whether given fit has muon gandalf in history.
334  *
335  * \param fit fit
336  * \return true if muon gandalf in history; else false
337  */
338  inline bool has_muon_gandalf(const JFit& fit)
339  {
340  return has_history(fit, JMUONGANDALF);
341  }
342 
343 
344  /**
345  * Test whether given fit has muon energy in history.
346  *
347  * \param fit fit
348  * \return true if muon energy in history; else false
349  */
350  inline bool has_muon_energy(const JFit& fit)
351  {
352  return has_history(fit, JMUONENERGY);
353  }
354 
355 
356  /**
357  * Test whether given fit has muon start in history.
358  *
359  * \param fit fit
360  * \return true if muon start in history; else false
361  */
362  inline bool has_muon_start(const JFit& fit)
363  {
364  return has_history(fit, JMUONSTART);
365  }
366 
367 
368  /**
369  * Test whether given fit has muon fit in history.
370  *
371  * \param fit fit
372  * \return true if muon fit in history; else false
373  */
374  inline bool has_muon_fit(const JFit& fit)
375  {
377  }
378 
379 
380  /**
381  * Test whether given fit has shower prefit in history.
382  *
383  * \param fit fit
384  * \return true if shower prefit in history; else false
385  */
386  inline bool has_shower_prefit(const JFit& fit)
387  {
388  return has_history(fit, JSHOWERPREFIT);
389  }
390 
391 
392  /**
393  * Test whether given fit has shower position fit in history.
394  *
395  * \param fit fit
396  * \return true if shower position fit in history; else false
397  */
398  inline bool has_shower_positionfit(const JFit& fit)
399  {
400  return has_history(fit, JSHOWERPOSITIONFIT);
401  }
402 
403 
404  /**
405  * Test whether given fit has shower complete fit in history.
406  *
407  * \param fit fit
408  * \return true if shower complete fit in history; else false
409  */
410  inline bool has_shower_completefit(const JFit& fit)
411  {
412  return has_history(fit, JSHOWERCOMPLETEFIT);
413  }
414 
415 
416  /**
417  * Test whether given fit has shower fit in history.
418  *
419  * \param fit fit
420  * \return true if shower fit in history; else false
421  */
422  inline bool has_shower_fit(const JFit& fit)
423  {
425  }
426 
427 
428  /**
429  * Test whether given event has a track according selection.\n
430  * The track selector corresponds to the function operator <tt>bool selector(const Trk&);</tt>.
431  *
432  * \param evt event
433  * \param selector track selector
434  * \return true if at least one corresponding track; else false
435  */
436  template<class JTrackSelector_t>
437  inline bool has_reconstructed_track(const JEvt& evt, JTrackSelector_t selector)
438  {
439  return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
440  }
441 
442 
443  /**
444  * Test whether given event has a track with muon reconstruction.
445  *
446  * \param evt event
447  * \return true if at least one reconstructed muon; else false
448  */
449  inline bool has_reconstructed_muon(const JEvt& evt)
450  {
452  }
453 
454 
455  /**
456  * Test whether given event has a track with shower reconstruction.
457  *
458  * \param evt event
459  * \return true if at least one reconstructed shower; else false
460  */
461  inline bool has_reconstructed_shower(const JEvt& evt)
462  {
464  }
465 
466 
467  /**
468  * Get best reconstructed track.\n
469  * The track selector corresponds to the function operator <tt>bool selector(const Trk&);</tt> and
470  * the track comparator to <tt>bool comprator(const Trk&, const Trk&);</tt>.
471  *
472  * \param evt event
473  * \param selector track selector
474  * \param comparator track comparator
475  * \return track
476  */
477  template<class JTrackSelector_t, class JQualitySorter_t>
478  inline const JFit& get_best_reconstructed_track(const JEvt& evt,
479  JTrackSelector_t selector,
480  JQualitySorter_t comparator)
481  {
482  JEvt::const_iterator p = std::find_if(evt.begin(), evt.begin(), selector);
483 
484  for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
485  if (selector(*i) && comparator(*i, *p)) {
486  p = i;
487  }
488  }
489 
490  if (p != evt.end())
491  return *p;
492  else
493  THROW(JIndexOutOfRange, "This event has no fit with given selector.");
494  }
495 
496 
497  /**
498  * Get best reconstructed muon.
499  *
500  * \param evt event
501  * \return track
502  */
503  inline const JFit& get_best_reconstructed_muon(const JEvt& evt)
504  {
506  }
507 
508 
509  /**
510  * Get best reconstructed shower.
511  *
512  * \param evt event
513  * \return track
514  */
515  inline const JFit& get_best_reconstructed_shower(const JEvt& evt)
516  {
518  }
519 
520 
521  /**
522  * Auxiliary class for permutations of L0 hits.
523  */
525  {
526  /**
527  * Default constructor.
528  */
530  {}
531 
532 
533  /**
534  * Comparison of L0 hits by PMT identifier (first) and by time (second).
535  *
536  * \param first first hit
537  * \param second second hit
538  * \return true if first hit before second; else false
539  */
540  template<class JHitL0_t>
541  inline bool operator ()(const JHitL0_t& first, const JHitL0_t& second) const
542  {
543  if (first.getPMTID() == second.getPMTID())
544  return first.getT() < second.getT();
545  else
546  return first.getPMTID() < second.getPMTID();
547  }
548  };
549 
550 
551  /**
552  * Auxiliary class for permutations of L1 hits.
553  */
555  {
556  /**
557  * Default constructor.
558  */
560  {}
561 
562 
563  /**
564  * Comparison of L1 hits by module identifier (first) and by time (second).
565  *
566  * \param first first hit
567  * \param second second hit
568  * \return true if first hit before second; else false
569  */
570  template<class JHitL1_t>
571  inline bool operator ()(const JHitL1_t& first, const JHitL1_t& second) const
572  {
573  if (first.getModuleID() == second.getModuleID())
574  return first.getT() < second.getT();
575  else
576  return first.getModuleID() < second.getModuleID();
577  }
578  };
579 
580 
581  /**
582  * Auxiliary class to compare fit results with respect to a reference direction (e.g. true muon).
583  * The sort operation results in an ordered set of fit results with increasing angle between
584  * the reference direction and that of the fit results.
585  */
586  class JPointing {
587  public:
588  /**
589  * Default constructor.
590  */
592  {}
593 
594 
595  /**
596  * Constructor.
597  *
598  * \param dir reference direction
599  */
600  JPointing(const JVersor3D& dir)
601  {
602  this->dir = dir;
603  }
604 
605 
606  /**
607  * Get direction.
608  *
609  * \return direction
610  */
612  {
613  return dir;
614  }
615 
616 
617  /**
618  * Get dot product between reference direction and fit result.
619  *
620  * \param fit fit
621  * \return dot product
622  */
623  inline double getDot(const JFit& fit) const
624  {
625  return JRECONSTRUCTION::getDot(fit, dir);
626  }
627 
628 
629  /**
630  * Get angle between reference direction and fit result.
631  *
632  * \param fit fit
633  * \return angle [deg]
634  */
635  inline double getAngle(const JFit& fit) const
636  {
637  const double dot = getDot(fit);
638 
639  if (dot >= +1.0)
640  return 0.0;
641  else if (dot <= -1.0)
642  return 180.0;
643  else
644  return acos(dot) * 180.0 / JTOOLS::PI;
645  }
646 
647 
648  /**
649  * Comparison of fit results.
650  *
651  * \param first first fit
652  * \param second second fit
653  * \return true if first fit worse; else false
654  */
655  inline bool operator()(const JFit& first, const JFit& second) const
656  {
657  return this->getDot(first) < this->getDot(second);
658  }
659 
660 
661  /**
662  * Select best fit result.
663  *
664  * \param __begin begin of fit results
665  * \param __end end of fit results
666  * \return best fit result
667  */
668  template<class T>
669  inline T operator()(T __begin, T __end) const
670  {
671  return std::max_element(__begin, __end, *this);
672  }
673 
674  protected:
676  };
677 
678  /**
679  * Auxiliary class to compare fit results with respect to a reference position (e.g. true muon).
680  * The sort operation results in an ordered set of fit results with increasing distance between
681  * the reference position and that of the fit results.
682  */
683  class JPosition {
684  public:
685  /**
686  * Constructor.
687  *
688  * \param pos reference position
689  */
691  {
692  this->pos = pos;
693  }
694 
695  /**
696  * Comparison of fit results.
697  *
698  * \param first first fit
699  * \param second second fit
700  * \return true if first fit better; else false
701  */
702  inline bool operator()(const JFit& first, const JFit& second) const
703  {
704  return this->pos.getDistance(getPosition(first)) < this->pos.getDistance(getPosition(second));
705  }
706 
707  /**
708  * Select best fit result.
709  *
710  * \param __begin begin of fit results
711  * \param __end end of fit results
712  * \return best fit result
713  */
714  template<class T>
715  inline T operator()(T __begin, T __end) const
716  {
717  return std::min_element(__begin, __end, *this);
718  }
719 
720  protected:
722  };
723 
724 
726  public:
727  /**
728  * Constructor.
729  *
730  * \param E reference energy
731  */
732  JShowerEnergy(double E)
733  {
734  this->energy = E;
735  }
736 
737  /**
738  * Comparison of fit results.
739  *
740  * \param first first fit
741  * \param second second fit
742  * \return true if first fit better; else false
743  */
744  inline bool operator()(const JFit& first, const JFit& second) const
745  {
746  return abs(this->energy - first.getE()) < abs(this->energy - second.getE());
747  }
748 
749  /**
750  * Select best fit result.
751  *
752  * \param __begin begin of fit results
753  * \param __end end of fit results
754  * \return best fit result
755  */
756  template<class T>
757  inline T operator()(T __begin, T __end) const
758  {
759  return std::min_element(__begin, __end, *this);
760  }
761 
762  protected:
763  double energy;
764  };
765 
766 
767  /**
768  * Auxiliary class to evaluate atmospheric muon hypothesis.
769  * The hypothesis is tested by means of the difference in quality
770  * between the best upward and best downward track.
771  */
773  public:
774  /**
775  * Default constructor.
776  */
778  dot1(0.0),
779  dot2(0.0)
780  {}
781 
782 
783  /**
784  * Constructor.
785  *
786  * \param theta1 upper hemisphere angle [deg]
787  * \param theta2 lower hemisphere angle [deg]
788  */
789  JAtmosphericMuon(const double theta1,
790  const double theta2) :
791  dot1(cos(theta1 * JTOOLS::PI/180.0)),
792  dot2(cos(theta2 * JTOOLS::PI/180.0))
793  {}
794 
795 
796  /**
797  * Test is event is atmospheric muon.
798  *
799  * \param __begin begin of data
800  * \param __end end of data
801  * \return negative if preferably down / positive if preferably up
802  */
803  double operator()(JEvt::const_iterator __begin,
804  JEvt::const_iterator __end) const
805  {
806  double Qup = 0.0;
807  double Qdown = 0.0;
808 
809  for (JEvt::const_iterator i = __begin; i != __end; ++i) {
810 
811  if (i->getDZ() >= dot1) {
812 
813  if (i->getQ() > Qup) {
814  Qup = i->getQ();
815  }
816 
817  } else if (i->getDZ() <= dot2) {
818 
819  if (i->getQ() > Qdown) {
820  Qdown = i->getQ();
821  }
822  }
823  }
824 
825  return Qup - Qdown;
826  }
827 
828 
829  /**
830  * Read atmospheric muon analyser from input.
831  *
832  * \param in input stream
833  * \param object atmospheric muon analyser
834  * \return input stream
835  */
836  friend inline std::istream& operator>>(std::istream& in, JAtmosphericMuon& object)
837  {
838  double theta1, theta2;
839 
840  in >> theta1 >> theta2;
841 
842  object.dot1 = cos(theta1 * JTOOLS::PI/180.0);
843  object.dot2 = cos(theta2 * JTOOLS::PI/180.0);
844 
845  return in;
846  }
847 
848 
849  /**
850  * Write atmospheric muon analyser to output.
851  *
852  * \param out output stream
853  * \param object atmospheric muon analyser
854  * \return output stream
855  */
856  friend inline std::ostream& operator<<(std::ostream& out, const JAtmosphericMuon& object)
857  {
858  out << acos(object.dot1) * 180.0 / JTOOLS::PI << ' '
859  << acos(object.dot2) * 180.0 / JTOOLS::PI;
860 
861  return out;
862  }
863 
864 
865  double dot1;
866  double dot2;
867  };
868 }
869 
870 #endif
static const int JMUONSTART
const JFit & get_best_reconstructed_shower(const JEvt &evt)
Get best reconstructed shower.
Definition: JEvtToolkit.hh:515
bool has_muon_gandalf(const JFit &fit)
Test whether given fit has muon gandalf in history.
Definition: JEvtToolkit.hh:338
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:31
bool has_reconstructed_shower(const JEvt &evt)
Test whether given event has a track with shower reconstruction.
Definition: JEvtToolkit.hh:461
bool has_shower_prefit(const Trk &track)
Test whether given track has shower prefit in history.
Exceptions.
JHitL1Comparator()
Default constructor.
Definition: JEvtToolkit.hh:559
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
Definition: JPredicate.hh:128
JVersor3D getDirection() const
Get direction.
Definition: JEvtToolkit.hh:611
Auxiliary class to compare fit results with respect to a reference position (e.g. ...
Definition: JEvtToolkit.hh:683
Auxiliary methods for geometrical methods.
Data structure for L1 hit.
Definition: JHitL1.hh:34
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
Auxiliary class to compare fit results with respect to a reference direction (e.g.
Definition: JEvtToolkit.hh:586
bool has_muon_start(const JFit &fit)
Test whether given fit has muon start in history.
Definition: JEvtToolkit.hh:362
Auxiliary class for permutations of L0 hits.
Definition: JEvtToolkit.hh:524
static const int JSHOWEREND
end range of reconstruction stages
JTrack3E getTrack(const Trk &track)
Get track.
T operator()(T __begin, T __end) const
Select best fit result.
Definition: JEvtToolkit.hh:669
JHitL0Comparator()
Default constructor.
Definition: JEvtToolkit.hh:529
bool has_shower_completefit(const Trk &track)
Test whether given track has shower complete fit in history.
double getDot(const JNeutrinoDirection &first, const JNeutrinoDirection &second)
Dot product.
Definition: JAstronomy.hh:409
JAtmosphericMuon(const double theta1, const double theta2)
Constructor.
Definition: JEvtToolkit.hh:789
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
General purpose sorter of fit results.
Definition: JEvtToolkit.hh:262
JPosition(JVector3D pos)
Constructor.
Definition: JEvtToolkit.hh:690
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
function_adaptor_type::pF pF
Definition: JEvtToolkit.hh:266
static const double PI
Constants.
Definition: JConstants.hh:20
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
Definition: JEvtToolkit.hh:285
JPointing(const JVersor3D &dir)
Constructor.
Definition: JEvtToolkit.hh:600
double getZ(const JPosition3D &pos) const
Get point of emission of Cherenkov light along muon path.
Definition: JLine1Z.hh:134
JFunctionAdaptor< bool, const JFit &, const JFit & > function_adaptor_type
Definition: JEvtToolkit.hh:265
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
Definition: JEvtToolkit.hh:744
Container for historical events.
Definition: JHistory.hh:98
int type
Definition: JProperties.cc:16
static const int JMUONBEGIN
begin range of reconstruction stages
3D track with energy.
Definition: JTrack3E.hh:29
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
Definition: JEvtToolkit.hh:206
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
const JFit & get_best_reconstructed_muon(const JEvt &evt)
Get best reconstructed muon.
Definition: JEvtToolkit.hh:503
static const int JSHOWERPOSITIONFIT
Basic data structure for L0 hit.
Data structure for track fit results.
Definition: JEvt.hh:32
Axis object.
Definition: JAxis3D.hh:38
static const int JSHOWERPREFIT
double getDot(const JFit &first, const JFit &second)
Get dot product.
Definition: JEvtToolkit.hh:178
Constants.
bool has_shower_positionfit(const Trk &track)
Test whether given track has shower position fit in history.
static const int JMUONPREFIT
double getAngle(const JFit &fit) const
Get angle between reference direction and fit result.
Definition: JEvtToolkit.hh:635
JQualitySorter()
Default constructor.
Definition: JEvtToolkit.hh:272
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
Definition: JEvtToolkit.hh:702
Data structure for vector in three dimensions.
Definition: JVector3D.hh:33
friend std::istream & operator>>(std::istream &in, JAtmosphericMuon &object)
Read atmospheric muon analyser from input.
Definition: JEvtToolkit.hh:836
double getT() const
Get time.
Definition: JEvt.hh:151
double getX() const
Get X-position.
Definition: JEvt.hh:145
double getDY() const
Get y direction.
Definition: JVersor3D.hh:103
JPointing()
Default constructor.
Definition: JEvtToolkit.hh:591
double getDX() const
Get x direction.
Definition: JVersor3D.hh:92
static const int JMUONGANDALF
JAxis3D getAxis(const Trk &track)
Get axis.
bool has_muon_simplex(const JFit &fit)
Test whether given fit has muon simplex in history.
Definition: JEvtToolkit.hh:326
do set_variable OUTPUT_DIRECTORY $WORKDIR T
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
friend std::ostream & operator<<(std::ostream &out, const JAtmosphericMuon &object)
Write atmospheric muon analyser to output.
Definition: JEvtToolkit.hh:856
double getY() const
Get y position.
Definition: JVector3D.hh:103
Auxiliary class to evaluate atmospheric muon hypothesis.
Definition: JEvtToolkit.hh:772
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition: JTrack3D.hh:126
Range of values.
Definition: JRange.hh:34
Data structure for cascade in positive z-direction.
Definition: JShower3Z.hh:31
double getY() const
Get Y-position.
Definition: JEvt.hh:146
static const int JSHOWERCOMPLETEFIT
bool has_shower_fit(const Trk &track)
Test whether given track has default shower fit in history.
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 getDot(const JFit &fit) const
Get dot product between reference direction and fit result.
Definition: JEvtToolkit.hh:623
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:42
double getDZ() const
Get Z-slope.
Definition: JEvt.hh:150
JFit getFit(const JHistory &history, const JTrack3D &track, const double Q, const int NDF, const double energy=0.0, const int status=0)
Get fit.
Definition: JEvtToolkit.hh:126
Reduced data structure for L1 hit.
double getQ() const
Get quality.
Definition: JEvt.hh:152
static const int JSHOWERBEGIN
begin range of reconstruction stages
Auxiliary class for permutations of L1 hits.
Definition: JEvtToolkit.hh:554
Data structure for set of track fit results.
Definition: JEvt.hh:294
bool has_reconstructed_muon(const JEvt &evt)
Test whether given event has a track with muon reconstruction.
Definition: JEvtToolkit.hh:449
Auxiliary class to define a range between two values.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition: JLine1Z.hh:114
static const int JMUONSIMPLEX
double getZ() const
Get Z-position.
Definition: JEvt.hh:147
Data structure for L0 hit.
Definition: JHitL0.hh:27
JFIT::JFit JFit
Definition: JEvt.hh:386
Data structure for fit of straight line paralel to z-axis.
Definition: JLine1Z.hh:27
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
Definition: JEvtToolkit.hh:655
double getX() const
Get x position.
Definition: JVector3D.hh:93
JShowerEnergy(double E)
Constructor.
Definition: JEvtToolkit.hh:732
bool has_muon_fit(const JFit &fit)
Test whether given fit has muon fit in history.
Definition: JEvtToolkit.hh:374
bool has_muon_prefit(const JFit &fit)
Test whether given fit has muon prefit in history.
Definition: JEvtToolkit.hh:314
T operator()(T __begin, T __end) const
Select best fit result.
Definition: JEvtToolkit.hh:757
Reduced data structure for L1 hit.
Definition: JHitR1.hh:31
double getDY() const
Get Y-slope.
Definition: JEvt.hh:149
JDirection3D getDirection(const Vec &v)
Get direction.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
bool has_reconstructed_track(const JEvt &evt, JTrackSelector_t selector)
Test whether given event has a track according selection.
Definition: JEvtToolkit.hh:437
Exception for accessing an index in a collection that is outside of its range.
Definition: JException.hh:90
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:23
double operator()(JEvt::const_iterator __begin, JEvt::const_iterator __end) const
Test is event is atmospheric muon.
Definition: JEvtToolkit.hh:803
Function adaptor.
bool has_muon_energy(const JFit &fit)
Test whether given fit has muon energy in history.
Definition: JEvtToolkit.hh:350
const JFit & get_best_reconstructed_track(const JEvt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
Get best reconstructed track.
Definition: JEvtToolkit.hh:478
const JHistory & getHistory() const
Get history.
Definition: JHistory.hh:228
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
double getZ() const
Get z position.
Definition: JVector3D.hh:114
T operator()(T __begin, T __end) const
Select best fit result.
Definition: JEvtToolkit.hh:715
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:114
double getE() const
Get energy.
Definition: JEvt.hh:154
double getDX() const
Get X-slope.
Definition: JEvt.hh:148
double getDX() const
Get x direction.
Definition: JAngle3D.hh:106
bool qualitySorter(const JRECONSTRUCTION::JFit &first, const JRECONSTRUCTION::JFit &second)
Comparison of fit results.
static const int JMUONENERGY
Basic data structure for L1 hit.
double getDZ() const
Get z direction.
Definition: JAngle3D.hh:128
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:37
static const int JMUONEND
end range of reconstruction stages
JAtmosphericMuon()
Default constructor.
Definition: JEvtToolkit.hh:777
JPosition3D getPosition(const Vec &v)
Get position.
double getDY() const
Get y direction.
Definition: JAngle3D.hh:117