1 #ifndef __JFIT__JEVTTOOLKIT__
2 #define __JFIT__JEVTTOOLKIT__
42 namespace JRECONSTRUCTION {}
43 namespace JPP {
using namespace JRECONSTRUCTION; }
48 namespace JRECONSTRUCTION {
128 const double energy = 0.0,
157 const double energy = 0.0,
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);
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;
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.
double getAngle(const JQuaternion3D &first, const JQuaternion3D &second)
Get space angle between quanternions.
Q(UTCMax_s-UTCMin_s)-livetime_s
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 direction in three dimensions.
double getAngle(const JFirst_t &first, const JSecond_t &second)
Get space angle between objects.
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.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
double getQuality(const double chi2, const int NDF)
Get quality of fit.
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.
Definition for fit results.
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
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
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
Data structure for track fit results with history and optional associated values. ...
static const int JSHOWERPREFIT
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.
JDirection3D getDirection(const JFit &fit)
Get direction.
JPointing(const JFit &fit)
Constructor.
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.
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.
double getQ() const
Get quality.
static const int JSHOWERBEGIN
begin range of reconstruction stages
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Data structure for set of track fit results.
JFit getFit(const int id, const JMODEL::JString &string)
Get fit parameters of string.
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
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
double getZ() const
Get Z-position.
then if[[!-f $DETECTOR]] then JDetector sh $DETECTOR fi cat $WORKDIR trigger_parameters txt<< EOFtrigger3DMuon.enabled=1;trigger3DMuon.numberOfHits=5;trigger3DMuon.gridAngle_deg=1;ctMin=0.0;TMaxLocal_ns=15.0;EOF set_variable TRIGGEREFFICIENCY_TRIGGERED_EVENTS_ONLY INPUT_FILES=() for((i=1;$i<=$NUMBER_OF_RUNS;++i));do JSirene.sh $DETECTOR $JPP_DATA/genhen.km3net_wpd_V2_0.evt.gz $WORKDIR/sirene_ ${i}.root JTriggerEfficiency.sh $DETECTOR $DETECTOR $WORKDIR/sirene_ ${i}.root $WORKDIR/trigger_efficiency_ ${i}.root $WORKDIR/trigger_parameters.txt $JPP_DATA/PMT_parameters.txt INPUT_FILES+=($WORKDIR/trigger_efficiency_ ${i}.root) done for ANGLE_DEG in $ANGLES_DEG[*];do set_variable SIGMA_NS 3.0 set_variable OUTLIERS 3 set_variable OUTPUT_FILE $WORKDIR/matrix\[${ANGLE_DEG}\deg\].root $JPP_DIR/examples/JReconstruction-f"$INPUT_FILES[*]"-o $OUTPUT_FILE-S ${SIGMA_NS}-A ${ANGLE_DEG}-O ${OUTLIERS}-d ${DEBUG}--!fiif[[$OPTION=="plot"]];then if((0));then for H1 in h0 h1;do JPlot1D-f"$WORKDIR/matrix["${^ANGLES_DEG}" deg].root:${H1}"-y"1 2e3"-Y-L TR-T""-\^"number of events [a.u.]"-> o chi2
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.
double getDY() const
Get Y-slope.
then set_variable DETECTOR set_variable OUTPUT_FILE set_variable DAQ_FILE set_variable PMT_FILE else fatal Wrong number of arguments fi JPrintTree f $DAQ_FILE type
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.
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.
static const int JMUONENERGY
double getDZ() const
Get z direction.
static const int JMUONEND
end range of reconstruction stages
JAtmosphericMuon()
Default constructor.
double getDY() const
Get y direction.