1 #ifndef __JFIT__JEVTTOOLKIT__
2 #define __JFIT__JEVTTOOLKIT__
44 namespace JRECONSTRUCTION {}
45 namespace JPP {
using namespace JRECONSTRUCTION; }
50 namespace JRECONSTRUCTION {
133 const double energy = 0.0,
134 const int status = 0)
162 const double energy = 0.0,
163 const int status = 0)
209 inline double getQuality(
const double chi2,
const int N,
const int NDF)
211 return N - 0.25 * chi2 / NDF;
225 return NDF - 0.25 * chi2 / NDF;
252 return first.
getQ() > second.
getQ();
269 typedef function_adaptor_type::pF
pF;
439 template<
class JTrackSelector_t>
442 return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
480 template<
class JTrackSelector_t,
class JQualitySorter_t>
482 JTrackSelector_t selector,
483 JQualitySorter_t comparator)
485 JEvt::const_iterator p = std::find_if(evt.begin(), evt.begin(), selector);
487 for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
488 if (selector(*i) && comparator(*i, *p)) {
543 template<
class JHitL0_t>
544 inline bool operator ()(
const JHitL0_t&
first,
const JHitL0_t& second)
const
546 if (first.getPMTID() == second.getPMTID())
547 return first.getT() < second.getT();
549 return first.getPMTID() < second.getPMTID();
573 template<
class JHitL1_t>
574 inline bool operator ()(
const JHitL1_t&
first,
const JHitL1_t& second)
const
576 if (first.getModuleID() == second.getModuleID())
577 return first.getT() < second.getT();
579 return first.getModuleID() < second.getModuleID();
640 const double dot =
getDot(fit);
644 else if (dot <= -1.0)
674 return std::max_element(__begin, __end, *
this);
720 return std::min_element(__begin, __end, *
this);
762 return std::min_element(__begin, __end, *
this);
793 const double theta2) :
794 dot1(cos(theta1 * JMATH::
PI/180.0)),
795 dot2(cos(theta2 * JMATH::
PI/180.0))
807 JEvt::const_iterator __end)
const
812 for (JEvt::const_iterator i = __begin; i != __end; ++i) {
814 if (i->getDZ() >= dot1) {
816 if (i->getQ() > Qup) {
820 }
else if (i->getDZ() <= dot2) {
822 if (i->getQ() > Qdown) {
841 double theta1, theta2;
843 in >> theta1 >> theta2;
845 object.dot1 = cos(theta1 *
JMATH::PI/180.0);
846 object.dot2 = cos(theta2 *
JMATH::PI/180.0);
861 out << acos(
object.dot1) * 180.0 /
JMATH::PI <<
' '
862 << acos(
object.dot2) * 180.0 /
JMATH::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.
Q(UTCMax_s-UTCMin_s)-livetime_s
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. true muon)...
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. true muon).
bool has_muon_start(const JFit &fit)
Test whether given fit has muon start in history.
double getQuality(const double chi2, const int NDF)
Get quality of fit.
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.
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
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.
JDirection3D getDirection(const Vec &dir)
Get direction.
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
JPosition3D getPosition(const Vec &pos)
Get position.
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
static const double PI
Mathematical constants.
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
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
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.
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.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
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.
double getDY() const
Get y direction.