Jpp  19.0.0
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 JVersor3D& dir)
190  {
191  return JMATH::getDot(getDirection(fit), dir);
192  }
193 
194 
195  /**
196  * Get space angle.
197  *
198  * \param first first fit
199  * \param second second fit
200  * \return angle [deg]
201  */
202  inline double getAngle(const JFit& first, const JFit& second)
203  {
204  return JMATH::getAngle(getDirection(first), getDirection(second));
205  }
206 
207 
208  /**
209  * Get space angle.
210  *
211  * \param fit fit
212  * \param dir direction
213  * \return angle [deg]
214  */
215  inline double getAngle(const JFit& fit, const JVersor3D& dir)
216  {
217  return JMATH::getAngle(getDirection(fit), dir);
218  }
219 
220 
221  /**
222  * Get quality of fit.\n
223  * The larger the quality, the better the fit.
224  *
225  * \param chi2 chi2
226  * \param N number of hits
227  * \param NDF number of degrees of freedom
228  * \return quality
229  */
230  inline double getQuality(const double chi2, const int N, const int NDF)
231  {
232  return N - 0.25 * chi2 / NDF;
233  }
234 
235 
236  /**
237  * Get quality of fit.\n
238  * The larger the quality, the better the fit.
239  *
240  * \param chi2 chi2
241  * \param NDF number of degrees of freedom
242  * \return quality
243  */
244  inline double getQuality(const double chi2, const int NDF)
245  {
246  return NDF - 0.25 * chi2 / NDF;
247  }
248 
249 
250  /**
251  * Get quality of fit.\n
252  * The larger the quality, the better the fit.
253  *
254  * \param chi2 chi2
255  * \return quality
256  */
257  inline double getQuality(const double chi2)
258  {
259  return -chi2;
260  }
261 
262 
263  /**
264  * Comparison of fit results.
265  *
266  * \param first first fit
267  * \param second second fit
268  * \return true if first fit has better quality than second; else false
269  */
270  inline bool qualitySorter(const JFit& first, const JFit& second)
271  {
272  if (first.getHistory().size() == second.getHistory().size())
273  return first.getQ() > second.getQ();
274  else
275  return first.getHistory().size() > second.getHistory().size();
276  }
277 
278 
279  /**
280  * General purpose sorter of fit results.
281  *
282  * The default constructor will sort fit results according the method JRECONSTRUCTION::qualitySorter.\n
283  * A different method can dynamically be loaded from a (shared) library using class JEEP::JFunctionAdaptor.
284  * For the definition of an alternative method, see e.g.\ quality_sorter.cc
285  */
286  struct JQualitySorter :
287  public JFunctionAdaptor<bool, const JFit&, const JFit&>
288  {
290  typedef function_adaptor_type::pF pF;
291 
292 
293  /**
294  * Default constructor.
295  */
298  {}
299  };
300 
301 
302  /**
303  * Test whether given fit has specified history.
304  *
305  * \param fit fit
306  * \param type application type
307  * \return true if type in history; else false
308  */
309  inline bool has_history(const JFit& fit, const int type)
310  {
311  return std::find_if(fit.getHistory().begin(),
312  fit.getHistory().end(),
313  JLANG::make_predicate(&JEvent::type, type)) != fit.getHistory().end();
314  }
315 
316 
317  /**
318  * Test whether given fit has specified history.
319  *
320  * \param fit fit
321  * \param range application type range
322  * \return true if type in history; else false
323  */
324  inline bool has_history(const JFit& fit, const JRange<int>& range)
325  {
326  return std::find_if(fit.getHistory().begin(),
327  fit.getHistory().end(),
328  JLANG::make_find_if(&JEvent::type, range)) != fit.getHistory().end();
329  }
330 
331 
332  /**
333  * Test whether given fit has muon prefit in history.
334  *
335  * \param fit fit
336  * \return true if muon prefit in history; else false
337  */
338  inline bool has_muon_prefit(const JFit& fit)
339  {
340  return has_history(fit, JMUONPREFIT);
341  }
342 
343 
344  /**
345  * Test whether given fit has muon simplex in history.
346  *
347  * \param fit fit
348  * \return true if muon simplex in history; else false
349  */
350  inline bool has_muon_simplex(const JFit& fit)
351  {
352  return has_history(fit, JMUONSIMPLEX);
353  }
354 
355 
356  /**
357  * Test whether given fit has muon gandalf in history.
358  *
359  * \param fit fit
360  * \return true if muon gandalf in history; else false
361  */
362  inline bool has_muon_gandalf(const JFit& fit)
363  {
364  return has_history(fit, JMUONGANDALF);
365  }
366 
367 
368  /**
369  * Test whether given fit has muon energy in history.
370  *
371  * \param fit fit
372  * \return true if muon energy in history; else false
373  */
374  inline bool has_muon_energy(const JFit& fit)
375  {
376  return has_history(fit, JMUONENERGY);
377  }
378 
379 
380  /**
381  * Test whether given fit has muon start in history.
382  *
383  * \param fit fit
384  * \return true if muon start in history; else false
385  */
386  inline bool has_muon_start(const JFit& fit)
387  {
388  return has_history(fit, JMUONSTART);
389  }
390 
391 
392  /**
393  * Test whether given fit has muon fit in history.
394  *
395  * \param fit fit
396  * \return true if muon fit in history; else false
397  */
398  inline bool has_muon_fit(const JFit& fit)
399  {
401  }
402 
403 
404  /**
405  * Test whether given fit has shower prefit in history.
406  *
407  * \param fit fit
408  * \return true if shower prefit in history; else false
409  */
410  inline bool has_shower_prefit(const JFit& fit)
411  {
412  return has_history(fit, JSHOWERPREFIT);
413  }
414 
415 
416  /**
417  * Test whether given fit has shower position fit in history.
418  *
419  * \param fit fit
420  * \return true if shower position fit in history; else false
421  */
422  inline bool has_shower_positionfit(const JFit& fit)
423  {
424  return has_history(fit, JSHOWERPOSITIONFIT);
425  }
426 
427 
428  /**
429  * Test whether given fit has shower complete fit in history.
430  *
431  * \param fit fit
432  * \return true if shower complete fit in history; else false
433  */
434  inline bool has_shower_completefit(const JFit& fit)
435  {
436  return has_history(fit, JSHOWERCOMPLETEFIT);
437  }
438 
439 
440  /**
441  * Test whether given fit has shower fit in history.
442  *
443  * \param fit fit
444  * \return true if shower fit in history; else false
445  */
446  inline bool has_shower_fit(const JFit& fit)
447  {
449  }
450 
451 
452  /**
453  * Test whether given event has a track according selection.\n
454  * The track selector corresponds to the function operator <tt>bool selector(const Trk&);</tt>.
455  *
456  * \param evt event
457  * \param selector track selector
458  * \return true if at least one corresponding track; else false
459  */
460  template<class JTrackSelector_t>
461  inline bool has_reconstructed_track(const JEvt& evt, JTrackSelector_t selector)
462  {
463  return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
464  }
465 
466 
467  /**
468  * Test whether given event has a track with muon reconstruction.
469  *
470  * \param evt event
471  * \return true if at least one reconstructed muon; else false
472  */
473  inline bool has_reconstructed_muon(const JEvt& evt)
474  {
476  }
477 
478 
479  /**
480  * Test whether given event has a track with shower reconstruction.
481  *
482  * \param evt event
483  * \return true if at least one reconstructed shower; else false
484  */
485  inline bool has_reconstructed_shower(const JEvt& evt)
486  {
488  }
489 
490 
491  /**
492  * Get best reconstructed track.\n
493  * The track selector corresponds to the function operator <tt>bool selector(const Trk&);</tt> and
494  * the track comparator to <tt>bool comprator(const Trk&, const Trk&);</tt>.
495  *
496  * \param evt event
497  * \param selector track selector
498  * \param comparator track comparator
499  * \return track
500  */
501  template<class JTrackSelector_t, class JQualitySorter_t>
502  inline const JFit& get_best_reconstructed_track(const JEvt& evt,
503  JTrackSelector_t selector,
504  JQualitySorter_t comparator)
505  {
506  JEvt::const_iterator p = std::find_if(evt.begin(), evt.end(), selector);
507 
508  for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
509  if (selector(*i) && comparator(*i, *p)) {
510  p = i;
511  }
512  }
513 
514  if (p != evt.end())
515  return *p;
516  else
517  THROW(JIndexOutOfRange, "This event has no fit with given selector.");
518  }
519 
520 
521  /**
522  * Get best reconstructed muon.
523  *
524  * \param evt event
525  * \return track
526  */
527  inline const JFit& get_best_reconstructed_muon(const JEvt& evt)
528  {
530  }
531 
532 
533  /**
534  * Get best reconstructed shower.
535  *
536  * \param evt event
537  * \return track
538  */
539  inline const JFit& get_best_reconstructed_shower(const JEvt& evt)
540  {
542  }
543 
544 
545  /**
546  * Auxiliary class to compare fit results with respect to a reference direction (e.g.\ true muon).
547  * The sort operation results in an ordered set of fit results with increasing angle between
548  * the reference direction and that of the fit results.
549  */
550  class JPointing {
551  public:
552  /**
553  * Default constructor.
554  */
556  {}
557 
558 
559  /**
560  * Constructor.
561  *
562  * \param dir reference direction
563  */
564  JPointing(const JVersor3D& dir)
565  {
566  this->dir = dir;
567  }
568 
569 
570  /**
571  * Constructor.
572  *
573  * \param fit fit
574  */
575  JPointing(const JFit& fit)
576  {
577  this->dir = JRECONSTRUCTION::getDirection(fit);
578  }
579 
580 
581  /**
582  * Get direction.
583  *
584  * \return direction
585  */
587  {
588  return dir;
589  }
590 
591 
592  /**
593  * Get angle between reference direction and fit result.
594  *
595  * \param fit fit
596  * \return angle [deg]
597  */
598  inline double getAngle(const JFit& fit) const
599  {
600  const double dot = getDot(fit, dir);
601 
602  if (dot >= +1.0)
603  return 0.0;
604  else if (dot <= -1.0)
605  return 180.0;
606  else
607  return acos(dot) * 180.0 / JMATH::PI;
608  }
609 
610 
611  /**
612  * Comparison of fit results.
613  *
614  * \param first first fit
615  * \param second second fit
616  * \return true if first fit better; else false
617  */
618  inline bool operator()(const JFit& first, const JFit& second) const
619  {
620  return getDot(first, dir) > getDot(second, dir);
621  }
622 
623 
624  /**
625  * Select best fit result.
626  *
627  * \param __begin begin of fit results
628  * \param __end end of fit results
629  * \return best fit result
630  */
631  template<class T>
632  inline T operator()(T __begin, T __end) const
633  {
634  return std::min_element(__begin, __end, *this);
635  }
636 
637  protected:
639  };
640 
641  /**
642  * Auxiliary class to compare fit results with respect to a reference position (e.g.\ true muon).
643  * The sort operation results in an ordered set of fit results with increasing distance between
644  * the reference position and that of the fit results.
645  */
646  class JPosition {
647  public:
648  /**
649  * Constructor.
650  *
651  * \param pos reference position
652  */
654  {
655  this->pos = pos;
656  }
657 
658  /**
659  * Comparison of fit results.
660  *
661  * \param first first fit
662  * \param second second fit
663  * \return true if first fit better; else false
664  */
665  inline bool operator()(const JFit& first, const JFit& second) const
666  {
667  return this->pos.getDistance(getPosition(first)) < this->pos.getDistance(getPosition(second));
668  }
669 
670  /**
671  * Select best fit result.
672  *
673  * \param __begin begin of fit results
674  * \param __end end of fit results
675  * \return best fit result
676  */
677  template<class T>
678  inline T operator()(T __begin, T __end) const
679  {
680  return std::min_element(__begin, __end, *this);
681  }
682 
683  protected:
685  };
686 
687 
689  public:
690  /**
691  * Constructor.
692  *
693  * \param E reference energy
694  */
695  JShowerEnergy(double E)
696  {
697  this->energy = E;
698  }
699 
700  /**
701  * Comparison of fit results.
702  *
703  * \param first first fit
704  * \param second second fit
705  * \return true if first fit better; else false
706  */
707  inline bool operator()(const JFit& first, const JFit& second) const
708  {
709  return fabs(this->energy - first.getE()) < fabs(this->energy - second.getE());
710  }
711 
712  /**
713  * Select best fit result.
714  *
715  * \param __begin begin of fit results
716  * \param __end end of fit results
717  * \return best fit result
718  */
719  template<class T>
720  inline T operator()(T __begin, T __end) const
721  {
722  return std::min_element(__begin, __end, *this);
723  }
724 
725  protected:
726  double energy;
727  };
728 
729 
730  /**
731  * Auxiliary class to evaluate atmospheric muon hypothesis.
732  * The hypothesis is tested by means of the difference in quality
733  * between the best upward and best downward track.
734  */
736  public:
737  /**
738  * Default constructor.
739  */
741  dot1(0.0),
742  dot2(0.0)
743  {}
744 
745 
746  /**
747  * Constructor.
748  *
749  * \param theta1 upper hemisphere angle [deg]
750  * \param theta2 lower hemisphere angle [deg]
751  */
752  JAtmosphericMuon(const double theta1,
753  const double theta2) :
754  dot1(cos(theta1 * JMATH::PI/180.0)),
755  dot2(cos(theta2 * JMATH::PI/180.0))
756  {}
757 
758 
759  /**
760  * Test is event is atmospheric muon.
761  *
762  * \param __begin begin of data
763  * \param __end end of data
764  * \return negative if preferably down / positive if preferably up
765  */
766  double operator()(JEvt::const_iterator __begin,
767  JEvt::const_iterator __end) const
768  {
769  double Qup = 0.0;
770  double Qdown = 0.0;
771 
772  for (JEvt::const_iterator i = __begin; i != __end; ++i) {
773 
774  if (i->getDZ() >= dot1) {
775 
776  if (i->getQ() > Qup) {
777  Qup = i->getQ();
778  }
779 
780  } else if (i->getDZ() <= dot2) {
781 
782  if (i->getQ() > Qdown) {
783  Qdown = i->getQ();
784  }
785  }
786  }
787 
788  return Qup - Qdown;
789  }
790 
791 
792  /**
793  * Read atmospheric muon analyser from input.
794  *
795  * \param in input stream
796  * \param object atmospheric muon analyser
797  * \return input stream
798  */
799  friend inline std::istream& operator>>(std::istream& in, JAtmosphericMuon& object)
800  {
801  double theta1, theta2;
802 
803  in >> theta1 >> theta2;
804 
805  object.dot1 = cos(theta1 * JMATH::PI/180.0);
806  object.dot2 = cos(theta2 * JMATH::PI/180.0);
807 
808  return in;
809  }
810 
811 
812  /**
813  * Write atmospheric muon analyser to output.
814  *
815  * \param out output stream
816  * \param object atmospheric muon analyser
817  * \return output stream
818  */
819  friend inline std::ostream& operator<<(std::ostream& out, const JAtmosphericMuon& object)
820  {
821  out << acos(object.dot1) * 180.0 / JMATH::PI << ' '
822  << acos(object.dot2) * 180.0 / JMATH::PI;
823 
824  return out;
825  }
826 
827 
828  double dot1;
829  double dot2;
830  };
831 }
832 
833 #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.
double getAngle(const JQuaternion3D &first, const JQuaternion3D &second)
Get space angle between quanternions.
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
double getAngle(const JFirst_t &first, const JSecond_t &second)
Get space angle between objects.
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 $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
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:676
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:712
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: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
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.
JDirection3D getDirection(const JFit &fit)
Get direction.
JPointing(const JFit &fit)
Constructor.
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
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
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
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
then fatal The output file must have the wildcard in the e g root fi 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:48
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.
then set_variable DETECTOR set_variable OUTPUT_FILE set_variable DAQ_FILE set_variable PMT_FILE else fatal Wrong number of arguments fi JPrintTree f $DAQ_FILE type
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:106
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.
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