Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Enumerations | Functions | Variables
JAANET Namespace Reference

Extensions to Evt data format. More...

Classes

struct  JAtmosphericNeutrinoFlux
 Implementation of atmospheric neutrino flux using official KM3NeT atmospheric flux function. More...
 
struct  JDiffuseFlux
 Low-level interface for diffuse fluxes. More...
 
struct  JEvtEvaluator
 Auxiliary class to determine value of Evt objects. More...
 
struct  JEvtWeight
 Abstract base class for event weighing. More...
 
struct  JEvtWeightCorsika
 Implementation of event weighting for Corsika data. More...
 
struct  JEvtWeightDAQ
 Implementation of event weighing for DAQ data. More...
 
struct  JEvtWeightFactor
 Low-level interface for retrieving a specifiable multiplication factor
corresponding to a given event. More...
 
struct  JEvtWeightFactorFunction
 Implementation of event-weight factor interface. More...
 
struct  JEvtWeightFactorFunction< JDiffuseFluxFunction_t, JDiffuseFlux >
 Implementation of event-weight factor interface for diffuse flux objects. More...
 
struct  JEvtWeightFactorFunction< pEvtWeightFactor, JEvtWeightFactor_t >
 Implementation of C-style event-weight factor. More...
 
struct  JEvtWeightFactorFunction< pDiffuseFlux, JDiffuseFlux >
 Implementation of C-style diffuse flux event-weight factor. More...
 
struct  JEvtWeightFactorGSeaGen
 Implementation of reweighting factor for simulated neutrino interactions according to a specifiable ROOT TFormula. More...
 
struct  JEvtWeightFactorHelper
 Helper class for event-weight factor. More...
 
struct  JEvtWeightFactorHelper< JDiffuseFlux >
 Explicit emplate specialization of event-weight factor helper for diffuse flux objects. More...
 
struct  JEvtWeightFactorMultiParticle
 Implementation of event-weight factor for multiple particle types. More...
 
struct  JEvtWeightFactorMupage
 Implementation of reweighting factor for mupage events according to a specifiable ROOT TFormula. More...
 
struct  JEvtWeightGenhen
 Implementation of event weighting for Genhen data. More...
 
struct  JEvtWeightGSeaGen
 Implementation of event weighting for GSeaGen data. More...
 
struct  JEvtWeightHelper
 Helper class for event weighing. More...
 
struct  JEvtWeightInterface
 Low-level interface for event weighing. More...
 
struct  JEvtWeightKM3BUU
 Implementation of event weighting for KM3BUU data. More...
 
struct  JEvtWeightMiscellaneous
 Implementation of event weighing for miscellaneous data
such as a merged offline file containing neutrinos and atmospheric muons. More...
 
struct  JEvtWeightMupage
 Implementation of event weighing for MUPAGE data. More...
 
struct  JEvtWeightNormalisation
 Auxiliary data structure for storing pairs of header UUIDs and event-weight normalisations. More...
 
struct  JEvtWeighter
 Look-up table for event weighters. More...
 
struct  JNeutrinoTypeCollection
 Auxiliary class for parsing a vector of neutrino PDG identifiers. More...
 
struct  JFluxMap
 Auxiliary class for parsing multiparticle fluxes. More...
 
struct  JFlatFlux
 Function object for constant fluxes. More...
 
struct  JFlux
 Low-level interface for retrieving the flux corresponding to a given event. More...
 
struct  JRange_t
 Type definition of range. More...
 
struct  start_run
 Start of run record. More...
 
struct  String
 General purpose string class. More...
 
struct  detector
 Detector file. More...
 
struct  muon_desc_file
 Muon descriptor file. More...
 
struct  target
 Target. More...
 
struct  XSecFile
 Neutrino cross section file. More...
 
struct  drawing
 Drawing. More...
 
struct  calibration
 Calibration. More...
 
struct  cut
 General purpose class of phase space generation. More...
 
struct  cut_primary
 Phase space of primary particle. More...
 
struct  cut_seamuon
 Phase space of atmospheric muon generation. More...
 
struct  cut_in
 Phase space of incoming particle. More...
 
struct  cut_nu
 Phase space of incident neutrino. More...
 
struct  generator
 Description of Monte Carlo event generation applications. More...
 
struct  physics
 Physics information. More...
 
struct  simul
 Generator for simulation. More...
 
struct  spectrum
 Neutrino energy spectrum. More...
 
struct  can
 The cylinder used for photon tracking. More...
 
struct  fixedcan
 The fixed cylinder used for photon tracking. More...
 
struct  genvol
 Neutrino vertex volume. More...
 
struct  coord_origin
 Coordinate origin. More...
 
struct  genhencut
 Phase space for incident neutrino. More...
 
struct  norma
 Normlisation of CORSIKA events. More...
 
struct  livetime
 Normalisation of MUPAGE events. More...
 
struct  flux
 Neutrino flux. More...
 
struct  seabottom
 The bottom of the sea. More...
 
struct  depth
 Depth. More...
 
struct  DAQ
 Livetime of DAQ data. More...
 
struct  K40
 Livetime of noise data. More...
 
struct  tgen
 Time duration of event generation. More...
 
struct  time_interval
 UTC time interval for event generation. More...
 
struct  primary
 Primary particle. More...
 
struct  end_event
 End of event record. More...
 
class  JHead
 Monte Carlo run header. More...
 
struct  JHeadHelper
 Auxiliary map of application to check method. More...
 
struct  JHeadWriter
 Implementation for Head output of JHead objects with ROOT dictionary. More...
 
struct  JLorentzBoost
 Auxiliary class for performing Lorentz boosts. More...
 
struct  JMultiHead
 Auxiliary data structure to store multiple headers
and bookkeep event-weight normalisations. More...
 
struct  JOscFlux
 Implementation of oscillated neutrino flux. More...
 
struct  JParticle
 Auxiliary class to handle particle name, codes and mass. More...
 
struct  JPDB
 Collection of particles. More...
 
struct  JPowerLawFlux
 Example function object for computing power-law flux. More...
 
struct  JVolume
 Auxiliary class for histogramming of effective volume. More...
 
struct  JEventSelector
 Event selector. More...
 

Typedefs

typedef double(* pEvtWeightFactor )(const Evt &)
 Type definition of event-weight factor pointer. More...
 
using pFlux = pEvtWeightFactor
 Type definition of flux function pointer. More...
 
typedef double(* pDiffuseFlux )(int, double, double)
 Type definition of pointer to diffuse flux function. More...
 
typedef JEvtWeightFactorHelper
< JFlux
JFluxHelper
 Type definition of event-weight factor helper for flux functions. More...
 
typedef JEvtWeightFactorHelper
< JDiffuseFlux
JDiffuseFluxHelper
 Type definition of event-weight factor helper for diffuse flux objects. More...
 
typedef
JEvtWeightFactorMultiParticle
< JFlux
JFluxMultiParticle
 Type-definition of multi-particle event-weight factor for fluxes. More...
 
typedef bool(* is_head )(const JHead &)
 Type definition of test function of header. More...
 

Enumerations

enum  JInteractionType_t { UNKNOWN = 0, ELECTROMAGNETIC = 1, WEAK_CHARGED_CURRENT = 2, WEAK_NEUTRAL_CURRENT = 3 }
 Enumeration of interaction types based on GENIE codes. More...
 
enum  JHitType_t {
  HIT_TYPE_MUON_DIRECT = +5, HIT_TYPE_MUON_SCATTERED = -5, HIT_TYPE_DELTARAYS_DIRECT = +4, HIT_TYPE_DELTARAYS_SCATTERED = -4,
  HIT_TYPE_BREMSSTRAHLUNG_DIRECT = +3, HIT_TYPE_BREMSSTRAHLUNG_SCATTERED = -3, HIT_TYPE_SHOWER_DIRECT = +99, HIT_TYPE_SHOWER_SCATTERED = -99,
  HIT_TYPE_NOISE = -1, HIT_TYPE_UNKNOWN = 0
}
 Enumeration of hit types based on km3 codes. More...
 
enum  JGeant4Type_t {
  GEANT4_TYPE_PHOTON = 1, GEANT4_TYPE_ANTIELECTRON = 2, GEANT4_TYPE_ELECTRON = 3, GEANT4_TYPE_NEUTRINO = 4,
  GEANT4_TYPE_ANTIMUON = 5, GEANT4_TYPE_MUON = 6, GEANT4_TYPE_NEUTRAL_PION = 7, GEANT4_TYPE_PION_PLUS = 8,
  GEANT4_TYPE_PION_MINUS = 9, GEANT4_TYPE_KAON_LONG = 10, GEANT4_TYPE_KAON_PLUS = 11, GEANT4_TYPE_KAON_MINUS = 12,
  GEANT4_TYPE_NEUTRON = 13, GEANT4_TYPE_PROTON = 14, GEANT4_TYPE_ANTIPROTON = 15, GEANT4_TYPE_KAON_SHORT = 16,
  GEANT4_TYPE_ETA = 17, GEANT4_TYPE_LAMBDA = 18, GEANT4_TYPE_SIGMA_PLUS = 19, GEANT4_TYPE_NEUTRAL_SIGMA = 20,
  GEANT4_TYPE_SIGMA_MINUS = 21, GEANT4_TYPE_NEUTRAL_XI = 22, GEANT4_TYPE_XI_MINUS = 23, GEANT4_TYPE_OMEGA_MINUS = 24,
  GEANT4_TYPE_ANTINEUTRON = 25, GEANT4_TYPE_ANTILAMBDA = 26, GEANT4_TYPE_ANTISIGMA_MINUS = 27, GEANT4_TYPE_NEUTRAL_ANTISIGMA = 28,
  GEANT4_TYPE_ANTISIGMA_PLUS = 29, GEANT4_TYPE_NEUTRAL_ANTIXI = 30, GEANT4_TYPE_ANTIXI_PLUS = 31, GEANT4_TYPE_ANTIOMEGA_PLUS = 32,
  GEANT4_TYPE_D_PLUS = 35, GEANT4_TYPE_D_MINUS = 36, GEANT4_TYPE_D_ZERO = 37, GEANT4_TYPE_ANTID_ZERO = 38,
  GEANT4_TYPE_D_PLUS_S = 39, GEANT4_TYPE_D_MINUS_S = 40, GEANT4_TYPE_LAMBDA_PLUS_C = 41, GEANT4_TYPE_DEUTERON = 45,
  GEANT4_TYPE_TRITON = 46, GEANT4_TYPE_ALPHA = 47, GEANT4_TYPE_GEANTINO = 48, GEANT4_TYPE_HE3 = 49,
  GEANT4_TYPE_ANTITAU = 33, GEANT4_TYPE_TAU = 34, GEANT4_TYPE_XI_PLUS_C = 0, GEANT4_TYPE_XI_MINUS_C = 0,
  GEANT4_TYPE_XI_ZERO_C = 0, GEANT4_TYPE_ANTIXI_ZERO_C = 0, GEANT4_TYPE_OMEGA_PLUS_B = 0, GEANT4_TYPE_ANTIOMEGA_ZERO_C = 0,
  GEANT4_TYPE_OMEGA_MINUS_B = 0, GEANT4_TYPE_OMEGA_ZERO_C = 0, GEANT4_TYPE_B_PLUS = 0, GEANT4_TYPE_B_MINUS = 0,
  GEANT4_TYPE_XI_MINUS_B = 0, GEANT4_TYPE_XI_PLUS_B = 0, GEANT4_TYPE_B_ZERO = 0, GEANT4_TYPE_ANTIB_ZERO = 0,
  GEANT4_TYPE_B_ZERO_S = 0, GEANT4_TYPE_ANTIB_ZERO_S = 0, GEANT4_TYPE_XI_ZERO_B = 0, GEANT4_TYPE_ANTIXI_ZERO_B = 0,
  GEANT4_TYPE_LAMBDA_B = 0, GEANT4_TYPE_ANTILAMBDA_B = 0, GEANT4_TYPE_B_PLUS_C = 0, GEANT4_TYPE_B_MINUS_C = 0
}
 Enumeration of hit types based on Geant4 codes, for compatbility with KM3Sim. More...
 
