1#ifndef __JRECONSTRUCTION__JEVTTOOLKIT__
2#define __JRECONSTRUCTION__JEVTTOOLKIT__
79#define MAKE_ENTRY(A) std::make_pair(#A, A)
120 return this->count(key) != 0;
132 double operator()(
const JFit& fit,
const std::string& key,
const double value)
const
134 const_iterator p = this->find(key);
136 if (p != this->end() && fit.
hasW(p->second))
137 return fit.
getW(p->second);
208 const double energy = 0.0,
237 const double energy = 0.0,
310 inline double getQuality(
const double chi2,
const int N,
const int NDF)
312 return N - 0.25 * chi2 / NDF;
326 return NDF - 0.25 * chi2 / NDF;
353 return first.
getQ() > second.
getQ();
540 template<
class JTrackSelector_t>
543 return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
581 template<
class JTrackSelector_t,
class JQualitySorter_t>
583 JTrackSelector_t selector,
584 JQualitySorter_t comparator)
586 JEvt::const_iterator p = std::find_if(evt.begin(), evt.end(), selector);
588 for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
589 if (selector(*i) && comparator(*i, *p)) {
684 else if (dot <= -1.0)
714 return std::min_element(__begin, __end, *
this);
761 return std::min_element(__begin, __end, *
this);
808 return std::min_element(__begin, __end, *
this);
839 const double theta2) :
853 JEvt::const_iterator __end)
const
858 for (JEvt::const_iterator i = __begin; i != __end; ++i) {
860 if (i->getDZ() >=
dot1) {
862 if (i->getQ() > Qup) {
866 }
else if (i->getDZ() <=
dot2) {
868 if (i->getQ() > Qdown) {
887 double theta1, theta2;
889 in >> theta1 >> theta2;
891 object.dot1 = cos(theta1 *
JMATH::PI/180.0);
892 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.
const std::vector< double > & getW() const
Get associated values.
double getT() const
Get time.
bool hasW(const int i) const
Check availability of value.
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.
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.
Auxiliary class to compare fit results with respect to a reference energy.
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
static const int JENERGY_NDF
number of degrees of freedom from JEnergy.cc
static const int JGANDALF_LAMBDA
control parameter from JGandalf.cc
static const int JENERGY_ENERGY
uncorrected energy [GeV] from JEnergy.cc
static const int AASHOWERFIT_NUMBER_OF_HITS
number of hits used
static const int JENERGY_NOISE_LIKELIHOOD
log likelihood of every hit being K40 from JEnergy.cc
static const int JENERGY_CHI2
chi2 from JEnergy.cc
static const int JSTART_NPE_MIP_TOTAL
number of photo-electrons along the whole track from JStart.cc
static const int JENERGY_MUON_RANGE_METRES
range of a muon with the reconstructed energy [m] from JEnergy.cc
static const int JCOPY_Z_M
true vertex position along track [m] from JCopy.cc
static const int JVETO_NPE
number of photo-electrons from JVeto.cc
static const int JPP_COVERAGE_POSITION
coverage of dynamic position calibration from any Jpp application
static const int JENERGY_NUMBER_OF_HITS
number of hits from JEnergy.cc
static const int JSTART_LENGTH_METRES
distance between projected positions on the track of optical modules for which the response does not ...
static const int JGANDALF_BETA0_RAD
KM3NeT Data Definitions v3.6.0 https://git.km3net.de/common/km3net-dataformat.
static const int JGANDALF_NUMBER_OF_ITERATIONS
number of iterations from JGandalf.cc
static const int JVETO_NUMBER_OF_HITS
number of hits from JVeto.cc
static const int JSHOWERFIT_ENERGY
uncorrected energy [GeV] from JShowerFit.cc
static const int JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration from any Jpp application
static const int JGANDALF_BETA1_RAD
angular resolution [rad] from JGandalf.cc
static const int JENERGY_MINIMAL_ENERGY
minimal energy [GeV] from JEnergy.cc
static const int AASHOWERFIT_ENERGY
uncorrected energy [GeV]
static const int JSTART_NPE_MIP_MISSED
number of photo-electrons missed from JStart.cc
static const int JENERGY_MAXIMAL_ENERGY
maximal energy [GeV] from JEnergy.cc
static const int JSTART_NPE_MIP
number of photo-electrons up to the barycentre from JStart.cc
static const int JGANDALF_NUMBER_OF_HITS
number of hits from JGandalf.cc
static const int JGANDALF_CHI2
chi2 from JGandalf.cc
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.
JRECONSTRUCTION::JWeight getWeight
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
Auxiliary data structure to get weight of given fit.
JWeight()
Default constructor.
bool operator()(const std::string &key) const
Has weight.
double operator()(const JFit &fit, const std::string &key, const double value) const
Get weight.