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