1#ifndef __JFIT__JEVTTOOLKIT__
2#define __JFIT__JEVTTOOLKIT__
128 const double energy = 0.0,
157 const double energy = 0.0,
230 inline double getQuality(
const double chi2,
const int N,
const int NDF)
232 return N - 0.25 * chi2 / NDF;
246 return NDF - 0.25 * chi2 / NDF;
273 return first.
getQ() > second.
getQ();
460 template<
class JTrackSelector_t>
463 return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
501 template<
class JTrackSelector_t,
class JQualitySorter_t>
503 JTrackSelector_t selector,
504 JQualitySorter_t comparator)
506 JEvt::const_iterator p = std::find_if(evt.begin(), evt.end(), selector);
508 for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
509 if (selector(*i) && comparator(*i, *p)) {
604 else if (dot <= -1.0)
634 return std::min_element(__begin, __end, *
this);
680 return std::min_element(__begin, __end, *
this);
722 return std::min_element(__begin, __end, *
this);
753 const double theta2) :
767 JEvt::const_iterator __end)
const
772 for (JEvt::const_iterator i = __begin; i != __end; ++i) {
774 if (i->getDZ() >=
dot1) {
776 if (i->getQ() > Qup) {
780 }
else if (i->getDZ() <=
dot2) {
782 if (i->getQ() > Qdown) {
801 double theta1, theta2;
803 in >> theta1 >> theta2;
805 object.dot1 = cos(theta1 *
JMATH::PI/180.0);
806 object.dot2 = cos(theta2 *
JMATH::PI/180.0);
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition for fit results.
Auxiliary class to define a range between two values.
Data structure for set of track fit results.
Data structure for track fit results with history and optional associated values.
double getDZ() const
Get Z-slope.
double getDY() const
Get Y-slope.
double getZ() const
Get Z-position.
double getE() const
Get energy.
double getDX() const
Get X-slope.
double getY() const
Get Y-position.
double getQ() const
Get quality.
double getT() const
Get time.
double getX() const
Get X-position.
Data structure for fit of straight line paralel to z-axis.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
double getZ(const JPosition3D &pos) const
Get point of emission of Cherenkov light along muon path.
Data structure for cascade in positive z-direction.
Data structure for angles in three dimensions.
double getDY() const
Get y direction.
double getDZ() const
Get z direction.
double getDX() const
Get x direction.
Data structure for direction in three dimensions.
Data structure for position in three dimensions.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Data structure for vector in three dimensions.
double getY() const
Get y position.
double getDistance(const JVector3D &pos) const
Get distance to point.
double getZ() const
Get z position.
double getX() const
Get x position.
Data structure for normalised vector in three dimensions.
double getDY() const
Get y direction.
double getDX() const
Get x direction.
double getDZ() const
Get z direction.
Exception for accessing an index in a collection that is outside of its range.
Auxiliary class to evaluate atmospheric muon hypothesis.
friend std::ostream & operator<<(std::ostream &out, const JAtmosphericMuon &object)
Write atmospheric muon analyser to output.
JAtmosphericMuon(const double theta1, const double theta2)
Constructor.
JAtmosphericMuon()
Default constructor.
friend std::istream & operator>>(std::istream &in, JAtmosphericMuon &object)
Read atmospheric muon analyser from input.
double operator()(JEvt::const_iterator __begin, JEvt::const_iterator __end) const
Test is event is atmospheric muon.
Auxiliary class to compare fit results with respect to a reference direction (e.g....
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
JPointing(const JFit &fit)
Constructor.
JPointing()
Default constructor.
T operator()(T __begin, T __end) const
Select best fit result.
JVersor3D getDirection() const
Get direction.
JPointing(const JVersor3D &dir)
Constructor.
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 position (e.g. true muon).
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
JPosition(JVector3D pos)
Constructor.
T operator()(T __begin, T __end) const
Select best fit result.
JShowerEnergy(double E)
Constructor.
T operator()(T __begin, T __end) const
Select best fit result.
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
static const int JMUONBEGIN
begin range of reconstruction stages
static const int JSHOWERPOSITIONFIT
static const int JSHOWEREND
end range of reconstruction stages
static const int JMUONGANDALF
static const int JMUONPREFIT
static const int JMUONENERGY
static const int JSHOWERCOMPLETEFIT
static const int JSHOWERPREFIT
static const int JMUONSIMPLEX
static const int JSHOWERBEGIN
begin range of reconstruction stages
static const int JMUONSTART
static const int JMUONEND
end range of reconstruction stages
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
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.
Auxiliary classes and methods for mathematical operations.
double getAngle(const JFirst_t &first, const JSecond_t &second)
Get space angle between objects.
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
static const double PI
Mathematical constants.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
bool has_shower_fit(const JFit &fit)
Test whether given fit has shower fit in history.
bool has_muon_gandalf(const JFit &fit)
Test whether given fit has muon gandalf in history.
JPosition3D getPosition(const JFit &fit)
Get position.
const JFit & get_best_reconstructed_muon(const JEvt &evt)
Get best reconstructed muon.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JAxis3D getAxis(const JFit &fit)
Get axis.
double getDot(const JFit &first, const JFit &second)
Get dot product.
const JFit & get_best_reconstructed_track(const JEvt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
Get best reconstructed track.
JFit getFit(const JHistory &history, const JTrack3D &track, const double Q, const int NDF, const double energy=0.0, const int status=SINGLE_STAGE)
Get fit.
JTrack3E getTrack(const JFit &fit)
Get track.
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
double getAngle(const JFit &first, const JFit &second)
Get space angle.
bool has_shower_prefit(const JFit &fit)
Test whether given fit has shower prefit in history.
bool has_muon_energy(const JFit &fit)
Test whether given fit has muon energy in history.
bool has_muon_fit(const JFit &fit)
Test whether given fit has muon fit in history.
JDirection3D getDirection(const JFit &fit)
Get direction.
bool has_reconstructed_shower(const JEvt &evt)
Test whether given event has a track with shower reconstruction.
bool has_shower_completefit(const JFit &fit)
Test whether given fit has shower complete fit in history.
bool has_muon_prefit(const JFit &fit)
Test whether given fit has muon prefit in history.
bool has_muon_start(const JFit &fit)
Test whether given fit has muon start in history.
bool has_shower_positionfit(const JFit &fit)
Test whether given fit has shower position fit in history.
const JFit & get_best_reconstructed_shower(const JEvt &evt)
Get best reconstructed shower.
bool has_muon_simplex(const JFit &fit)
Test whether given fit has muon simplex in history.
bool has_reconstructed_track(const JEvt &evt, JTrackSelector_t selector)
Test whether given event has a track according selection.
bool has_reconstructed_muon(const JEvt &evt)
Test whether given event has a track with muon reconstruction.
JReturn_t(*) pF(Args...)
Type definition of method.
Container for historical events.
const JHistory & getHistory() const
Get history.
General purpose sorter of fit results.
JFunctionAdaptor< bool, const JFit &, const JFit & > function_adaptor_type
JQualitySorter()
Default constructor.
function_adaptor_type::pF pF