enum  JTrackType_t {
  TRACK_TYPE_ELECTRON = 11, TRACK_TYPE_NUE = 12, TRACK_TYPE_MUON = 13, TRACK_TYPE_NUMU = 14,
  TRACK_TYPE_TAU = 15, TRACK_TYPE_NUTAU = 16, TRACK_TYPE_PHOTON = 22, TRACK_TYPE_NEUTRAL_PION = 111,
  TRACK_TYPE_CHARGED_PION_PLUS = 211, TRACK_TYPE_PION_PLUS = 211, TRACK_TYPE_K_LONG = 130, TRACK_TYPE_K_SHORT = 310,
  TRACK_TYPE_K_PLUS = 321, TRACK_TYPE_D_PLUS = 411, TRACK_TYPE_D_ZERO = 421, TRACK_TYPE_D_PLUS_S = 431,
  TRACK_TYPE_B_ZERO = 511, TRACK_TYPE_B_PLUS = 521, TRACK_TYPE_B_ZERO_S = 531, TRACK_TYPE_B_PLUS_C = 541,
  TRACK_TYPE_PROTON = 2212, TRACK_TYPE_NEUTRON = 2112, TRACK_TYPE_LAMBDA = 3122, TRACK_TYPE_SIGMA_PLUS = 3222,
  TRACK_TYPE_NEUTRAL_SIGMA = 3212, TRACK_TYPE_SIGMA_MINUS = 3112, TRACK_TYPE_NEUTRAL_XI = 3322, TRACK_TYPE_XI_MINUS = 3312,
  TRACK_TYPE_OMEGA_MINUS = 3334, TRACK_TYPE_LAMBDA_PLUS_C = 4122, TRACK_TYPE_XI_ZERO_C = 4132, TRACK_TYPE_XI_PLUS_C = 4232,
  TRACK_TYPE_OMEGA_ZERO_C = 4332, TRACK_TYPE_LAMBDA_B = 5122, TRACK_TYPE_XI_MINUS_B = 5132, TRACK_TYPE_XI_ZERO_B = 5232,
  TRACK_TYPE_OMEGA_MINUS_B = 5332, TRACK_TYPE_ANTIELECTRON = -11, TRACK_TYPE_ANTINUE = -12, TRACK_TYPE_ANTIMUON = -13,
  TRACK_TYPE_ANTINUMU = -14, TRACK_TYPE_ANTITAU = -15, TRACK_TYPE_ANTINUTAU = -16, TRACK_TYPE_NEUTRAL_ANTIPION = -111,
  TRACK_TYPE_CHARGED_PION_MINUS = -211, TRACK_TYPE_PION_MINUS = -211, TRACK_TYPE_ANTIK_LONG = -130, TRACK_TYPE_ANTIK_SHORT = -310,
  TRACK_TYPE_K_MINUS = -321, TRACK_TYPE_D_MINUS = -411, TRACK_TYPE_D_MINUS_S = -431, TRACK_TYPE_ANTID_ZERO = -421,
  TRACK_TYPE_ANTIB_ZERO = -511, TRACK_TYPE_B_MINUS = -521, TRACK_TYPE_ANTIB_ZERO_S = -531, TRACK_TYPE_B_MINUS_C = -541,
  TRACK_TYPE_ANTIPROTON = -2212, TRACK_TYPE_ANTINEUTRON = -2112, TRACK_TYPE_ANTILAMBDA = -3122, TRACK_TYPE_ANTISIGMA_PLUS = -3222,
  TRACK_TYPE_NEUTRAL_ANTISIGMA = -3212, TRACK_TYPE_ANTISIGMA_MINUS = -3112, TRACK_TYPE_NEUTRAL_ANTIXI = -3322, TRACK_TYPE_ANTIXI_MINUS = -3312,
  TRACK_TYPE_ANTIOMEGA_MINUS = -3334, TRACK_TYPE_ANTIXI_ZERO_C = -4132, TRACK_TYPE_XI_MINUS_C = -4232, TRACK_TYPE_ANTIOMEGA_ZERO_C = -4332,
  TRACK_TYPE_ANTILAMBDA_B = -5122, TRACK_TYPE_XI_PLUS_B = -5132, TRACK_TYPE_ANTIXI_ZERO_B = -5232, TRACK_TYPE_OMEGA_PLUS_B = -5332
}
 Enumeration of track types based on PDG codes. More...
 

Functions

double getTime (const Hit &hit)
 Get true time of hit. More...
 
double getNPE (const Hit &hit)
 Get true charge of hit. More...
 
bool is_noise (const Hit &hit)
 Verify hit origin. More...
 
JTimeRange getTimeRange (const Evt &event)
 Get time range (i.e. time between earliest and latest hit) of Monte Carlo event. More...
 
JTimeRange getTimeRange (const Evt &event, const JTimeRange &T_ns)
 Get time range (i.e. time between earliest and latest hit) of Monte Carlo event. More...
 
JPosition3D getPosition (const Vec &pos)
 Get position. More...
 
Vec getPosition (const JPosition3D &pos)
 Get position. More...
 
JPosition3D getPosition (const Trk &track)
 Get position. More...
 
JDirection3D getDirection (const Vec &dir)
 Get direction. More...
 
Vec getDirection (const JDirection3D &dir)
 Get direction. More...
 
JDirection3D getDirection (const Trk &track)
 Get direction. More...
 
JAxis3D getAxis (const Trk &track)
 Get axis. More...
 
JTrack3E getTrack (const Trk &track)
 Get track. More...
 
JTransformation3D getTransformation (const Trk &track)
 Get transformation. More...
 
double getW (const Trk &track, const size_t index, const double value)
 Get track information. More...
 
bool is_photon (const Trk &track)
 Test whether given track is a photon or neutral pion. More...
 
bool is_neutrino (const Trk &track)
 Test whether given track is a neutrino. More...
 
bool is_electron (const Trk &track)
 Test whether given track is a (anti-)electron. More...
 
bool is_muon (const Trk &track)
 Test whether given track is a (anti-)muon. More...
 
bool is_tau (const Trk &track)
 Test whether given track is a (anti-)tau. More...
 
bool is_pion (const Trk &track)
 Test whether given track is a charged pion. More...
 
bool is_proton (const Trk &track)
 Test whether given track is a (anti-)proton. More...
 
bool is_neutron (const Trk &track)
 Test whether given track is a (anti-)neutron. More...
 
bool is_lepton (const Trk &track)
 Test whether given track is a lepton. More...
 
bool is_charged_lepton (const Trk &track)
 Test whether given track is a charged lepton. More...
 
bool is_hadron (const Trk &track)
 Test whether given track is a hadron. More...
 
bool is_meson (const Trk &track)
 Test whether given track is a meson (is hadron and third digit of PDG code is zero) More...
 
bool is_baryon (const Trk &track)
 Test whether given track is a baryon (is hadron and third digit of PDG code is not zero) More...
 
bool has_particleID (const Trk &track, const int type)
 Test whether given track corresponds to given particle type. More...
 
bool is_initialstate (const Trk &track)
 Test whether given track corresponds to an initial state particle. More...
 
bool is_finalstate (const Trk &track)
 Test whether given track corresponds to a final state particle. More...
 
bool has_neutrino (const Evt &evt)
 Test whether given event has an incoming neutrino. More...
 
const Trkget_neutrino (const Evt &evt)
 Get incoming neutrino. More...
 
const Trkget_primary (const Evt &evt)
 Get primary. More...
 
JVertex3D getVertex (const Trk &track)
 Get vertex. More...
 
JVertex3D getVertex (const Evt &event)
 Get event vertex. More...
 
int count_electrons (const Evt &evt)
 Count the number of electrons in a given event. More...
 
bool has_electron (const Evt &evt)
 Test whether given event has an electron. More...
 
const Trkget_electron (const Evt &evt)
 Get first electron from the event tracklist. More...
 
bool from_electron (const Hit &hit)
 Test whether given hit was produced by an electron. More...
 
int count_muons (const Evt &evt)
 Count the number of muons in a given event. More...
 
bool has_muon (const Evt &evt)
 Test whether given event has a muon. More...
 
const Trkget_muon (const Evt &evt)
 Get first muon from the event tracklist. More...
 
bool from_muon (const Hit &hit)
 Test whether given hit was produced by a muon. More...
 
int count_taus (const Evt &evt)
 Count the number of taus in a given event. More...
 
bool has_tau (const Evt &evt)
 Test whether given event has a tau. More...
 
const Trkget_tau (const Evt &evt)
 Get first tau from the event tracklist. More...
 
bool has_muonic_taudecay (const Evt &event)
 Test whether given event contains a tau-lepton decay into a muon. More...
 
bool has_leptonic_taudecay (const Evt &event)
 Test whether given event contains a leptonic tau-decay. More...
 
bool has_hadronic_taudecay (const Evt &event)
 Test whether given event contains a hadronic tau-decay. More...
 
int count_taudecay_prongs (const Evt &event)
 Count the number of tau-lepton decay prongs in a given event. More...
 
bool from_tau (const Hit &hit)
 Test whether given hit was produced by a tau. More...
 
int count_hadrons (const Evt &evt)
 Count the number of hadrons in a given event (not including neutral pions) More...
 
bool from_hadron (const Hit &hit)
 Test whether given hit was produced by a hadronic shower. More...
 
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 defined by the track "t" attribute; this could change in the future if the global attribute mc_t is assigned to this purpose. More...
 
double getKineticEnergy (const Trk &trk)
 Get track kinetic energy. More...
 
double getE0 (const Evt &evt)
 Get initial state energy of a neutrino interaction. More...
 
double getE1 (const Evt &evt)
 Get final state energy of a neutrino interaction. More...
 
Vec getP0 (const Evt &evt)
 Get momentum vector of the initial state of a neutrino interaction. More...
 
Vec getP1 (const Evt &evt)
 Get momentum vector of the final state of a neutrino interaction. More...
 
double getInvariantMass (const Evt &event)
 Get final state invariant mass. More...
 
template<class JOscProbInterpolator_t = JOscProbInterpolator<>>
JEvtWeightFactorFunction
< JAtmosphericNeutrinoFlux,
JFlux
make_atmosphericNeutrinoFluxFunction (const std::string &oscProbTableFile, const JOscParametersInterface< double > &oscParameters)
 Auxiliary method for creating an interface to an atmospheric neutrino flux function
using an oscillation probability interpolation table. More...
 
template<class JFunction_t , class JEvtWeightFactor_t = JEvtWeightFactor>
JEvtWeightFactorFunction
< JFunction_t,
JEvtWeightFactor_t > 
make_weightFactor (const JFunction_t &function)
 Auxiliary method for creating an interface to an event-weight factor. More...
 
template<class JEvtWeightFactor_t = JEvtWeightFactor>
JEvtWeightFactorFunction
< pEvtWeightFactor,
JEvtWeightFactor_t > 
make_weightFactor (pEvtWeightFactor function)
 Auxiliary method for creating an interface to an event-weight factor. More...
 
template<class JFunction_t >
JEvtWeightFactorFunction
< JFunction_t, JFlux
make_fluxFunction (const JFunction_t &flux)
 Auxiliary method for creating an interface to a flux function. More...
 
JEvtWeightFactorFunction
< pFlux, JFlux
make_fluxFunction (pFlux flux)
 Auxiliary method for creating an interface to a flux function. More...
 
template<class JFunction_t >
JEvtWeightFactorFunction
< JFunction_t, JDiffuseFlux
make_diffuseFluxFunction (const JFunction_t &flux)
 Auxiliary method for creating an interface to a diffuse flux function. More...
 
JEvtWeightFactorFunction
< pDiffuseFlux, JDiffuseFlux
make_diffuseFluxFunction (pDiffuseFlux flux)
 Auxiliary method for creating an interface to a diffuse flux function. More...
 
double getVolume (const JType< JEvtWeightGSeaGen > &type, const Evt &evt)
 Get volume of given event according given weighter. More...
 
double getVolume (const JType< JEvtWeightKM3BUU > &type, const Evt &evt)
 Get volume of given event according given weighter. More...
 
double getVolume (const JType< JEvtWeightGenhen > &type, const Evt &evt)
 Get volume of given event according given weighter. More...
 
double getVolume (const JEvtWeight &weighter, const Evt &evt)
 Get volume of given event according given weighter. More...
 
JEvtWeightFactorFunction
< JFlatFlux, JFlux
make_flatFluxFunction (const double flux)
 Auxiliary method for creating an interface to a flat flux function. More...
 
void copy (const Head &from, JHead &to)
 Copy header from from to to. More...
 
void copy (const JHead &from, Head &to)
 Copy header from from to to. More...
 
std::string getTag (const std::string &tag)
 Get tag without aanet extension "_<counter>" for identical tags. More...
 
std::string getTag (const std::string &tag, const int counter)
 Get tag with aanet extension "_<counter>" for identical tags. More...
 
bool operator== (const Head &first, const Head &second)
 Equal operator. More...
 
bool operator< (const Head &first, const Head &second)
 Less than operator. More...
 
bool is_genhen (const JHead &header)
 Check for generator. More...
 
bool is_gseagen (const JHead &header)
 Check for generator. More...
 
bool is_mupage (const JHead &header)
 Check for generator. More...
 
bool is_corsika (const JHead &header)
 Check for generator. More...
 
bool is_km3buu (const JHead &header)
 Check for generator. More...
 
bool is_km3 (const JHead &header)
 Check for detector simulation. More...
 
bool is_km3sim (const JHead &header)
 Check for detector simulation. More...
 
bool is_sirene (const JHead &header)
 Check for detector simulation. More...
 
bool is_pure_noise (const JHead &header)
 Check for generator. More...
 
bool is_daq (const JHead &header)
 Check for real data. More...
 
Vec getOffset (const JHead &header)
 Get offset. More...
 
Vec getOrigin (const JHead &header)
 Get origin. More...
 
