1 #ifndef __JAANET__JAANETTOOLKIT__
2 #define __JAANET__JAANETTOOLKIT__
43 namespace JPP {
using namespace JAANET; }
150 time_range.include(
getTime(*hit));
171 if (!time_range.is_valid()) {
175 if (time_range.getLength() < T_ns.getLength()) {
176 time_range.setLength(T_ns.getLength());
299 inline double getW(
const Trk& track,
const size_t index,
const double value)
301 if (index < track.
fitinf.size())
302 return track.
fitinf[index];
412 ((
int)(track.
type / 1000)) % 10 == 0); }
421 ((
int)(track.
type / 1000)) % 10 != 0); }
485 return i != evt.
mc_trks.cend();
506 if (i != evt.
mc_trks.cend()) {
return *
i; }
565 }
else if (!event.
mc_trks.empty()) {
569 if (i != event.
mc_trks.end()) {
575 }
else if (!event.
trks.empty()) {
577 const Trk& track = get_best_reconstructed_track<JPP_RECONSTRUCTION_TYPE>(event);
894 double E0 = neutrino.E;
950 evt.
mc_trks[track->mother_id] : neutrino );
952 const double distance = (track->pos - mother.
pos).len();
954 E1 +=
gWater(track->E, -distance);
977 return neutrino.
E * neutrino.
dir;
1001 double kineticEnergy = 0.0;
1006 evt.
mc_trks[track->mother_id] : neutrino );
1008 const double distance = (track->pos - mother.
pos).len();
1018 P1 += kineticEnergy * track->dir;
1033 using namespace std;
1034 using namespace JPP;
bool from_tau(const Hit &hit)
Test whether given hit was produced by a tau.
Vec getP1(const Evt &evt)
Get momentum vector of the final state of a neutrino interaction.
JVertex3D getVertex(const Trk &track)
Get vertex.
bool is_electron(const Trk &track)
Test whether given track is a (anti-)electron.
int count_electrons(const Evt &evt)
Count the number of electrons in a given event.
JInteractionType_t
Enumeration of interaction types based on GENIE codes.
double getInvariantMass(const Evt &event)
Get final state invariant mass.
JHitType_t
Enumeration of hit types based on km3 codes.
Scattered light from primary shower.
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
bool is_proton(const Trk &track)
Test whether given track is a (anti-)proton.
const Trk & get_muon(const Evt &evt)
Get first muon from the event tracklist.
Data structure for direction in three dimensions.
int charge
charge of particle [|e|/3]
bool has_leptonic_taudecay(const Evt &event)
Test whether given event contains a leptonic tau-decay.
int count_taudecay_prongs(const Evt &event)
Count the number of tau-lepton decay prongs in a given event.
JTrack3E getTrack(const Trk &track)
Get track.
Direct light from delta-rays.
double t
track time [ns] (when the particle is at pos )
Scattered light from muon.
JTransformation3D getTransformation(const Trk &track)
Get transformation.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
double getE0(const Evt &evt)
Get initial state energy of a neutrino interaction.
static const int TRK_MOTHER_NONE
mother id of a particle if it has no parent
void add_time_offset(Evt &evt, const double tOff)
Add time offset to mc event; according to current definition, the absolute time of the event is defin...
double getKineticEnergy(const double E, const double m)
Get kinetic energy of particle with given energy and mass.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
bool has_electron(const Evt &evt)
Test whether given event has an electron.
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [ns]).
int count_muons(const Evt &evt)
Count the number of muons in a given event.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
double getE1(const Evt &evt)
Get final state energy of a neutrino interaction.
static const double MASS_MUON
muon mass [GeV]
bool has_particleID(const Trk &track, const int type)
Test whether given track corresponds to given particle type.
bool is_charged_lepton(const Trk &track)
Test whether given track is a charged lepton.
Scattered light from Bremsstrahlung.
const Trk & get_primary(const Evt &evt)
Get primary.
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
const JParticle & getPDG(const int pdg) const
Get particle corresponding to given PDG code.
Direct light from Bremsstrahlung.
double getTime(const Hit &hit)
Get true time of hit.
bool is_baryon(const Trk &track)
Test whether given track is a baryon (is hadron and third digit of PDG code is not zero) ...
double E
Energy [GeV] (either MC truth or reconstructed)
Direct light from primary shower.
bool has_muonic_taudecay(const Evt &event)
Test whether given event contains a tau-lepton decay into a muon.
static const int AASHOWER_RECONSTRUCTION_TYPE
AAnet shower fit reconstruction type.
static const JPDB & getInstance()
Get particle data book.
bool is_noise(const Hit &hit)
Verify hit origin.
JTimeRange getTimeRange(const Evt &event)
Get time range (i.e. time between earliest and latest hit) of Monte Carlo event.
static const double MASS_NEUTRON
neutron mass [GeV]
bool is_neutrino(const Trk &track)
Test whether given track is a neutrino.
bool is_lepton(const Trk &track)
Test whether given track is a lepton.
bool is_finalstate(const Trk &track)
Test whether given track corresponds to a final state particle.
int mother_id
MC id of the parent particle.
double getW(const Trk &track, const size_t index, const double value)
Get track information.
double a
hit amplitude (in p.e.)
The Vec class is a straightforward 3-d vector, which also works in pyroot.
JDirection3D getDirection(const Vec &dir)
Get direction.
const Trk & get_electron(const Evt &evt)
Get first electron from the event tracklist.
double getDY() const
Get y direction.
double getDX() const
Get x direction.
JAxis3D getAxis(const Trk &track)
Get axis.
JPosition3D getPosition(const Vec &pos)
Get position.
std::vector< double > fitinf
place to store additional fit info, see km3net-dataformat/definitions/fitparameters.csv
bool has_hadronic_taudecay(const Evt &event)
Test whether given event contains a hadronic tau-decay.
static const int TRK_ST_PRIMARYNEUTRINO
initial state neutrino ('neutrino' tag in evt files from gseagen and genhen).
static const int TRK_ST_MUONBUNDLE
initial state muon bundle (mupage)
static const int TRK_ST_ININUCLEI
Initial state nuclei (gseagen)
static const int TRK_ST_PRIMARYCOSMIC
initial state cosmic ray ('track_primary' tag in evt files from corant).
double getY() const
Get y position.
double getKineticEnergy(const Trk &trk)
Get track kinetic energy.
bool is_initialstate(const Trk &track)
Test whether given track corresponds to an initial state particle.
bool is_photon(const Trk &track)
Test whether given track is a photon or neutral pion.
bool from_hadron(const Hit &hit)
Test whether given hit was produced by a hadronic shower.
static const int TRK_MOTHER_UNDEFINED
KM3NeT Data Definitions v3.4.0-8-ge14cb17 https://git.km3net.de/common/km3net-dataformat.
int type
MC: particle type in PDG encoding.
int status
MC status code, see km3net-dataformat/definitions/trkmembers.csv for values.
then for APP in event gandalf start energy
static const int TRK_ST_FINALSTATE
for MC: the particle must be processed by detector simulation ('track_in' tag in evt files)...
bool is_pion(const Trk &track)
Test whether given track is a charged pion.
Vec pos
postion [m] of the track at time t
double mass
mass of particle [GeV]
int count_taus(const Evt &evt)
Count the number of taus in a given event.
const Trk & get_tau(const Evt &evt)
Get first tau from the event tracklist.
std::vector< Trk > trks
list of reconstructed tracks (can be several because of prefits,showers, etc).
bool has_muon(const Evt &evt)
Test whether given event has a muon.
std::vector< Hit > mc_hits
MC: list of MC truth hits.
double t
hit time (from tdc+calibration or MC truth)
Scattered light from delta-rays.
static const double MASS_PROTON
proton mass [GeV]
Definition of particle types.
double getX() const
Get x position.
bool has_tau(const Evt &evt)
Test whether given event has a tau.
int id
offline event identifier
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
double getNPE(const Hit &hit)
Get true charge of hit.
Data structure for position in three dimensions.
static int ROOT_IO_VERSION
Streamer version as obtained from ROOT file.
bool is_neutron(const Trk &track)
Test whether given track is a (anti-)neutron.
Exception for accessing a value in a collection that is outside of its range.
Exception for accessing an index in a collection that is outside of its range.
Vec getP0(const Evt &evt)
Get momentum vector of the initial state of a neutrino interaction.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
bool is_hadron(const Trk &track)
Test whether given track is a hadron.
bool is_tau(const Trk &track)
Test whether given track is a (anti-)tau.
bool from_electron(const Hit &hit)
Test whether given hit was produced by an electron.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
int type
particle type or parametrisation used for hit (mc only)
double getZ() const
Get z position.
double getDZ() const
Get z direction.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
bool is_meson(const Trk &track)
Test whether given track is a meson (is hadron and third digit of PDG code is zero) ...
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [s]).
int count_hadrons(const Evt &evt)
Count the number of hadrons in a given event (not including neutral pions)
bool from_muon(const Hit &hit)
Test whether given hit was produced by a muon.