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();
290 typedef function_adaptor_type::pF
pF;
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)) {
600 const double dot =
getDot(fit, dir);
604 else if (dot <= -1.0)
634 return std::min_element(__begin, __end, *
this);
680 return std::min_element(__begin, __end, *
this);
709 return fabs(this->energy - first.
getE()) < fabs(this->energy - second.
getE());
722 return std::min_element(__begin, __end, *
this);
753 const double theta2) :
754 dot1(cos(theta1 *
JMATH::
PI/180.0)),
755 dot2(cos(theta2 *
JMATH::
PI/180.0))
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);
821 out << acos(
object.dot1) * 180.0 /
JMATH::PI <<
' '
822 << acos(
object.dot2) * 180.0 /
JMATH::PI;
#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 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.
JAtmosphericMuon(const double theta1, const double theta2)
Constructor.
friend std::istream & operator>>(std::istream &in, JAtmosphericMuon &object)
Read atmospheric muon analyser from input.
JAtmosphericMuon()
Default constructor.
friend std::ostream & operator<<(std::ostream &out, const JAtmosphericMuon &object)
Write atmospheric muon analyser to output.
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
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.
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate 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).
const JFit & get_best_reconstructed_track(const JEvt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
Get best reconstructed track.
bool has_muon_gandalf(const JFit &fit)
Test whether given fit has muon gandalf in history.
JPosition3D getPosition(const JFit &fit)
Get position.
double getAngle(const JFit &fit, const JVersor3D &dir)
Get space angle.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JAxis3D getAxis(const JFit &fit)
Get axis.
JTrack3E getTrack(const JFit &fit)
Get track.
const JFit & get_best_reconstructed_shower(const JEvt &evt)
Get best reconstructed shower.
double getQuality(const double chi2)
Get quality of fit.
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.
JFit getFit(const JHistory &history, const JLine1Z &track, const JAngle3D &angle, const double Q, const int NDF, const double energy=0.0, const int status=SINGLE_STAGE)
Get fit.
JDirection3D getDirection(const JFit &fit)
Get direction.
bool has_reconstructed_shower(const JEvt &evt)
Test whether given event has a track with shower reconstruction.
const JFit & get_best_reconstructed_muon(const JEvt &evt)
Get best reconstructed muon.
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_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.
double getDot(const JFit &fit, const JVersor3D &dir)
Get dot product.
bool has_history(const JFit &fit, const JRange< int > &range)
Test whether given fit has specified history.
Container for historical events.
const JHistory & getHistory() const
Get history.
General purpose sorter of fit results.
function_adaptor_type::pF pF
JQualitySorter()
Default constructor.
JFunctionAdaptor< bool, const JFit &, const JFit & > function_adaptor_type