JCylinder3D getCylinder (const JHead &header)
 Get cylinder corresponding to the positions of generated tracks (i.e. More...
 
JLorentzBoost getBoostToCOM (const Evt &event)
 Get Lorentz boost to the Center of Mass (COM) frame for a given neutrino interaction. More...
 
void boostToCOM (Evt &event)
 Boost event to the Center of Mass (COM) frame. More...
 
JEvtWeightFactorFunction
< JPowerLawFlux, JFlux
make_powerLawFluxFunction (const double normalisation, const double spectralIndex)
 Auxiliary method for creating an interface to a power-law flux function. More...
 
bool select (const Trk &trk, const Evt &evt)
 Event selection. More...
 
bool hasW (const Trk &trk, const int i)
 Check availability of value. More...
 
double getW (const Trk &trk, const int i)
 Get associated value. More...
 
double getW (const Trk &trk, const int i, const double value)
 Get associated value. More...
 
void setW (Trk &trk, const int i, const double value)
 Set associated value. More...
 

Variables

static const int AASHOWER_RECONSTRUCTION_TYPE = 101
 AAnet shower fit reconstruction type. More...
 
static const JEvtEvaluator getEvtValue
 Function object for evaluation of DAQ objects. More...
 
JEvtWeighter getEventWeighter
 Function object for mapping header to event weighter. More...
 
static const char AANET_TAG_SEPARATOR = '_'
 Separator for tag extension of multiple tags in Head ("_<counter>"). More...
 
static JHeadHelper get_is_head
 Function object to get check method for given application. More...
 

Detailed Description

Extensions to Evt data format.

Author
bjung
mlincetto
mdejong, bjjung
mdejong
bjjung
bjung, mdejong

Typedef Documentation

typedef double(* JAANET::pEvtWeightFactor)(const Evt &)

Type definition of event-weight factor pointer.

Definition at line 108 of file JEvtWeightFactorFunction.hh.

Type definition of flux function pointer.

Definition at line 112 of file JEvtWeightFactorFunction.hh.

typedef double(* JAANET::pDiffuseFlux)(int, double, double)

Type definition of pointer to diffuse flux function.

Definition at line 153 of file JEvtWeightFactorFunction.hh.

Type definition of event-weight factor helper for flux functions.

Definition at line 204 of file JEvtWeightFactorHelper.hh.

Type definition of event-weight factor helper for diffuse flux objects.

Definition at line 207 of file JEvtWeightFactorHelper.hh.

Type-definition of multi-particle event-weight factor for fluxes.

Definition at line 169 of file JEvtWeightFactorMultiParticle.hh.

typedef bool(* JAANET::is_head)(const JHead &)

Type definition of test function of header.

Definition at line 28 of file JHeadToolkit.hh.

Enumeration Type Documentation

Enumeration of interaction types based on GENIE codes.

Enumerator
UNKNOWN 
ELECTROMAGNETIC 
WEAK_CHARGED_CURRENT 
WEAK_NEUTRAL_CURRENT 

Definition at line 76 of file JAAnetToolkit.hh.

Enumeration of hit types based on km3 codes.

Enumerator
HIT_TYPE_MUON_DIRECT 

Direct light from muon.

HIT_TYPE_MUON_SCATTERED 

Scattered light from muon.

HIT_TYPE_DELTARAYS_DIRECT 

Direct light from delta-rays.

HIT_TYPE_DELTARAYS_SCATTERED 

Scattered light from delta-rays.

HIT_TYPE_BREMSSTRAHLUNG_DIRECT 

Direct light from Bremsstrahlung.

HIT_TYPE_BREMSSTRAHLUNG_SCATTERED 

Scattered light from Bremsstrahlung.

HIT_TYPE_SHOWER_DIRECT 

Direct light from primary shower.

HIT_TYPE_SHOWER_SCATTERED 

Scattered light from primary shower.

HIT_TYPE_NOISE 

Random noise.

HIT_TYPE_UNKNOWN 

Unknown source.

Definition at line 87 of file JAAnetToolkit.hh.

87  {
88  HIT_TYPE_MUON_DIRECT = +5, //!< Direct light from muon
89  HIT_TYPE_MUON_SCATTERED = -5, //!< Scattered light from muon
90  HIT_TYPE_DELTARAYS_DIRECT = +4, //!< Direct light from delta-rays
91  HIT_TYPE_DELTARAYS_SCATTERED = -4, //!< Scattered light from delta-rays
92  HIT_TYPE_BREMSSTRAHLUNG_DIRECT = +3, //!< Direct light from Bremsstrahlung
93  HIT_TYPE_BREMSSTRAHLUNG_SCATTERED = -3, //!< Scattered light from Bremsstrahlung
94  HIT_TYPE_SHOWER_DIRECT = +99, //!< Direct light from primary shower
95  HIT_TYPE_SHOWER_SCATTERED = -99, //!< Scattered light from primary shower
96  HIT_TYPE_NOISE = -1, //!< Random noise
97  HIT_TYPE_UNKNOWN = 0 //!< Unknown source
98  };
Scattered light from primary shower.
Direct light from delta-rays.
Scattered light from muon.
Scattered light from Bremsstrahlung.
Direct light from Bremsstrahlung.
Direct light from primary shower.
Direct light from muon.
Scattered light from delta-rays.

Enumeration of hit types based on Geant4 codes, for compatbility with KM3Sim.

Enumerator
GEANT4_TYPE_PHOTON 
GEANT4_TYPE_ANTIELECTRON 
GEANT4_TYPE_ELECTRON 
GEANT4_TYPE_NEUTRINO 
GEANT4_TYPE_ANTIMUON 
GEANT4_TYPE_MUON 
GEANT4_TYPE_NEUTRAL_PION 
GEANT4_TYPE_PION_PLUS 
GEANT4_TYPE_PION_MINUS 
GEANT4_TYPE_KAON_LONG 
GEANT4_TYPE_KAON_PLUS 
GEANT4_TYPE_KAON_MINUS 
GEANT4_TYPE_NEUTRON 
GEANT4_TYPE_PROTON 
GEANT4_TYPE_ANTIPROTON 
GEANT4_TYPE_KAON_SHORT 
GEANT4_TYPE_ETA 
GEANT4_TYPE_LAMBDA 
GEANT4_TYPE_SIGMA_PLUS 
GEANT4_TYPE_NEUTRAL_SIGMA 
GEANT4_TYPE_SIGMA_MINUS 
GEANT4_TYPE_NEUTRAL_XI 
GEANT4_TYPE_XI_MINUS 
GEANT4_TYPE_OMEGA_MINUS 
GEANT4_TYPE_ANTINEUTRON 
GEANT4_TYPE_ANTILAMBDA 
GEANT4_TYPE_ANTISIGMA_MINUS 
GEANT4_TYPE_NEUTRAL_ANTISIGMA 
GEANT4_TYPE_ANTISIGMA_PLUS 
GEANT4_TYPE_NEUTRAL_ANTIXI 
GEANT4_TYPE_ANTIXI_PLUS 
GEANT4_TYPE_ANTIOMEGA_PLUS 
GEANT4_TYPE_D_PLUS 
GEANT4_TYPE_D_MINUS 
GEANT4_TYPE_D_ZERO 
GEANT4_TYPE_ANTID_ZERO 
GEANT4_TYPE_D_PLUS_S 
GEANT4_TYPE_D_MINUS_S 
GEANT4_TYPE_LAMBDA_PLUS_C 
GEANT4_TYPE_DEUTERON 
GEANT4_TYPE_TRITON 
GEANT4_TYPE_ALPHA 
GEANT4_TYPE_GEANTINO 
GEANT4_TYPE_HE3 
GEANT4_TYPE_ANTITAU 
GEANT4_TYPE_TAU 
GEANT4_TYPE_XI_PLUS_C 
GEANT4_TYPE_XI_MINUS_C 
GEANT4_TYPE_XI_ZERO_C 
GEANT4_TYPE_ANTIXI_ZERO_C 
GEANT4_TYPE_OMEGA_PLUS_B 
GEANT4_TYPE_ANTIOMEGA_ZERO_C 
GEANT4_TYPE_OMEGA_MINUS_B 
GEANT4_TYPE_OMEGA_ZERO_C 
GEANT4_TYPE_B_PLUS 
GEANT4_TYPE_B_MINUS 
GEANT4_TYPE_XI_MINUS_B 
GEANT4_TYPE_XI_PLUS_B 
GEANT4_TYPE_B_ZERO 
GEANT4_TYPE_ANTIB_ZERO 
GEANT4_TYPE_B_ZERO_S 
GEANT4_TYPE_ANTIB_ZERO_S 
GEANT4_TYPE_XI_ZERO_B 
GEANT4_TYPE_ANTIXI_ZERO_B 
GEANT4_TYPE_LAMBDA_B 
GEANT4_TYPE_ANTILAMBDA_B 
GEANT4_TYPE_B_PLUS_C 
GEANT4_TYPE_B_MINUS_C 

Definition at line 18 of file JParticleTypes.hh.

18  { GEANT4_TYPE_PHOTON = 1,
23  GEANT4_TYPE_MUON = 6,
31  GEANT4_TYPE_PROTON = 14,
34  GEANT4_TYPE_ETA = 17,
35  GEANT4_TYPE_LAMBDA = 18,
50  GEANT4_TYPE_D_PLUS = 35,
52  GEANT4_TYPE_D_ZERO = 37,
58  GEANT4_TYPE_TRITON = 46,
59  GEANT4_TYPE_ALPHA = 47,
61  GEANT4_TYPE_HE3 = 49,
62  //
63  // %KM3NeT specific codes
64  //
66  GEANT4_TYPE_TAU = 34,
67  //
68  // %Particles with PDG code but not GEANT
69  //

Enumeration of track types based on PDG codes.

Enumerator
TRACK_TYPE_ELECTRON 
TRACK_TYPE_NUE 
TRACK_TYPE_MUON 
TRACK_TYPE_NUMU 
TRACK_TYPE_TAU 
TRACK_TYPE_NUTAU 
TRACK_TYPE_PHOTON 
TRACK_TYPE_NEUTRAL_PION 
TRACK_TYPE_CHARGED_PION_PLUS 
TRACK_TYPE_PION_PLUS 
TRACK_TYPE_K_LONG 
TRACK_TYPE_K_SHORT 
TRACK_TYPE_K_PLUS 
TRACK_TYPE_D_PLUS 
TRACK_TYPE_D_ZERO 
TRACK_TYPE_D_PLUS_S 
TRACK_TYPE_B_ZERO 
TRACK_TYPE_B_PLUS 
TRACK_TYPE_B_ZERO_S 
TRACK_TYPE_B_PLUS_C 
TRACK_TYPE_PROTON 
TRACK_TYPE_NEUTRON 
TRACK_TYPE_LAMBDA 
TRACK_TYPE_SIGMA_PLUS 
TRACK_TYPE_NEUTRAL_SIGMA 
TRACK_TYPE_SIGMA_MINUS 
TRACK_TYPE_NEUTRAL_XI 
TRACK_TYPE_XI_MINUS 
TRACK_TYPE_OMEGA_MINUS 
TRACK_TYPE_LAMBDA_PLUS_C 
TRACK_TYPE_XI_ZERO_C 
TRACK_TYPE_XI_PLUS_C 
TRACK_TYPE_OMEGA_ZERO_C 
TRACK_TYPE_LAMBDA_B 
TRACK_TYPE_XI_MINUS_B 
TRACK_TYPE_XI_ZERO_B 
TRACK_TYPE_OMEGA_MINUS_B 
TRACK_TYPE_ANTIELECTRON 
TRACK_TYPE_ANTINUE 
TRACK_TYPE_ANTIMUON 
TRACK_TYPE_ANTINUMU 
TRACK_TYPE_ANTITAU 
TRACK_TYPE_ANTINUTAU 
TRACK_TYPE_NEUTRAL_ANTIPION 
TRACK_TYPE_CHARGED_PION_MINUS 
TRACK_TYPE_PION_MINUS 
TRACK_TYPE_ANTIK_LONG 
TRACK_TYPE_ANTIK_SHORT 
TRACK_TYPE_K_MINUS 
TRACK_TYPE_D_MINUS 
TRACK_TYPE_D_MINUS_S 
TRACK_TYPE_ANTID_ZERO 
TRACK_TYPE_ANTIB_ZERO 
TRACK_TYPE_B_MINUS 
TRACK_TYPE_ANTIB_ZERO_S 
TRACK_TYPE_B_MINUS_C 
TRACK_TYPE_ANTIPROTON 
TRACK_TYPE_ANTINEUTRON 
TRACK_TYPE_ANTILAMBDA 
TRACK_TYPE_ANTISIGMA_PLUS 
TRACK_TYPE_NEUTRAL_ANTISIGMA 
TRACK_TYPE_ANTISIGMA_MINUS 
TRACK_TYPE_NEUTRAL_ANTIXI 
TRACK_TYPE_ANTIXI_MINUS 
TRACK_TYPE_ANTIOMEGA_MINUS 
TRACK_TYPE_ANTIXI_ZERO_C 
TRACK_TYPE_XI_MINUS_C 
TRACK_TYPE_ANTIOMEGA_ZERO_C 
TRACK_TYPE_ANTILAMBDA_B 
TRACK_TYPE_XI_PLUS_B 
TRACK_TYPE_ANTIXI_ZERO_B 
TRACK_TYPE_OMEGA_PLUS_B 

Definition at line 96 of file JParticleTypes.hh.

96  { TRACK_TYPE_ELECTRON = 11,
97  TRACK_TYPE_NUE = 12,
98  TRACK_TYPE_MUON = 13,
99  TRACK_TYPE_NUMU = 14,
100  TRACK_TYPE_TAU = 15,
101  TRACK_TYPE_NUTAU = 16,
102  TRACK_TYPE_PHOTON = 22,
105  TRACK_TYPE_PION_PLUS = 211,
106  TRACK_TYPE_K_LONG = 130,
107  TRACK_TYPE_K_SHORT = 310,
108  TRACK_TYPE_K_PLUS = 321,
109  TRACK_TYPE_D_PLUS = 411,
110  TRACK_TYPE_D_ZERO = 421,
111  TRACK_TYPE_D_PLUS_S = 431,
112  TRACK_TYPE_B_ZERO = 511,
113  TRACK_TYPE_B_PLUS = 521,
114  TRACK_TYPE_B_ZERO_S = 531,
115  TRACK_TYPE_B_PLUS_C = 541,
116  TRACK_TYPE_PROTON = 2212,
117  TRACK_TYPE_NEUTRON = 2112,
118  TRACK_TYPE_LAMBDA = 3122,
119  TRACK_TYPE_SIGMA_PLUS = 3222,
121  TRACK_TYPE_SIGMA_MINUS = 3112,
122  TRACK_TYPE_NEUTRAL_XI = 3322,
123  TRACK_TYPE_XI_MINUS = 3312,
124  TRACK_TYPE_OMEGA_MINUS = 3334,
126  TRACK_TYPE_XI_ZERO_C = 4132,
127  TRACK_TYPE_XI_PLUS_C = 4232,
129  TRACK_TYPE_LAMBDA_B = 5122,
130  TRACK_TYPE_XI_MINUS_B = 5132,
131  TRACK_TYPE_XI_ZERO_B = 5232,
133 
135  TRACK_TYPE_ANTINUE = -12,
136  TRACK_TYPE_ANTIMUON = -13,
137  TRACK_TYPE_ANTINUMU = -14,
138  TRACK_TYPE_ANTITAU = -15,
139  TRACK_TYPE_ANTINUTAU = -16,
142  TRACK_TYPE_PION_MINUS = -211,
143  TRACK_TYPE_ANTIK_LONG = -130,
144  TRACK_TYPE_ANTIK_SHORT = -310,
145  TRACK_TYPE_K_MINUS = -321,
146  TRACK_TYPE_D_MINUS = -411,
147  TRACK_TYPE_D_MINUS_S = -431,
148  TRACK_TYPE_ANTID_ZERO = -421,
149  TRACK_TYPE_ANTIB_ZERO = -511,
150  TRACK_TYPE_B_MINUS = -521,
152  TRACK_TYPE_B_MINUS_C = -541,
153  TRACK_TYPE_ANTIPROTON = -2212,
154  TRACK_TYPE_ANTINEUTRON = -2112,
155  TRACK_TYPE_ANTILAMBDA = -3122,
160  TRACK_TYPE_ANTIXI_MINUS = -3312,
162  TRACK_TYPE_ANTIXI_ZERO_C = -4132,
163  TRACK_TYPE_XI_MINUS_C = -4232,
165  TRACK_TYPE_ANTILAMBDA_B = -5122,
166  TRACK_TYPE_XI_PLUS_B = -5132,
167  TRACK_TYPE_ANTIXI_ZERO_B = -5232,
168  TRACK_TYPE_OMEGA_PLUS_B = -5332 };

Function Documentation

double JAANET::getTime ( const Hit hit)
inline

Get true time of hit.

Parameters
hithit
Returns
true time of hit

Definition at line 107 of file JAAnetToolkit.hh.

108  {
109  return hit.t;
110  }
double t
hit time (from tdc+calibration or MC truth)
Definition: Hit.hh:23
double JAANET::getNPE ( const Hit hit)
inline

Get true charge of hit.

Parameters
hithit
Returns
true charge of hit

Definition at line 119 of file JAAnetToolkit.hh.

120  {
121  return hit.a;
122  }
double a
hit amplitude (in p.e.)
Definition: Hit.hh:24
bool JAANET::is_noise ( const Hit hit)
inline

Verify hit origin.

Parameters
hithit
Returns
true if noise; else false

Definition at line 131 of file JAAnetToolkit.hh.

132  {
133  return hit.type == HIT_TYPE_NOISE;
134  }
int type
particle type or parametrisation used for hit (mc only)
Definition: Hit.hh:28
JTimeRange JAANET::getTimeRange ( const Evt event)
inline

Get time range (i.e. time between earliest and latest hit) of Monte Carlo event.


Note that the global event time in not taken into account.

Parameters
eventevent
Returns
time range

Definition at line 144 of file JAAnetToolkit.hh.

145  {
146  JTimeRange time_range(JTimeRange::DEFAULT_RANGE());
147 
148  for (std::vector<Hit>::const_iterator hit = event.mc_hits.begin(); hit != event.mc_hits.end(); ++hit) {
149  if (!is_noise(*hit)) {
150  time_range.include(getTime(*hit));
151  }
152  }
153 
154  return time_range;
155  }
double getTime(const Hit &hit)
Get true time of hit.
bool is_noise(const Hit &hit)
Verify hit origin.
std::vector< Hit > mc_hits
MC: list of MC truth hits.
Definition: Evt.hh:48
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [s]).
JTimeRange JAANET::getTimeRange ( const Evt event,
const JTimeRange &  T_ns 
)
inline

Get time range (i.e. time between earliest and latest hit) of Monte Carlo event.


The resulting time range is larger than or equal to the given time window.
Note that the global event time in not taken into account.

Parameters
eventevent
T_nstime window [ns]
Returns
time range

Definition at line 167 of file JAAnetToolkit.hh.

168  {
169  JTimeRange time_range = getTimeRange(event);
170 
171  if (!time_range.is_valid()) {
172  time_range = T_ns;
173  }
174 
175  if (time_range.getLength() < T_ns.getLength()) {
176  time_range.setLength(T_ns.getLength());
177  }
178 
179  return time_range;
180  }
JTimeRange getTimeRange(const Evt &event)
Get time range (i.e. time between earliest and latest hit) of Monte Carlo event.
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [s]).
JPosition3D JAANET::getPosition ( const Vec pos)
inline

