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