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