1 #ifndef __JFIT__JEVTTOOLKIT__
2 #define __JFIT__JEVTTOOLKIT__
44 namespace JRECONSTRUCTION {}
45 namespace JPP {
using namespace JRECONSTRUCTION; }
47 namespace JRECONSTRUCTION {
130 const double energy = 0.0,
131 const int status = 0)
159 const double energy = 0.0,
160 const int status = 0)
206 inline double getQuality(
const double chi2,
const int N,
const int NDF)
208 return N - 0.25 * chi2 / NDF;
222 return NDF - 0.25 * chi2 / NDF;
249 return first.
getQ() > second.
getQ();
266 typedef function_adaptor_type::pF
pF;
436 template<
class JTrackSelector_t>
439 return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
477 template<
class JTrackSelector_t,
class JQualitySorter_t>
479 JTrackSelector_t selector,
480 JQualitySorter_t comparator)
482 JEvt::const_iterator p = std::find_if(evt.begin(), evt.begin(), selector);
484 for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
485 if (selector(*i) && comparator(*i, *p)) {
540 template<
class JHitL0_t>
541 inline bool operator ()(
const JHitL0_t&
first,
const JHitL0_t& second)
const
543 if (first.getPMTID() == second.getPMTID())
544 return first.getT() < second.getT();
546 return first.getPMTID() < second.getPMTID();
570 template<
class JHitL1_t>
571 inline bool operator ()(
const JHitL1_t&
first,
const JHitL1_t& second)
const
573 if (first.getModuleID() == second.getModuleID())
574 return first.getT() < second.getT();
576 return first.getModuleID() < second.getModuleID();
637 const double dot =
getDot(fit);
641 else if (dot <= -1.0)
671 return std::max_element(__begin, __end, *
this);
717 return std::min_element(__begin, __end, *
this);
759 return std::min_element(__begin, __end, *
this);
790 const double theta2) :
791 dot1(cos(theta1 * JTOOLS::
PI/180.0)),
792 dot2(cos(theta2 * JTOOLS::
PI/180.0))
804 JEvt::const_iterator __end)
const
809 for (JEvt::const_iterator i = __begin; i != __end; ++i) {
811 if (i->getDZ() >= dot1) {
813 if (i->getQ() > Qup) {
817 }
else if (i->getDZ() <= dot2) {
819 if (i->getQ() > Qdown) {
838 double theta1, theta2;
840 in >> theta1 >> theta2;
858 out << acos(
object.dot1) * 180.0 /
JTOOLS::PI <<
' '
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.
bool has_reconstructed_shower(const JEvt &evt)
Test whether given event has a track with shower reconstruction.
JHitL1Comparator()
Default constructor.
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
JVersor3D getDirection() const
Get direction.
Auxiliary class to compare fit results with respect to a reference position (e.g. ...
Data structure for L1 hit.
Data structure for direction in three dimensions.
Auxiliary class to compare fit results with respect to a reference direction (e.g.
bool has_muon_start(const JFit &fit)
Test whether given fit has muon start in history.
Auxiliary class for permutations of L0 hits.
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.
JHitL0Comparator()
Default constructor.
double getDot(const JNeutrinoDirection &first, const JNeutrinoDirection &second)
Dot product.
JAtmosphericMuon(const double theta1, const double theta2)
Constructor.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
General purpose sorter of fit results.
JPosition(JVector3D pos)
Constructor.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
function_adaptor_type::pF pF
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.
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.
static const int JMUONBEGIN
begin range of reconstruction stages
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
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
Basic data structure for L0 hit.
Data structure for track fit results.
static const int JSHOWERPREFIT
double getDot(const JFit &first, const JFit &second)
Get dot product.
static const int JMUONPREFIT
double getAngle(const JFit &fit) const
Get angle between reference direction and fit result.
JQualitySorter()
Default constructor.
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
Data structure for vector in three dimensions.
friend std::istream & operator>>(std::istream &in, JAtmosphericMuon &object)
Read atmospheric muon analyser from input.
double getT() const
Get time.
double getX() const
Get X-position.
double getDY() const
Get y direction.
JPointing()
Default constructor.
double getDX() const
Get x direction.
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
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
friend std::ostream & operator<<(std::ostream &out, const JAtmosphericMuon &object)
Write atmospheric muon analyser to output.
double getY() const
Get y position.
Auxiliary class to evaluate atmospheric muon hypothesis.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Data structure for cascade in positive z-direction.
double getY() const
Get Y-position.
static const int JSHOWERCOMPLETEFIT
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 getDot(const JFit &fit) const
Get dot product between reference direction and fit result.
then for APP in event gandalf start energy
double getDZ() const
Get Z-slope.
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.
Reduced data structure for L1 hit.
double getQ() const
Get quality.
static const int JSHOWERBEGIN
begin range of reconstruction stages
Auxiliary class for permutations of L1 hits.
Data structure for set of track fit results.
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.
static const int JMUONSIMPLEX
double getZ() const
Get Z-position.
Data structure for L0 hit.
Data structure for fit of straight line paralel to z-axis.
bool operator()(const JFit &first, const JFit &second) const
Comparison of fit results.
double getX() const
Get x position.
JShowerEnergy(double E)
Constructor.
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.
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_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.
Data structure for normalised vector in three dimensions.
double operator()(JEvt::const_iterator __begin, JEvt::const_iterator __end) const
Test is event is atmospheric muon.
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.
then usage $script[input file[working directory[option]]] nWhere option can be N
double getZ() const
Get z position.
T operator()(T __begin, T __end) const
Select best fit result.
double getDZ() const
Get z direction.
double getE() const
Get energy.
double getDX() const
Get X-slope.
double getDX() const
Get x direction.
bool qualitySorter(const JRECONSTRUCTION::JFit &first, const JRECONSTRUCTION::JFit &second)
Comparison of fit results.
static const int JMUONENERGY
Basic data structure for L1 hit.
double getDZ() const
Get z direction.
then usage $script[input file[working directory[option]]] nWhere option can be E
static const int JMUONEND
end range of reconstruction stages
JAtmosphericMuon()
Default constructor.
JPosition3D getPosition(const Vec &v)
Get position.
double getDY() const
Get y direction.