1 #ifndef __JFIT__JEVTTOOLKIT__
2 #define __JFIT__JEVTTOOLKIT__
40 namespace JPP {
using namespace JFIT; }
120 const double energy = 0.0,
121 const int status = 0)
149 const double energy = 0.0,
150 const int status = 0)
197 const double w = NDF - 0.25 * chi2 / NDF;
226 return first.
getQ() > second.
getQ();
413 template<
class JTrackSelector_t>
416 return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
454 template<
class JTrackSelector_t,
class JQualitySorter_t>
456 JTrackSelector_t selector,
457 JQualitySorter_t comparator)
459 JEvt::const_iterator p = std::find_if(evt.begin(), evt.begin(), selector);
461 for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
462 if (selector(*i) && comparator(*i, *p)) {
517 template<
class JHitL1_t>
518 inline bool operator ()(
const JHitL1_t& first,
const JHitL1_t& second)
const
520 if (first.getModuleID() == second.getModuleID())
521 return first.getT() < second.getT();
523 return first.getModuleID() < second.getModuleID();
577 const double dot =
getDot(fit);
581 else if (dot <= -1.0)
611 return std::max_element(__begin, __end, *
this);
642 const double theta2) :
643 dot1(cos(theta1 * JTOOLS::
PI/180.0)),
644 dot2(cos(theta2 * JTOOLS::
PI/180.0))
656 JEvt::const_iterator __end)
const
661 for (JEvt::const_iterator i = __begin; i != __end; ++i) {
663 if (i->getDZ() >=
dot1) {
665 if (i->getQ() > Qup) {
669 }
else if (i->getDZ() <=
dot2) {
671 if (i->getQ() > Qdown) {
690 double theta1, theta2;
692 in >> theta1 >> theta2;
770 for (T hit = __begin; hit !=__end; ++hit) {
JAtmosphericMuon(const double theta1, const double theta2)
Constructor.
Data structure for angles in three dimensions.
friend std::istream & operator>>(std::istream &in, JAtmosphericMuon &object)
Read atmospheric muon analyser from input.
JHitL1Comparator()
Default constructor.
bool has_muon_prefit(const Trk &track)
Test whether given track has muon prefit in history.
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
const Trk & get_best_reconstructed_shower(const Evt &evt)
Get best reconstructed shower.
Data structure for L1 hit.
Data structure for direction in three dimensions.
bool operator()(const JHitL1_t &first, const JHitL1_t &second) const
Comparison of L1 hits by module identifier (first) and by time (second).
JTrack3E getTrack(const Trk &track)
Get track.
double getCount(TH1D *hptr, int muon_threshold)
double getDot(const JNeutrinoDirection &first, const JNeutrinoDirection &second)
Dot product.
bool has_shower_positionfit(const Trk &track)
Test whether given track has shower position fit in history.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
JVersor3D getDirection() const
Get direction.
friend std::ostream & operator<<(std::ostream &out, const JAtmosphericMuon &object)
Write atmospheric muon analyser to output.
double getZ(const JPosition3D &pos) const
Get point of emission of Cherenkov light along muon path.
Container for historical events.
bool has_reconstructed_track(const Evt &evt, JTrackSelector_t selector)
Test whether given event has a track according selection.
double operator()(JEvt::const_iterator __begin, JEvt::const_iterator __end) const
Test is event is atmospheric muon.
General purpose sorter of fit results.
double getAngle(const JFit &fit) const
Get angle between reference direction and fit result.
Auxiliary class to compare fit results with respect to a reference direction (e.g.
double getDot(const JFit &fit) const
Get dot product between reference direction and fit result.
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.
bool has_reconstructed_muon(const Evt &evt)
Test whether given event has a track with muon reconstruction.
Basic data structure for L0 hit.
Data structure for track fit results.
Auxiliary class for permutations of L1 hits.
function_adaptor_type::pF pF
Start of shower fit applications.
bool has_muon_fit(const Trk &track)
Test whether given track has default muon fit in history.
JQualitySorter()
Default constructor.
bool has_muon_start(const Trk &track)
Test whether given track has muon start fit in history.
T operator()(T __begin, T __end) const
Select best fit result.
JAtmosphericMuon()
Default constructor.
double getT() const
Get time.
double getX() const
Get X-position.
double getDY() const
Get y direction.
double getDX() const
Get x direction.
JAxis3D getAxis(const Trk &track)
Get axis.
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
bool has_muon_gandalf(const Trk &track)
Test whether given track has muon gandalf fit in history.
double getY() const
Get y position.
const Trk & get_best_reconstructed_track(const Evt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
Get best reconstructed track.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
double getY() const
Get Y-position.
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.
double getDZ() const
Get Z-slope.
JReturn_t(* pF)(JFirst_t, JSecond_t)
Type definition of method.
const Trk & get_best_reconstructed_muon(const Evt &evt)
Get best reconstructed muon.
Reduced data structure for L1 hit.
double getQ() const
Get quality.
bool has_muon_simplex(const Trk &track)
Test whether given track has muon simplex fit in history.
End of muon fit applications.
double getQuality(const double chi2, const int NDF)
Get quality of fit.
JFunctionAdaptor< bool, const JFit &, const JFit & > function_adaptor_type
Data structure for set of track fit results.
Auxiliary class to define a range between two values.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
bool has_muon_energy(const Trk &track)
Test whether given track has muon energy fit in history.
double getZ() const
Get Z-position.
Data structure for L0 hit.
JPointing(const JVersor3D &dir)
Constructor.
bool has_reconstructed_shower(const Evt &evt)
Test whether given event has a track with shower reconstruction.
Start of muon fit applications.
Data structure for fit of straight line paralel to z-axis.
bool qualitySorter(const JFIT::JFit &first, const JFIT::JFit &second)
Comparison of fit results.
double getX() const
Get x position.
End of shower fit applications.
Reduced data structure for L1 hit.
double getDY() const
Get Y-slope.
JDirection3D getDirection(const Vec &v)
Get direction.
Data structure for position in three dimensions.
bool has_shower_completefit(const Trk &track)
Test whether given track has shower complete fit in history.
int getN() const
Get count.
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
Exception for accessing an index in a collection that is outside of its range.
bool has_shower_prefit(const Trk &track)
Test whether given track has shower prefit in history.
Data structure for normalised vector in three dimensions.
const JHistory & getHistory() const
Get history.
double getDot(const JFit &first, const JFit &second)
Get dot product.
double getZ() const
Get z position.
Auxiliary class to evaluate atmospheric muon hypothesis.
double getDZ() const
Get z direction.
double getE() const
Get energy.
double getDX() const
Get X-slope.
double getDX() const
Get x direction.
Basic data structure for L1 hit.
double getDZ() const
Get z direction.
JPosition3D getPosition(const Vec &v)
Get position.
bool has_shower_fit(const Trk &track)
Test whether given track has default shower fit in history.
double getDY() const
Get y direction.
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.