Get position.

Parameters
posposition
Returns
position

Definition at line 189 of file JAAnetToolkit.hh.

190  {
191  return JPosition3D(pos.x, pos.y, pos.z);
192  }
double z
Definition: Vec.hh:14
double y
Definition: Vec.hh:14
double x
Definition: Vec.hh:14
Vec JAANET::getPosition ( const JPosition3D &  pos)
inline

Get position.

Parameters
posposition
Returns
position

Definition at line 201 of file JAAnetToolkit.hh.

202  {
203  return Vec(pos.getX(), pos.getY(), pos.getZ());
204  }
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
JPosition3D JAANET::getPosition ( const Trk track)
inline

Get position.

Parameters
tracktrack
Returns
position

Definition at line 213 of file JAAnetToolkit.hh.

214  {
215  return getPosition(track.pos);
216  }
JPosition3D getPosition(const Vec &pos)
Get position.
Vec pos
postion [m] of the track at time t
Definition: Trk.hh:17
JDirection3D JAANET::getDirection ( const Vec dir)
inline

Get direction.

Parameters
dirdirection
Returns
direction

Definition at line 225 of file JAAnetToolkit.hh.

226  {
227  return JDirection3D(dir.x, dir.y, dir.z);
228  }
double z
Definition: Vec.hh:14
double y
Definition: Vec.hh:14
double x
Definition: Vec.hh:14
Vec JAANET::getDirection ( const JDirection3D &  dir)
inline

Get direction.

Parameters
dirdirection
Returns
direction

Definition at line 237 of file JAAnetToolkit.hh.

238  {
239  return Vec(dir.getDX(), dir.getDY(), dir.getDZ());
240  }
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
JDirection3D JAANET::getDirection ( const Trk track)
inline

Get direction.

Parameters
tracktrack
Returns
direction

Definition at line 249 of file JAAnetToolkit.hh.

250  {
251  return getDirection(track.dir);
252  }
Vec dir
track direction
Definition: Trk.hh:18
JDirection3D getDirection(const Vec &dir)
Get direction.
JAxis3D JAANET::getAxis ( const Trk track)
inline

Get axis.

Parameters
tracktrack
Returns
axis

Definition at line 261 of file JAAnetToolkit.hh.

262  {
263  return JAxis3D(getPosition(track), getDirection(track));
264  }
JDirection3D getDirection(const Vec &dir)
Get direction.
JPosition3D getPosition(const Vec &pos)
Get position.
JTrack3E JAANET::getTrack ( const Trk track)
inline

Get track.

Parameters
tracktrack
Returns
track

Definition at line 273 of file JAAnetToolkit.hh.

274  {
275  return JTrack3E(JTrack3D(getAxis(track), track.t), track.E);
276  }
double t
track time [ns] (when the particle is at pos )
Definition: Trk.hh:19
double E
Energy [GeV] (either MC truth or reconstructed)
Definition: Trk.hh:20
JAxis3D getAxis(const Trk &track)
Get axis.
JTransformation3D JAANET::getTransformation ( const Trk track)
inline

Get transformation.

Parameters
tracktrack
Returns
transformation

Definition at line 285 of file JAAnetToolkit.hh.

286  {
287  return JTransformation3D(getPosition(track), getDirection(track));
288  }
JDirection3D getDirection(const Vec &dir)
Get direction.
JPosition3D getPosition(const Vec &pos)
Get position.
double JAANET::getW ( const Trk track,
const size_t  index,
const double  value 
)
inline

Get track information.

Parameters
tracktrack
indexindex
valuedefault value
Returns
actual value

Definition at line 299 of file JAAnetToolkit.hh.

300  {
301  if (index < track.fitinf.size())
302  return track.fitinf[index];
303  else
304  return value;
305  }
std::vector< double > fitinf
place to store additional fit info, see km3net-dataformat/definitions/fitparameters.csv
Definition: Trk.hh:32
bool JAANET::is_photon ( const Trk track)
inline

Test whether given track is a photon or neutral pion.

Parameters
tracktrack
Returns
true if photon or neutral pion; else false

Definition at line 314 of file JAAnetToolkit.hh.

314  { return ( track.type == TRACK_TYPE_PHOTON ||
315  abs(track.type) == TRACK_TYPE_NEUTRAL_PION); }
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool JAANET::is_neutrino ( const Trk track)
inline

Test whether given track is a neutrino.

Parameters
tracktrack
Returns
true if neutrino; else false

Definition at line 323 of file JAAnetToolkit.hh.

323  { return (abs(track.type) == TRACK_TYPE_NUE ||
324  abs(track.type) == TRACK_TYPE_NUMU ||
325  abs(track.type) == TRACK_TYPE_NUTAU); }
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool JAANET::is_electron ( const Trk track)
inline

Test whether given track is a (anti-)electron.

Parameters
tracktrack
Returns
true if (anti-)electron; else false

Definition at line 333 of file JAAnetToolkit.hh.

333 { return (abs(track.type) == TRACK_TYPE_ELECTRON); }
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool JAANET::is_muon ( const Trk track)
inline

Test whether given track is a (anti-)muon.

Parameters
tracktrack
Returns
true if (anti-)muon; else false

Definition at line 341 of file JAAnetToolkit.hh.

341 { return (abs(track.type) == TRACK_TYPE_MUON); }
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool JAANET::is_tau ( const Trk track)
inline

Test whether given track is a (anti-)tau.

Parameters
tracktrack
Returns
true if (anti-)tau; else false

Definition at line 349 of file JAAnetToolkit.hh.

349 { return (abs(track.type) == TRACK_TYPE_TAU); }
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool JAANET::is_pion ( const Trk track)
inline

Test whether given track is a charged pion.

Parameters
tracktrack
Returns
true if charged pion; else false

Definition at line 357 of file JAAnetToolkit.hh.

357 { return (abs(track.type) == TRACK_TYPE_CHARGED_PION_PLUS); }
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool JAANET::is_proton ( const Trk track)
inline

Test whether given track is a (anti-)proton.

Parameters
tracktrack
Returns
true if (anti-)proton; else false

Definition at line 365 of file JAAnetToolkit.hh.

365 { return (abs(track.type) == TRACK_TYPE_PROTON); }
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool JAANET::is_neutron ( const Trk track)
inline

Test whether given track is a (anti-)neutron.

Parameters
tracktrack
Returns
true if (anti-)neutron; else false

Definition at line 373 of file JAAnetToolkit.hh.

373 { return (abs(track.type) == TRACK_TYPE_NEUTRON); }
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool JAANET::is_lepton ( const Trk track)
inline

Test whether given track is a lepton.

Parameters
tracktrack
Returns
true if lepton; else fails

Definition at line 381 of file JAAnetToolkit.hh.

381  { return (is_neutrino(track) ||
382  is_electron(track) ||
383  is_muon (track) ||
384  is_tau (track)); }
bool is_electron(const Trk &track)
Test whether given track is a (anti-)electron.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
bool is_neutrino(const Trk &track)
Test whether given track is a neutrino.
bool is_tau(const Trk &track)
Test whether given track is a (anti-)tau.
bool JAANET::is_charged_lepton ( const Trk track)
inline

Test whether given track is a charged lepton.

Parameters
tracktrack
Returns
true if lepton; else fails

Definition at line 392 of file JAAnetToolkit.hh.

392  { return (is_electron(track) ||
393  is_muon (track) ||
394  is_tau (track)); }
bool is_electron(const Trk &track)
Test whether given track is a (anti-)electron.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
bool is_tau(const Trk &track)
Test whether given track is a (anti-)tau.
bool JAANET::is_hadron ( const Trk track)
inline

Test whether given track is a hadron.

Parameters
tracktrack
Returns
true if hadron; else fails

Definition at line 402 of file JAAnetToolkit.hh.

402  { return (abs(track.type) != TRACK_TYPE_PHOTON &&
403  !is_lepton(track)); }
bool is_lepton(const Trk &track)
Test whether given track is a lepton.
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool JAANET::is_meson ( const Trk track)
inline

Test whether given track is a meson (is hadron and third digit of PDG code is zero)

Parameters
tracktrack
Returns
true if hadron; else fails

Definition at line 411 of file JAAnetToolkit.hh.

411  { return (is_hadron(track) &&
412  ((int)(track.type / 1000)) % 10 == 0); }
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool is_hadron(const Trk &track)
Test whether given track is a hadron.
bool JAANET::is_baryon ( const Trk track)
inline

Test whether given track is a baryon (is hadron and third digit of PDG code is not zero)

Parameters
tracktrack
Returns
true if hadron; else fails

Definition at line 420 of file JAAnetToolkit.hh.

