Read event from a stream.
265 is >> evt.
mc_id >> mc_event_type;
267 Trk trk_nu, trk_primary;
268 bool have_trk_nu(
false), have_trk_primary(
false);
285 is.ignore( 1000,
'\n' );
297 evt.
hits.push_back( h );
312 istringstream ii(line);
358 evt.
trks.push_back( t );
381 ii >> t.
t >> trk_primary.type;
384 have_trk_primary =
true;
396 out <<
"Unknown tag " << w <<
" for trk ";
398 throw Exception(static_cast<ostringstream&>(out).str());
404 out <<
"Error reading trk ";
406 throw Exception(static_cast<ostringstream&>(out).str());
438 if ( v.size() > 3 ) {
446 unsigned nsec, n16ns_ticks;
447 is >> nsec >> n16ns_ticks;
472 if ( have_trk_primary && have_trk_nu ) {
474 bool same = trk_nu.pos == trk_primary.pos &&
475 trk_nu.dir == trk_primary.dir &&
476 trk_nu.E == trk_primary.E;
486 }
else if ( have_trk_primary ) {
491 }
else if ( have_trk_nu ) {
500 is.ignore( 1000,
'\n' );
void setusr(const std::string &key, double value)
Set user data item with given key.
const char *const energy_lost_in_can
static const int W2LIST_GSEAGEN_BX
Bjorken x.
const char *const w2list_t
const char *const center_on_can_y
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
const char *const weights_t
const char *const muon_decay_x
double t
track time [ns] (when the particle is at pos )
int pdg_code(int geant3_code)
Convert Geant3 to PDG particle type.
const char *const neutrino_t
const char *const center_on_can_z
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
std::string comment
use as you like
const char *const w3list_t
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]=w3 (see e.g. Tag list or km3net-dataformat/definitions) ...
const char *const muon_decay_t
const char *const muon_decay_y
double E
Energy [GeV] (either MC truth or reconstructed)
void clearusr()
Clear user data.
const char *const hourangle
const char *const eventtime_t
static const int PDG_MUONBUNDLE
muon bundle reached the can level (mupage)
static const int W2LIST_GSEAGEN_ICHAN
Interaction channel.
int mc_id
identifier of the MC event (as found in ascii or antcc file).
TTimeStamp mc_event_time
MC: true generation time (UTC) of the event, (default: 01 Jan 1970 00:00:00)
const char *const hourangle_t
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
double len
length, if applicable [m]
static const int TRK_ST_PRIMARYNEUTRINO
initial state neutrino ('neutrino' tag in evt files from gseagen and genhen).
static const int TRK_ST_MUONBUNDLE
initial state muon bundle (mupage)
static const int TRK_ST_PRIMARYCOSMIC
initial state cosmic ray ('track_primary' tag in evt files from corant).
const char *const track_bundle_t
int type
MC: particle type in PDG encoding.
int status
MC status code, see km3net-dataformat/definitions/trkmembers.csv for values.
const char *const center_on_can_t
static const int W2LIST_GSEAGEN_CC
Charged current interaction flag.
static const int W2LIST_GSEAGEN_BY
Bjorken y.
static const int TRK_ST_FINALSTATE
for MC: the particle must be processed by detector simulation ('track_in' tag in evt files)...
const char *const center_on_can_x
Vec pos
postion [m] of the track at time t
const char *const track_in_t
const char *const track_t
std::vector< Trk > trks
list of reconstructed tracks (can be several because of prefits,showers, etc).
std::vector< Hit > mc_hits
MC: list of MC truth hits.
const char *const muon_decay_z
void copy(const Head &from, JHead &to)
Copy header from from to to.
void push_front(std::vector< T > &vec, const T &value)
Put value in front of data.
int id
offline event identifier
void print(std::ostream &out=std::cout) const
Print track.
const char *const track_primary_t
const char *const end_event_t
std::vector< double > read_line_to_vector(std::istream &is)
Read data.
std::vector< Hit > hits
list of hits
static std::ostream & getOstream()
Get output stream for conversion of exception.
const char *const hit_raw_t
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
const char *const start_event_t
std::vector< double > w2list
MC: factors that make up w[1]=w2 (see e.g. Tag list or km3net-dataformat/definitions) ...
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
std::vector< double > w3list
MC: atmospheric flux information.