420  { return (is_hadron(track) &&
421  ((int)(track.type / 1000)) % 10 != 0); }
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool is_hadron(const Trk &track)
Test whether given track is a hadron.
bool JAANET::has_particleID ( const Trk track,
const int  type 
)
inline

Test whether given track corresponds to given particle type.

Parameters
tracktrack
typeparticle type
Returns
true if matches the corresponding particle; else false

Definition at line 430 of file JAAnetToolkit.hh.

430 { return (track.type == type); }
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
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
bool JAANET::is_initialstate ( const Trk track)
inline

Test whether given track corresponds to an initial state particle.

Parameters
tracktrack
Returns
true if track corresponds to an initial state particle; else false

Definition at line 438 of file JAAnetToolkit.hh.

439  {
440  if (Evt::ROOT_IO_VERSION >= 14) {
441 
442  return (track.status == TRK_ST_PRIMARYNEUTRINO ||
443  track.status == TRK_ST_PRIMARYCOSMIC ||
444  track.status == TRK_ST_MUONBUNDLE ||
445  track.status == TRK_ST_ININUCLEI);
446 
447  } else if (Evt::ROOT_IO_VERSION >= 11) {
448 
449  return (track.mother_id == TRK_MOTHER_UNDEFINED ||
450  track.mother_id == TRK_MOTHER_NONE);
451 
452  } else {
453 
454  return is_neutrino(track) && track.id == 0;
455  }
456  }
static const int TRK_MOTHER_NONE
mother id of a particle if it has no parent
Definition: trkmembers.hh:13
bool is_neutrino(const Trk &track)
Test whether given track is a neutrino.
int mother_id
MC id of the parent particle.
Definition: Trk.hh:29
static const int TRK_ST_PRIMARYNEUTRINO
initial state neutrino (&#39;neutrino&#39; tag in evt files from gseagen and genhen).
Definition: trkmembers.hh:16
static const int TRK_ST_MUONBUNDLE
initial state muon bundle (mupage)
Definition: trkmembers.hh:18
static const int TRK_ST_ININUCLEI
Initial state nuclei (gseagen)
Definition: trkmembers.hh:19
static const int TRK_ST_PRIMARYCOSMIC
initial state cosmic ray (&#39;track_primary&#39; tag in evt files from corant).
Definition: trkmembers.hh:17
static const int TRK_MOTHER_UNDEFINED
KM3NeT Data Definitions v3.4.0-8-ge14cb17 https://git.km3net.de/common/km3net-dataformat.
Definition: trkmembers.hh:12
int id
track identifier
Definition: Trk.hh:16
int status
MC status code, see km3net-dataformat/definitions/trkmembers.csv for values.
Definition: Trk.hh:28
static int ROOT_IO_VERSION
Streamer version as obtained from ROOT file.
Definition: Evt.hh:274
bool JAANET::is_finalstate ( const Trk track)
inline

Test whether given track corresponds to a final state particle.

Parameters
tracktrack
Returns
true if track corresponds to a final state particle; else false

Definition at line 464 of file JAAnetToolkit.hh.

465  {
466  if (Evt::ROOT_IO_VERSION >= 15) {
467  return track.status == TRK_ST_FINALSTATE;
468  } else {
469  return !is_initialstate(track);
470  }
471  }
bool is_initialstate(const Trk &track)
Test whether given track corresponds to an initial state particle.
int status
MC status code, see km3net-dataformat/definitions/trkmembers.csv for values.
Definition: Trk.hh:28
static const int TRK_ST_FINALSTATE
for MC: the particle must be processed by detector simulation (&#39;track_in&#39; tag in evt files)...
Definition: trkmembers.hh:15
static int ROOT_IO_VERSION
Streamer version as obtained from ROOT file.
Definition: Evt.hh:274
bool JAANET::has_neutrino ( const Evt evt)
inline

Test whether given event has an incoming neutrino.

Parameters
evtevent
Returns
true if neutrino; else false

Definition at line 479 of file JAAnetToolkit.hh.

480  {
481  if (Evt::ROOT_IO_VERSION >= 14) {
482 
483  std::vector<Trk>::const_iterator i = find_if(evt.mc_trks.cbegin(), evt.mc_trks.cend(),
485  return i != evt.mc_trks.cend();
486 
487  } else {
488 
489  return !evt.mc_trks.empty() && is_neutrino(evt.mc_trks[0]);
490  }
491  }
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
Definition: JPredicate.hh:128
bool is_neutrino(const Trk &track)
Test whether given track is a neutrino.
static const int TRK_ST_PRIMARYNEUTRINO
initial state neutrino (&#39;neutrino&#39; tag in evt files from gseagen and genhen).
Definition: trkmembers.hh:16
int status
MC status code, see km3net-dataformat/definitions/trkmembers.csv for values.
Definition: Trk.hh:28
static int ROOT_IO_VERSION
Streamer version as obtained from ROOT file.
Definition: Evt.hh:274
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
const Trk& JAANET::get_neutrino ( const Evt evt)
inline

Get incoming neutrino.

Parameters
evtevent
Returns
neutrino

Definition at line 499 of file JAAnetToolkit.hh.

500  {
501  if (Evt::ROOT_IO_VERSION >= 14) {
502 
503  std::vector<Trk>::const_iterator i = find_if(evt.mc_trks.cbegin(), evt.mc_trks.cend(),
505 
506  if (i != evt.mc_trks.cend()) { return *i; }
507 
508  } else if (!evt.mc_trks.empty() && is_neutrino(evt.mc_trks[0])) {
509 
510  return evt.mc_trks[0];
511  }
512 
513  THROW(JIndexOutOfRange, "JAANET::get_neutrino(): Event " << evt.id << " has no neutrino.");
514  }
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
Definition: JPredicate.hh:128
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
bool is_neutrino(const Trk &track)
Test whether given track is a neutrino.
static const int TRK_ST_PRIMARYNEUTRINO
initial state neutrino (&#39;neutrino&#39; tag in evt files from gseagen and genhen).
Definition: trkmembers.hh:16
int status
MC status code, see km3net-dataformat/definitions/trkmembers.csv for values.
Definition: Trk.hh:28
int id
offline event identifier
Definition: Evt.hh:22
static int ROOT_IO_VERSION
Streamer version as obtained from ROOT file.
Definition: Evt.hh:274
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
const Trk& JAANET::get_primary ( const Evt evt)
inline

Get primary.

Parameters
evtevent
Returns
primary track

Definition at line 522 of file JAAnetToolkit.hh.

523  {
524  using namespace std;
525  using namespace JPP;
526 
527  for (vector<Trk>::const_iterator i = evt.mc_trks.cbegin(); i != evt.mc_trks.cend(); ++i) {
528  if (is_initialstate(*i) && i->status != TRK_ST_ININUCLEI) {
529  return *i;
530  }
531  }
532 
533  THROW(JIndexOutOfRange, "JAANET::get_primary(): Cannot retrieve primary track for event " << evt.id << ".");
534  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
static const int TRK_ST_ININUCLEI
Initial state nuclei (gseagen)
Definition: trkmembers.hh:19
bool is_initialstate(const Trk &track)
Test whether given track corresponds to an initial state particle.
int id
offline event identifier
Definition: Evt.hh:22
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
JVertex3D JAANET::getVertex ( const Trk track)
inline

Get vertex.

Parameters
tracktrack
Returns
vertex

Definition at line 543 of file JAAnetToolkit.hh.

544  {
545  return JVertex3D(getPosition(track), track.t);
546  }
double t
track time [ns] (when the particle is at pos )
Definition: Trk.hh:19
JPosition3D getPosition(const Vec &pos)
Get position.
JVertex3D JAANET::getVertex ( const Evt event)
inline

Get event vertex.

Parameters
eventevent
Returns
event vertex

Definition at line 554 of file JAAnetToolkit.hh.

555  {
556  using namespace std;
557  using namespace JPP;
558 
559  if (has_neutrino(event)) {
560 
561  const Trk& neutrino = get_neutrino(event);
562 
563  return getVertex(neutrino);
564 
565  } else if (!event.mc_trks.empty()) {
566 
567  vector<Trk>::const_iterator i = find_if(event.mc_trks.begin(), event.mc_trks.end(), &is_initialstate);
568 
569  if (i != event.mc_trks.end()) {
570  return getVertex(*i);
571  } else {
572  THROW(JValueOutOfRange, "getVertex(): No initial state track found.");
573  }
574 
575  } else if (!event.trks.empty()) { // For reconstructed DAQ events
576 
577  const Trk& track = get_best_reconstructed_track<JPP_RECONSTRUCTION_TYPE>(event);
578 
579  return getVertex(track);
580 
581  } else {
582 
583  THROW(JValueOutOfRange, "getVertex(): Could not find a valid event vertex.");
584  }
585  }
JVertex3D getVertex(const Trk &track)
Get vertex.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
bool is_initialstate(const Trk &track)
Test whether given track corresponds to an initial state particle.
std::vector< Trk > trks
list of reconstructed tracks (can be several because of prefits,showers, etc).
Definition: Evt.hh:39
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
int JAANET::count_electrons ( const Evt evt)
inline

Count the number of electrons in a given event.

Parameters
evtevent
Returns
number of electrons

Definition at line 593 of file JAAnetToolkit.hh.

594  {
595  return std::count_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_electron);
596  }
bool is_electron(const Trk &track)
Test whether given track is a (anti-)electron.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
bool JAANET::has_electron ( const Evt evt)
inline

Test whether given event has an electron.

Parameters
evtevent
Returns
true if event has electron; else false

Definition at line 604 of file JAAnetToolkit.hh.

605  {
606  return count_electrons(evt) != 0;
607  }
int count_electrons(const Evt &evt)
Count the number of electrons in a given event.
const Trk& JAANET::get_electron ( const Evt evt)
inline

Get first electron from the event tracklist.

Parameters
evtevent
Returns
electron

Definition at line 615 of file JAAnetToolkit.hh.

616  {
617  if (count_electrons(evt) > 0)
618  return *std::find_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_electron);
619  else
620  THROW(JIndexOutOfRange, "This event has no electron.");
621  }
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.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
bool JAANET::from_electron ( const Hit hit)
inline

Test whether given hit was produced by an electron.

Warning: This method will only work with the output of KM3Sim. For JSirene or KM3, you should check if track.id == hit.origin instead.

Parameters
hithit
Returns
true if hit was produced by an electron; else false

Definition at line 632 of file JAAnetToolkit.hh.

633  {
634  return hit.type == GEANT4_TYPE_ELECTRON || hit.type == GEANT4_TYPE_ANTIELECTRON;
635  }
int type
particle type or parametrisation used for hit (mc only)
Definition: Hit.hh:28
int JAANET::count_muons ( const Evt evt)
inline

Count the number of muons in a given event.

Parameters
evtevent
Returns
number of muons

Definition at line 643 of file JAAnetToolkit.hh.

644  {
645  return std::count_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_muon);
646  }
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
bool JAANET::has_muon ( const Evt evt)
inline

Test whether given event has a muon.

Parameters
evtevent
Returns
true if event has muon; else false

Definition at line 654 of file JAAnetToolkit.hh.

655  {
656  return count_muons(evt) != 0;
657  }
int count_muons(const Evt &evt)
Count the number of muons in a given event.
const Trk& JAANET::get_muon ( const Evt evt)
inline

Get first muon from the event tracklist.

Parameters
evtevent
Returns
muon

Definition at line 665 of file JAAnetToolkit.hh.

666  {
667  if (count_muons(evt) > 0)
668  return *std::find_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_muon);
669  else
670  THROW(JIndexOutOfRange, "This event has no muon.");
671  }
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
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.
Definition: JException.hh:712
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
bool JAANET::from_muon ( const Hit hit)
inline

Test whether given hit was produced by a muon.

Warning: This method will only work with the output of KM3Sim. For JSirene or KM3, you should check if track.id == hit.origin instead.

Parameters
hithit
Returns
true if hit was produced by a muon; else false

Definition at line 682 of file JAAnetToolkit.hh.

683  {
684  return hit.type == GEANT4_TYPE_MUON || hit.type == GEANT4_TYPE_ANTIMUON;
685  }
int type
particle type or parametrisation used for hit (mc only)
Definition: Hit.hh:28
int JAANET::count_taus ( const Evt evt)
inline

Count the number of taus in a given event.

Parameters
evtevent
Returns
number of taus

Definition at line 693 of file JAAnetToolkit.hh.

694  {
695  return std::count_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_tau);
696  }
bool is_tau(const Trk &track)
Test whether given track is a (anti-)tau.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
bool JAANET::has_tau ( const Evt evt)
inline

Test whether given event has a tau.

Parameters
evtevent
Returns
true if event has tau; else false

Definition at line 704 of file JAAnetToolkit.hh.

705  {
706  return count_taus(evt) != 0;
707  }
int count_taus(const Evt &evt)
Count the number of taus in a given event.
const Trk& JAANET::get_tau ( const Evt evt)
inline

Get first tau from the event tracklist.

Parameters
evtevent
Returns
tau

Definition at line 715 of file JAAnetToolkit.hh.

716  {
717  if (count_taus(evt) > 0)
718  return *std::find_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_tau);
719  else
720  THROW(JIndexOutOfRange, "This event has no tau.");
721  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
int count_taus(const Evt &evt)
Count the number of taus in a given event.
bool is_tau(const Trk &track)
Test whether given track is a (anti-)tau.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
bool JAANET::has_muonic_taudecay ( const Evt event)
inline

Test whether given event contains a tau-lepton decay into a muon.

Parameters
eventevent
Returns
true if event contains a muonic tau-lepton decay; else false

Definition at line 730 of file JAAnetToolkit.hh.

731  {
732  using namespace std;
733 
734  if (has_tau(event)) {
735 
736  const Trk& tau = get_tau(event);
737 
738  for (vector<Trk>::const_iterator i = event.mc_trks.cbegin(); i != event.mc_trks.cend(); ++i) {
739  if (is_muon(*i) && i->mother_id == tau.id) {
740  return true;
741  }
742  }
743  }
744 
745  return false;
746  }
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
int id
track identifier
Definition: Trk.hh:16
const Trk & get_tau(const Evt &evt)
Get first tau from the event tracklist.
bool has_tau(const Evt &evt)
Test whether given event has a tau.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
bool JAANET::has_leptonic_taudecay ( const Evt event)
inline

Test whether given event contains a leptonic tau-decay.

Parameters
eventevent
Returns
true if event contains a leptonic tau-decay; else false

Definition at line 754 of file JAAnetToolkit.hh.

755  {
756  using namespace std;
757 
758  if (has_tau(event)) {
759 
760  const Trk& tau = get_tau(event);
761 
762  for (vector<Trk>::const_iterator i = event.mc_trks.cbegin(); i != event.mc_trks.cend(); ++i) {
763  if ((is_electron(*i) || is_muon(*i)) && i->mother_id == tau.id) {
764  return true;
765  }
766  }
767  }
768 
769  return false;
770  }
bool is_electron(const Trk &track)
Test whether given track is a (anti-)electron.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
int id
track identifier
Definition: Trk.hh:16
const Trk & get_tau(const Evt &evt)
Get first tau from the event tracklist.
bool has_tau(const Evt &evt)
Test whether given event has a tau.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
bool JAANET::has_hadronic_taudecay ( const Evt event)
inline

Test whether given event contains a hadronic tau-decay.

Parameters
eventevent
Returns
true if event contains a hadronic tau-decay; else false

Definition at line 778 of file JAAnetToolkit.hh.

779  {
780  return has_tau(event) && !has_leptonic_taudecay(event);
781  }
bool has_leptonic_taudecay(const Evt &event)
Test whether given event contains a leptonic tau-decay.
bool has_tau(const Evt &evt)
Test whether given event has a tau.
int JAANET::count_taudecay_prongs ( const Evt event)
inline

Count the number of tau-lepton decay prongs in a given event.


The number of prongs is defined as the number of charged tau-lepton decay products.

Parameters
eventevent
Returns
number of tau-lepton decay prongs

Definition at line 790 of file JAAnetToolkit.hh.

791  {
792  using namespace std;
793 
794  int n = 0;
795 
796  if (has_tau(event)) {
797 
798  const Trk& tau = get_tau(event);
799 
800  for (vector<Trk>::const_iterator i = event.mc_trks.cbegin(); i != event.mc_trks.cend(); ++i) {
801  if (i->mother_id == tau.id && JPDB::getInstance().getPDG(i->type).charge != 0) {
802  ++n;
803  }
804  }
805  }
806 
807  return n;
808  }
const int n
Definition: JPolint.hh:786
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
int id
track identifier
Definition: Trk.hh:16
const Trk & get_tau(const Evt &evt)
Get first tau from the event tracklist.
bool has_tau(const Evt &evt)
Test whether given event has a tau.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
bool JAANET::from_tau ( const Hit hit)
inline

Test whether given hit was produced by a tau.

Warning: This method will only work with the output of KM3Sim. For JSirene or KM3, you should check if track.id == hit.origin instead.

Parameters
hithit
Returns
true if hit was produced by a tau; else false

Definition at line 819 of file JAAnetToolkit.hh.

820  {
821  return hit.type == GEANT4_TYPE_TAU || hit.type == GEANT4_TYPE_ANTITAU;
822  }
int type
particle type or parametrisation used for hit (mc only)
Definition: Hit.hh:28
int JAANET::count_hadrons ( const Evt evt)
inline

Count the number of hadrons in a given event (not including neutral pions)

Parameters
evtevent
Returns
number of hadrons

Definition at line 830 of file JAAnetToolkit.hh.

831  {
832  return std::count_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_hadron);
833  }
bool is_hadron(const Trk &track)
Test whether given track is a hadron.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
bool JAANET::from_hadron ( const Hit hit)
inline

Test whether given hit was produced by a hadronic shower.

Warning: This method will only work with the output of KM3Sim. For JSirene or KM3, you should check if track.id == hit.origin instead.

Parameters
hithit
Returns
true if hit was produced by a hadron; else false

Definition at line 844 of file JAAnetToolkit.hh.

845  {
846  return (!from_electron(hit) && !from_muon(hit) && !from_tau(hit));
847  }
bool from_tau(const Hit &hit)
Test whether given hit was produced by a tau.
bool from_electron(const Hit &hit)
Test whether given hit was produced by an electron.
bool from_muon(const Hit &hit)
Test whether given hit was produced by a muon.
void JAANET::add_time_offset ( Evt evt,
const double  tOff 
)
inline

Add time offset to mc event; according to current definition, the absolute time of the event is defined by the track "t" attribute; this could change in the future if the global attribute mc_t is assigned to this purpose.

Parameters
evtevent
tOfftime offset [ns]

Definition at line 858 of file JAAnetToolkit.hh.

859  {
860  for (std::vector<Trk>::iterator p = evt.mc_trks.begin(); p != evt.mc_trks.end(); p++) {
861  p->t += tOff;
862  }
863  }
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
double JAANET::getKineticEnergy ( const Trk trk)
inline

Get track kinetic energy.

Parameters
trktrack
Returns
kinetic energy [GeV]

Definition at line 872 of file JAAnetToolkit.hh.

873  {
874  const double energy = trk.E;
875  const double mass = JPDB::getInstance().getPDG(trk.type).mass;
876 
877  return getKineticEnergy(energy, mass);
878  }
double E
Energy [GeV] (either MC truth or reconstructed)
Definition: Trk.hh:20
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
double getKineticEnergy(const Trk &trk)
Get track kinetic energy.
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
double JAANET::getE0 ( const Evt evt)
inline

Get initial state energy of a neutrino interaction.


This method includes baryon number conservation.

Parameters
evtevent
Returns
energy [GeV]

Definition at line 888 of file JAAnetToolkit.hh.

889  {
890  using namespace std;
891 
892  const Trk& neutrino = get_neutrino(evt);
893 
894  double E0 = neutrino.E;
895 
896  for (vector<Trk>::const_iterator track = evt.mc_trks.cbegin(); track != evt.mc_trks.end(); ++track) {
897 
898  if (!is_finalstate(*track)) { continue; }
899 
900  if (track->type == TRACK_TYPE_NEUTRON ||
901  track->type == TRACK_TYPE_SIGMA_MINUS ||
902  track->type == TRACK_TYPE_NEUTRAL_SIGMA) {
903 
904  E0 += MASS_NEUTRON;
905 
906  } else if (track->type == TRACK_TYPE_PROTON ||
907  track->type == TRACK_TYPE_LAMBDA ||
908  track->type == TRACK_TYPE_SIGMA_PLUS) {
909 
910  E0 += MASS_PROTON;
911 
912  } else if (track->type == TRACK_TYPE_ANTINEUTRON) {
913 
914  E0 -= MASS_NEUTRON;
915 
916  } else if (track->type == TRACK_TYPE_ANTIPROTON ||
917  track->type == TRACK_TYPE_ANTILAMBDA) {
918 
919  E0 -= MASS_PROTON;
920  }
921  }
922 
923  return E0;
924  }
static const double MASS_NEUTRON
neutron mass [GeV]
bool is_finalstate(const Trk &track)
Test whether given track corresponds to a final state particle.
static const double MASS_PROTON
proton mass [GeV]
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
double JAANET::getE1 ( const Evt evt)
inline

Get final state energy of a neutrino interaction.


This method includes muon energy loss.

Parameters
evtevent
Returns
energy [GeV]

Definition at line 934 of file JAAnetToolkit.hh.

935  {
936  using namespace std;
937  using namespace JPP;
938 
939  double E1 = 0.0;
940 
941  const Trk& neutrino = get_neutrino(evt);
942 
943  for (vector<Trk>::const_iterator track = evt.mc_trks.cbegin(); track != evt.mc_trks.cend(); ++track) {
944 
945  if (!is_finalstate(*track)) { continue; }
946 
947  if (is_muon(*track)) {
948 
949  const Trk& mother = ( track->mother_id > TRK_MOTHER_UNDEFINED ?
950  evt.mc_trks[track->mother_id] : neutrino );
951 
952  const double distance = (track->pos - mother.pos).len();
953 
954  E1 += gWater(track->E, -distance);
955 
956  } else {
957 
958  E1 += track->E;
959  }
960  }
961 
962  return E1;
963  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
Definition: JGeane.hh:381
bool is_finalstate(const Trk &track)
Test whether given track corresponds to a final state particle.
static const int TRK_MOTHER_UNDEFINED
KM3NeT Data Definitions v3.4.0-8-ge14cb17 https://git.km3net.de/common/km3net-dataformat.
Definition: trkmembers.hh:12
Vec pos
postion [m] of the track at time t
Definition: Trk.hh:17
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
Vec JAANET::getP0 ( const Evt evt)
inline

Get momentum vector of the initial state of a neutrino interaction.


This method assumes neutrino DIS on a stationary nucleus

Parameters
evtevent
Returns
energy [GeV]

Definition at line 973 of file JAAnetToolkit.hh.

974  {
975  const Trk& neutrino = get_neutrino(evt);
976 
977  return neutrino.E * neutrino.dir;
978  }
Vec dir
track direction
Definition: Trk.hh:18
double E
Energy [GeV] (either MC truth or reconstructed)
Definition: Trk.hh:20
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
Vec JAANET::getP1 ( const Evt evt)
inline

Get momentum vector of the final state of a neutrino interaction.


This method includes muon energy losses.

Parameters
evtevent
Returns
final state momentum vector [GeV]

Definition at line 988 of file JAAnetToolkit.hh.

989  {
990  using namespace std;
991  using namespace JPP;
992 
993  Vec P1(0,0,0);
994 
995  const Trk& neutrino = get_neutrino(evt);
996 
997  for (vector<Trk>::const_iterator track = evt.mc_trks.cbegin(); track != evt.mc_trks.cend(); ++track) {
998 
999  if (!is_finalstate(*track)) { continue; }
1000 
1001  double kineticEnergy = 0.0;
1002 
1003  if (is_muon(*track)) {
1004 
1005  const Trk& mother = ( track->mother_id > TRK_MOTHER_UNDEFINED ?
1006  evt.mc_trks[track->mother_id] : neutrino );
1007 
1008  const double distance = (track->pos - mother.pos).len();
1009  const double energy = gWater(track->E, -distance);
1010 
1011  kineticEnergy = getKineticEnergy(energy, MASS_MUON);
1012 
1013  } else {
1014 
1015  kineticEnergy = getKineticEnergy(*track);
1016  }
1017 
1018  P1 += kineticEnergy * track->dir;
1019  }
1020 
1021  return P1;
1022  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
static const double MASS_MUON
muon mass [GeV]
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
Definition: JGeane.hh:381
bool is_finalstate(const Trk &track)
Test whether given track corresponds to a final state particle.
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
double getKineticEnergy(const Trk &trk)
Get track kinetic energy.
static const int TRK_MOTHER_UNDEFINED
KM3NeT Data Definitions v3.4.0-8-ge14cb17 https://git.km3net.de/common/km3net-dataformat.
Definition: trkmembers.hh:12
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
Vec pos
postion [m] of the track at time t
Definition: Trk.hh:17
then P1
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
double JAANET::getInvariantMass ( const Evt event)
inline

Get final state invariant mass.

Parameters
eventevent
Returns
invariant mass [GeV]

Definition at line 1031 of file JAAnetToolkit.hh.

1032  {
1033  using namespace std;
1034  using namespace JPP;
1035 
1036  double Minv = 0.0;
1037 
1038  for (vector<Trk>::const_iterator track = event.mc_trks.cbegin(); track != event.mc_trks.cend(); ++track) {
1039 
1040  if (!is_finalstate(*track)) { continue; }
1041 
1042  const double mass = JPDB::getInstance().getPDG(track->type).mass;
1043 
1044  Minv += mass;
1045  }
1046 
1047  return Minv;
1048  }
bool is_finalstate(const Trk &track)
Test whether given track corresponds to a final state particle.
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
template<class JOscProbInterpolator_t = JOscProbInterpolator<>>
JEvtWeightFactorFunction<JAtmosphericNeutrinoFlux, JFlux> JAANET::make_atmosphericNeutrinoFluxFunction ( const std::string &  oscProbTableFile,
const JOscParametersInterface< double > &  oscParameters 
)
inline

Auxiliary method for creating an interface to an atmospheric neutrino flux function
using an oscillation probability interpolation table.

Parameters
oscProbTableFileoscillation probability interpolation table
oscParametersoscillation parameters

Definition at line 90 of file JAtmosphericNeutrinoFlux.hh.

91  {
92 
93  const JOscProbInterpolator_t interpolator(oscProbTableFile.c_str(), oscParameters);
94 
95  const JAtmosphericNeutrinoFlux flux(interpolator);
96 
97  return make_fluxFunction(flux);
98  }
JEvtWeightFactorFunction< JFunction_t, JFlux > make_fluxFunction(const JFunction_t &flux)
Auxiliary method for creating an interface to a flux function.
Implementation of atmospheric neutrino flux using official KM3NeT atmospheric flux function...
Neutrino flux.
Definition: JHead.hh:906
template<class JFunction_t , class JEvtWeightFactor_t = JEvtWeightFactor>
JEvtWeightFactorFunction<JFunction_t, JEvtWeightFactor_t> JAANET::make_weightFactor ( const JFunction_t &  function)
inline

Auxiliary method for creating an interface to an event-weight factor.

Parameters
functionfunction object
Returns
event-weight factor interface

Definition at line 202 of file JEvtWeightFactorFunction.hh.

202  {
204  }
Implementation of event-weight factor interface.
template<class JEvtWeightFactor_t = JEvtWeightFactor>
JEvtWeightFactorFunction<pEvtWeightFactor, JEvtWeightFactor_t> JAANET::make_weightFactor ( pEvtWeightFactor  function)
inline

Auxiliary method for creating an interface to an event-weight factor.

Parameters
functionfunction pointer
Returns
event-weight factor interface

Definition at line 214 of file JEvtWeightFactorFunction.hh.

template<class JFunction_t >
JEvtWeightFactorFunction<JFunction_t, JFlux> JAANET::make_fluxFunction ( const JFunction_t &  flux)
inline

Auxiliary method for creating an interface to a flux function.

Parameters
fluxflux function object
Returns
flux function interface

Definition at line 226 of file JEvtWeightFactorFunction.hh.

226  {
228  }
Implementation of event-weight factor interface.
Neutrino flux.
Definition: JHead.hh:906
JEvtWeightFactorFunction<pFlux, JFlux> JAANET::make_fluxFunction ( pFlux  flux)
inline

Auxiliary method for creating an interface to a flux function.

Parameters
fluxflux function pointer
Returns
flux function interface

Definition at line 237 of file JEvtWeightFactorFunction.hh.

237  {
239  }
Implementation of event-weight factor interface.
Neutrino flux.
Definition: JHead.hh:906
template<class JFunction_t >
JEvtWeightFactorFunction<JFunction_t, JDiffuseFlux> JAANET::make_diffuseFluxFunction ( const JFunction_t &  flux)
inline

Auxiliary method for creating an interface to a diffuse flux function.

Parameters
fluxdiffuse flux function object
Returns
diffuse flux function interface

Definition at line 249 of file JEvtWeightFactorFunction.hh.

249  {
251  }
Implementation of event-weight factor interface.
Neutrino flux.
Definition: JHead.hh:906
JEvtWeightFactorFunction<pDiffuseFlux, JDiffuseFlux> JAANET::make_diffuseFluxFunction ( pDiffuseFlux  flux)
inline

Auxiliary method for creating an interface to a diffuse flux function.

Parameters
fluxdiffuse flux function pointer
Returns
diffuse flux function interface

Definition at line 260 of file JEvtWeightFactorFunction.hh.

260  {
262  }
Implementation of C-style diffuse flux event-weight factor.
Neutrino flux.
Definition: JHead.hh:906
double JAANET::getVolume ( const JType< JEvtWeightGSeaGen > &  type,
const Evt evt 
)
inline

Get volume of given event according given weighter.

Parameters
typetype
evtevent
Returns
volume [m^3 Gev sr]

Definition at line 328 of file JEvtWeightToolkit.hh.

329  {
333  }
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]=w3 (see e.g. Tag list or km3net-dataformat/definitions) ...
Definition: Evt.hh:42
static const int W2LIST_GSEAGEN_WATER_INT_LEN
Interaction length in pure water in m.
static const int W2LIST_GSEAGEN_P_EARTH
Transmission probability in the Earth (XSEC_MEAN and COLUMN_DEPTH used to compute PEarth) ...
static const int WEIGHTLIST_DIFFERENTIAL_EVENT_RATE
Event rate per unit of flux (c.f. taglist document) [GeV m2 sr].
Definition: weightlist.hh:14
std::vector< double > w2list
MC: factors that make up w[1]=w2 (see e.g. Tag list or km3net-dataformat/definitions) ...
Definition: Evt.hh:43
double JAANET::getVolume ( const JType< JEvtWeightKM3BUU > &  type,
const Evt evt 
)
inline

Get volume of given event according given weighter.

Parameters
typetype
evtevent
Returns
volume [m^3 Gev sr]

Definition at line 343 of file JEvtWeightToolkit.hh.

344  {
348  }
static const int W2LIST_KM3BUU_WATER_INT_LEN
Interaction length in pure water in m.
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]=w3 (see e.g. Tag list or km3net-dataformat/definitions) ...
Definition: Evt.hh:42
static const int W2LIST_KM3BUU_P_EARTH
Transmission probability in the Earth.
static const int WEIGHTLIST_DIFFERENTIAL_EVENT_RATE
Event rate per unit of flux (c.f. taglist document) [GeV m2 sr].
Definition: weightlist.hh:14
std::vector< double > w2list
MC: factors that make up w[1]=w2 (see e.g. Tag list or km3net-dataformat/definitions) ...
Definition: Evt.hh:43
double JAANET::getVolume ( const JType< JEvtWeightGenhen > &  type,
const Evt evt 
)
inline

Get volume of given event according given weighter.

Parameters
typetype
evtevent
Returns
volume [m^3 Gev sr]

Definition at line 358 of file JEvtWeightToolkit.hh.

359  {
360  using namespace JPHYSICS;
361 
362  const double l_int = 1.0e-6 * NUCLEON_MOLAR_MASS / (evt.w2list[W2LIST_GENHEN_SIG] * DENSITY_SEA_WATER * AVOGADRO);
363  const double year = 60*60*24*365; // [s]
364 
366  l_int /
367  year /
369  }
static const int W2LIST_GENHEN_P_EARTH
Transmission probability in the Earth.
static const double AVOGADRO
Avogadro&#39;s number.
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]=w3 (see e.g. Tag list or km3net-dataformat/definitions) ...
Definition: Evt.hh:42
static const double DENSITY_SEA_WATER
Fixed environment values.
static const double NUCLEON_MOLAR_MASS
nucleon molar mass [g/mol]
static const int WEIGHTLIST_DIFFERENTIAL_EVENT_RATE
Event rate per unit of flux (c.f. taglist document) [GeV m2 sr].
Definition: weightlist.hh:14
static const int W2LIST_GENHEN_SIG
Cross section of the neutrion interaction.
std::vector< double > w2list
MC: factors that make up w[1]=w2 (see e.g. Tag list or km3net-dataformat/definitions) ...
Definition: Evt.hh:43
double JAANET::getVolume ( const JEvtWeight weighter,
const Evt evt 
)
inline

Get volume of given event according given weighter.

The return value should be normalised to

  • number of generated events;
  • solid angle covered by the generation; and
  • bin width of the histogram.
Parameters
weighterweighter
evtevent
Returns
volume [m^3 GeV sr]

Definition at line 384 of file JEvtWeightToolkit.hh.

385  {
386  if (dynamic_cast<const JEvtWeightGSeaGen*>(&weighter) != NULL) { return getVolume(JType<JEvtWeightGSeaGen>(), evt); }
387  if (dynamic_cast<const JEvtWeightGenhen*> (&weighter) != NULL) { return getVolume(JType<JEvtWeightGenhen> (), evt); }
388  if (dynamic_cast<const JEvtWeightKM3BUU*> (&weighter) != NULL) { return getVolume(JType<JEvtWeightKM3BUU> (), evt); }
389 
390  THROW(JCastException, "No valid weighter.");
391  }
double getVolume(const JType< JEvtWeightGSeaGen > &type, const Evt &evt)
Get volume of given event according given weighter.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
JEvtWeightFactorFunction<JFlatFlux, JFlux> JAANET::make_flatFluxFunction ( const double  flux)
inline

Auxiliary method for creating an interface to a flat flux function.

Parameters
fluxflux [GeV * m^-2 * sr^-1 * s^-1]

Definition at line 107 of file JFlatFlux.hh.

107  {
108 
109  const JFlatFlux flatFlux(flux);
110 
111  return make_fluxFunction(flatFlux);
112  }
JEvtWeightFactorFunction< JFunction_t, JFlux > make_fluxFunction(const JFunction_t &flux)
Auxiliary method for creating an interface to a flux function.
Neutrino flux.
Definition: JHead.hh:906
Function object for constant fluxes.
Definition: JFlatFlux.hh:22
void JAANET::copy ( const Head from,
JHead &  to 
)

Copy header from from to to.

Parameters
fromheader
toheader

Definition at line 162 of file JHead.cc.

163  {
164  using namespace std;
165  using namespace JPP;
166 
167  JRootReader reader(null, JHead::getEquationParameters(), JAAnetDictionary::getInstance());
168 
169  JRootReadableClass cls(to);
170 
171  for (Head::const_iterator i = from.begin(); i != from.end(); ++i) {
172 
173  const JRootReadableClass& abc = cls.find(getTag(i->first).c_str());
174 
175  const string buffer = trim(i->second);
176 
177  if (abc.is_valid() && buffer != "") {
178 
179  JRedirectString redirect(reader, buffer);
180 
181  reader.getObject(abc);
182 
183  if (i->first == getTag(i->first)) {
184  to.insert(*i); // keep track of parsed tags
185  }
186 
187  } else {
188 
189  to.insert(*i); // store data of unknown tags
190  }
191  }
192  }
const char * c_str() const
C-string.
Definition: JTag.hh:201
std::string trim(const std::string &buffer)
Trim string.
Definition: JLangToolkit.hh:79
JNET::JTag getTag(JLANG::JType< KM3NETDAQ::JDAQTimeslice >)
Definition: JDAQTags.hh:94
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
void JAANET::copy ( const JHead &  from,
Head to 
)

Copy header from from to to.

Parameters
fromheader
toheader

Definition at line 201 of file JHead.cc.

202  {
203  using namespace std;
204  using namespace JPP;
205 
206  to = Head();
207 
208  JHeadWriter writer(to, JHead::getEquationParameters(), JAAnetDictionary::getInstance());
209 
210  JRootWritableClass cls(from);
211 
212  unique_ptr<TIterator> i(cls.getClass()->GetListOfDataMembers()->MakeIterator());
213 
214  for (const TDataMember* p; (p = (const TDataMember*) i->Next()) != NULL; ) {
215  if (!JRootClass::is_static(*p)) {
216  if (from.find(p->GetName()) != from.end() ||
217  cls.get(*p) == JRootClass(&JHead::start_run) ||
218  cls.get(*p) == JRootClass(&JHead::end_event)) {
219  writer.put(p->GetName(), cls.get(*p), true);
220  }
221  }
222  }
223 
224  // copy pending data
225 
226  for (JHead::const_iterator i = from.begin(); i != from.end(); ++i) {
227  if (to.find(i->first) == to.end()) {
228  to.insert(*i);
229  }
230  }
231  }
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Definition: Head.hh:64
std::string JAANET::getTag ( const std::string &  tag)
inline

Get tag without aanet extension "_<counter>" for identical tags.

Parameters
tagtag
Returns
tag

Definition at line 94 of file JHead.hh.

95  {
96  using namespace std;
97 
98  const string::size_type pos = tag.find(AANET_TAG_SEPARATOR);
99 
100  if (pos != string::npos) {
101 
102  for (string::size_type i = pos + 1; i != tag.size(); ++i) {
103  if (!isdigit(tag[i])) {
104  return tag;
105  }
106  }
107 
108  return tag.substr(0, pos);
109  }
110 
111  return tag;
112  }
static const char AANET_TAG_SEPARATOR
Separator for tag extension of multiple tags in Head (&quot;_&lt;counter&gt;&quot;).
Definition: JHead.hh:65
std::string JAANET::getTag ( const std::string &  tag,
const int  counter 
)
inline

Get tag with aanet extension "_<counter>" for identical tags.

Parameters
tagtag
countercounter
Returns
tag

Definition at line 122 of file JHead.hh.

123  {
124  std::ostringstream os;
125 
126  os << tag << AANET_TAG_SEPARATOR << counter;
127 
128  return os.str();
129  }
static const char AANET_TAG_SEPARATOR
Separator for tag extension of multiple tags in Head (&quot;_&lt;counter&gt;&quot;).
Definition: JHead.hh:65
bool JAANET::operator== ( const Head first,
const Head second 
)
inline

Equal operator.

Note that this operator uses the JHead::match method.

Parameters
firstfirst header
secondsecond header
Returns
true if two headers are equal; else false

Definition at line 1801 of file JHead.hh.

1803  {
1804  return JHead(first).match(JHead(second));
1805  }
Monte Carlo run header.
Definition: JHead.hh:1234
bool match(const JHead &header) const
Test match of headers.
Definition: JHead.hh:1474
bool JAANET::operator< ( const Head first,
const Head second 
)
inline

Less than operator.

Note that this operator uses the JHead::less method.

Parameters
firstfirst header
secondsecond header
Returns
true if first header is less than second header; else false

Definition at line 1817 of file JHead.hh.

1819  {
1820  return JHead(first).less(JHead(second));
1821  }
bool less(const JHead &header) const
Comparison of headers.
Definition: JHead.hh:1486
Monte Carlo run header.
Definition: JHead.hh:1234
bool JAANET::is_genhen ( const JHead &  header)
inline

Check for generator.

Parameters
headerheader
Returns
true if this header is produced by genhen; else false

Definition at line 37 of file JHeadToolkit.hh.

38  {
39  for (const auto& i : header.simul) {
40  if (i.program == APPLICATION_GENHEN) {
41  return true;
42  }
43  }
44 
45  for (const auto& i : header.physics) { // legacy
46  if (i.buffer.find(APPLICATION_GENHEN) != std::string::npos) {
47  return true;
48  }
49  }
50 
51  return false;
52  }
static const char *const APPLICATION_GENHEN
KM3NeT Data Definitions v3.4.0-8-ge14cb17 https://git.km3net.de/common/km3net-dataformat.
Definition: applications.hh:12
bool JAANET::is_gseagen ( const JHead &  header)
inline

Check for generator.

Parameters
headerheader
Returns
true if this header is produced by gSeaGen; else false

Definition at line 61 of file JHeadToolkit.hh.

62  {
63  for (const auto& i : header.simul) {
64  if (i.program == APPLICATION_GSEAGEN) {
65  return true;
66  }
67  }
68 
69  for (const auto& i : header.physics) { // legacy
70  if (i.buffer.find(APPLICATION_GSEAGEN) != std::string::npos) {
71  return true;
72  }
73  }
74 
75  return false;
76  }
static const char *const APPLICATION_GSEAGEN
event generator
Definition: applications.hh:13
bool JAANET::is_mupage ( const JHead &  header)
inline

Check for generator.

Parameters
headerheader
Returns
true if this header is produced by MUPAGE; else false

Definition at line 85 of file JHeadToolkit.hh.

86  {
87  for (const auto& i : header.simul) {
88  if (i.program == APPLICATION_MUPAGE) {
89  return true;
90  }
91  }
92 
93  return false;
94  }
static const char *const APPLICATION_MUPAGE
event generator
Definition: applications.hh:14
bool JAANET::is_corsika ( const JHead &  header)
inline

Check for generator.

Parameters
headerheader
Returns
true if this header is produced by Corsika; else false

Definition at line 103 of file JHeadToolkit.hh.

104  {
105  for (const auto& i : header.simul) {
106  if (i.program == APPLICATION_CORSIKA) {
107  return true;
108  }
109  }
110 
111  return false;
112  }
static const char *const APPLICATION_CORSIKA
event generator
Definition: applications.hh:15
bool JAANET::is_km3buu ( const JHead &  header)
inline

Check for generator.

Parameters
headerheader
Returns
true if this header is produced by km3buu; else false

Definition at line 121 of file JHeadToolkit.hh.

122  {
123  for (const auto& i : header.simul) {
124  if (i.program == APPLICATION_KM3BUU) {
125  return true;
126  }
127  }
128 
129  return false;
130  }
static const char *const APPLICATION_KM3BUU
event generator
Definition: applications.hh:16
bool JAANET::is_km3 ( const JHead &  header)
inline

Check for detector simulation.

Parameters
headerheader
Returns
true if this header is processed with km3; else false

Definition at line 139 of file JHeadToolkit.hh.

140  {
141  for (const auto& i : header.simul) {
142  if (i.program == APPLICATION_KM3) {
143  return true;
144  }
145  }
146 
147  return false;
148  }
static const char *const APPLICATION_KM3
detector simulation
Definition: applications.hh:17
bool JAANET::is_km3sim ( const JHead &  header)
inline

Check for detector simulation.

Parameters
headerheader
Returns
true if this header is processed with KM3Sim; else false

Definition at line 157 of file JHeadToolkit.hh.

158  {
159  for (const auto& i : header.simul) {
160  if (i.program == APPLICATION_KM3SIM) {
161  return true;
162  }
163  }
164 
165  return false;
166  }
static const char *const APPLICATION_KM3SIM
detector simulation
Definition: applications.hh:18
bool JAANET::is_sirene ( const JHead &  header)
inline

Check for detector simulation.

Parameters
headerheader
Returns
true if this header is processed with JSirene; else false

Definition at line 175 of file JHeadToolkit.hh.

176  {
177  for (const auto& i : header.simul) {
178  if (i.program == APPLICATION_JSIRENE) {
179  return true;
180  }
181  }
182 
183  return false;
184  }
static const char *const APPLICATION_JSIRENE
detector simulation
Definition: applications.hh:19
bool JAANET::is_pure_noise ( const JHead &  header)
inline

Check for generator.

Parameters
headerheader
Returns
true if this header is produced by pure noise; else false

Definition at line 193 of file JHeadToolkit.hh.

194  {
195  return header.K40.livetime_s > 0.0;
196  }
bool JAANET::is_daq ( const JHead &  header)
inline

Check for real data.

Parameters
headerheader
Returns
true if this header corresponds to real data; else false

Definition at line 205 of file JHeadToolkit.hh.

206  {
207  return header.DAQ.livetime_s > 0.0;
208  }
Vec JAANET::getOffset ( const JHead &  header)
inline

Get offset.

For consistency with the position of the detector, a pending offset should be added to the positions of generated tracks (i.e. Evt::mc_trks).

The main logic can be summarised as follows.

  1. if JHead::fixedcan is defined, the values correspond to an offset that has already been applied, (0,0,0) is returned;
  2. else if JHead::can is defined, the values correspond to a z-range that has already been applied, (0,0,-zmin) is returned;
  3. else if JHead::coord_origin is defined, the values correspond to an offset that has not yet been applied, (x,y,z) is returned;
  4. else (0,0,0) is returned;
Parameters
headerheader
Returns
position

Definition at line 275 of file JHeadToolkit.hh.

276  {
277  if (header.is_valid(&JHead::fixedcan))
278  return Vec(0.0, 0.0, 0.0);
279  else if (header.is_valid(&JHead::can))
280  return Vec(0.0, 0.0, -header.can.zmin);
281  else if (header.is_valid(&JHead::coord_origin))
282  return header.coord_origin;
283  else
284  return Vec(0.0, 0.0, 0.0);
285  }
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
Vec JAANET::getOrigin ( const JHead &  header)
inline

Get origin.

The origin corresponds to the offset that has already been applied to the positions of generated tracks (i.e. Evt::mc_trks).

The main logic can be summarised as follows.

  1. if JHead::fixedcan is defined, the values correspond to the offset that has already been applied, (x,y,0) is returned;
  2. else if JHead::can is defined, the values correspond to a z-range that has already been applied, (0,0,zmin) is returned;
  3. else if JHead::coord_origin is defined, the values correspond to the offset that has not yet been applied, (0,0,0) is returned;
  4. else (0,0,0) is returned;
Parameters
headerheader
Returns
position

Definition at line 309 of file JHeadToolkit.hh.

310  {
311  if (header.is_valid(&JHead::fixedcan))
312  return Vec(header.fixedcan.xcenter, header.fixedcan.ycenter, 0.0);
313  else if (header.is_valid(&JHead::can))
314  return Vec(0.0, 0.0, header.can.zmin);
315  else if (header.is_valid(&JHead::coord_origin))
316  return Vec(0.0, 0.0, 0.0);
317  else
318  return Vec(0.0, 0.0, 0.0);
319  }
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
JCylinder3D JAANET::getCylinder ( const JHead &  header)
inline

Get cylinder corresponding to the positions of generated tracks (i.e.

Evt::mc_trks).

For consistency with the position of the detector, the pending offset (see method JAANET::getOffset) should be added to the position of cylinder.

Parameters
headerheader
Returns
cylinder

Definition at line 331 of file JHeadToolkit.hh.

332  {
333  using namespace JPP;
334 
335  if (header.is_valid(&JHead::fixedcan)) {
336 
337  return JCylinder3D(JCircle2D(JVector2D(header.fixedcan.xcenter,
338  header.fixedcan.ycenter),
339  header.fixedcan.radius),
340  header.fixedcan.zmin,
341  header.fixedcan.zmax);
342 
343  } else if (header.is_valid(&JHead::can)) {
344 
345  return JCylinder3D(JCircle2D(JVector2D(), header.can.r),
346  header.can.zmin,
347  header.can.zmax);
348  } else {
349 
350  return JCylinder3D();
351  }
352  }
JAANET::can can
Definition: JHead.hh:1598
JAANET::fixedcan fixedcan
Definition: JHead.hh:1599
JLorentzBoost JAANET::getBoostToCOM ( const Evt event)

Get Lorentz boost to the Center of Mass (COM) frame for a given neutrino interaction.

Parameters
eventevent

Definition at line 248 of file JLorentzBoost.hh.

249  {
250  using namespace JPP;
251 
252  if (has_neutrino(event)) {
253 
254  const Trk& nu = get_neutrino(event);
255 
256  const Vec beta = -nu.E / getE0(event) * nu.dir;
257 
258  return Boost(beta.x, beta.y, beta.z);
259 
260  } else {
261  THROW(JValueOutOfRange, "getBoostToCOM(): Given event does not correspond to a neutrino interaction.");
262  }
263  }
double z
Definition: Vec.hh:14
double getE0(const Evt &evt)
Get initial state energy of a neutrino interaction.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
Vec dir
track direction
Definition: Trk.hh:18
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
double E
Energy [GeV] (either MC truth or reconstructed)
Definition: Trk.hh:20
double y
Definition: Vec.hh:14
double x
Definition: Vec.hh:14
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
void JAANET::boostToCOM ( Evt event)

Boost event to the Center of Mass (COM) frame.

Parameters
eventevent

Definition at line 271 of file JLorentzBoost.hh.

272  {
273  const JLorentzBoost boost = getBoostToCOM(event);
274  boost(event);
275  }
JLorentzBoost getBoostToCOM(const Evt &event)
Get Lorentz boost to the Center of Mass (COM) frame for a given neutrino interaction.
Auxiliary class for performing Lorentz boosts.
JEvtWeightFactorFunction<JPowerLawFlux, JFlux> JAANET::make_powerLawFluxFunction ( const double  normalisation,
const double  spectralIndex 
)
inline

Auxiliary method for creating an interface to a power-law flux function.

Parameters
normalisationnormalisation [GeV * m^-2 * sr^-1 * s^-1]
spectralIndexspectral index

Definition at line 128 of file JPowerLawFlux.hh.

129  {
130 
131  const JPowerLawFlux flux(normalisation, spectralIndex);
132 
133  return make_fluxFunction(flux);
134  }
JEvtWeightFactorFunction< JFunction_t, JFlux > make_fluxFunction(const JFunction_t &flux)
Auxiliary method for creating an interface to a flux function.
Neutrino flux.
Definition: JHead.hh:906
Example function object for computing power-law flux.
bool JAANET::select ( const Trk trk,
const Evt evt 
)

Event selection.

Parameters
trktrack
evtevent
Returns
true if selected; else false

Definition at line 16 of file JAAnet/event_selector.cc.

17  {
18  using namespace std;
19  using namespace JPP;
20  /*
21  if (has_muon(evt)) {
22 
23  Trk muon;
24 
25  for (const auto& t1 : evt.mc_trks) {
26  if (is_muon(t1)) {
27  if (t1.E > muon.E) {
28  muon = t1;
29  }
30  }
31  }
32 
33  return (is_muon(muon) && getAngle(getDirection(trk), getDirection(muon)) > 5.0);
34  }
35  */
36  return true;
37  }
bool JAANET::hasW ( const Trk trk,
const int  i 
)
inline

Check availability of value.

Parameters
trktrack
iindex
Returns
true if available; else false

Definition at line 102 of file JAAnet/JEvD.cc.

103  {
104  return (i >= 0 && i < (int) trk.fitinf.size());
105  }
std::vector< double > fitinf
place to store additional fit info, see km3net-dataformat/definitions/fitparameters.csv
Definition: Trk.hh:32
double JAANET::getW ( const Trk trk,
const int  i 
)
inline

Get associated value.

Parameters
trktrack
iindex
Returns
value

Definition at line 115 of file JAAnet/JEvD.cc.

116  {
117  return trk.fitinf.at(i);
118  }
std::vector< double > fitinf
place to store additional fit info, see km3net-dataformat/definitions/fitparameters.csv
Definition: Trk.hh:32
double JAANET::getW ( const Trk trk,
const int  i,
const double  value 
)
inline

Get associated value.

Parameters
trktrack
iindex
valuedefault value
Returns
value

Definition at line 129 of file JAAnet/JEvD.cc.

130  {
131  if (hasW(trk,i))
132  return trk.fitinf.at(i);
133  else
134  return value;
135  }
std::vector< double > fitinf
place to store additional fit info, see km3net-dataformat/definitions/fitparameters.csv
Definition: Trk.hh:32
bool hasW(const Trk &trk, const int i)
Check availability of value.
Definition: JAAnet/JEvD.cc:102
void JAANET::setW ( Trk trk,
const int  i,
const double  value 
)

Set associated value.

Parameters
trktrack
iindex
valuevalue

Definition at line 145 of file JAAnet/JEvD.cc.

146  {
147  if (i >= (int) trk.fitinf.size()) {
148  trk.fitinf.resize(i + 1, 0.0);
149  }
150 
151  trk.fitinf[i] = value;
152  }
std::vector< double > fitinf
place to store additional fit info, see km3net-dataformat/definitions/fitparameters.csv
Definition: Trk.hh:32

Variable Documentation

const int JAANET::AASHOWER_RECONSTRUCTION_TYPE = 101
static

AAnet shower fit reconstruction type.

Definition at line 70 of file JAAnetToolkit.hh.

const JEvtEvaluator JAANET::getEvtValue
static

Function object for evaluation of DAQ objects.

Definition at line 54 of file JEvtEvaluator.hh.

JEvtWeighter JAANET::getEventWeighter

Function object for mapping header to event weighter.

Definition at line 12 of file JEvtWeightToolkit.cc.

const char JAANET::AANET_TAG_SEPARATOR = '_'
static

Separator for tag extension of multiple tags in Head ("_<counter>").

Definition at line 65 of file JHead.hh.

JHeadHelper JAANET::get_is_head
static

Function object to get check method for given application.

Definition at line 250 of file JHeadToolkit.hh.