Jpp
Namespaces | Functions | Variables
io_ascii.hh File Reference
#include <string>
#include <istream>
#include <ostream>
#include <sstream>
#include "Evt.hh"
#include "Hit.hh"
#include "Trk.hh"
#include "Head.hh"
#include "Exception.hh"
#include "TDatabasePDG.h"

Go to the source code of this file.

Namespaces

 mc_keys
 
 mc_usr_keys
 
 io_stringutil
 

Functions

bool io_stringutil::startswith (const std::string &a, const std::string &b)
 Check if string starts with given text. More...
 
std::string io_stringutil::trim (const std::string &s)
 Remove leading and trailing white spaces. More...
 
int pdg_code (int geant3_code)
 Convert Geant3 to PDG particle type. More...
 
int geant3_code (int pdg_code)
 Convert PDG to Geant3 particle type. More...
 
bool read (Vec &v, std::istream &is)
 Read a Vec(tor) from a stream. More...
 
bool write (const Vec &v, std::ostream &os)
 Write a Vec(tor) to a stream. More...
 
bool read (Hit &h, std::istream &is, bool read_mc=false)
 Read a hit from a stream. More...
 
bool write (const Hit &h, std::ostream &os, const std::string &tag=mc_keys::hit_t)
 Write a hit to a stream. More...
 
bool read (Trk &t, std::istream &is, const std::string &tag=mc_keys::track_in_t)
 Read track from a stream. More...
 
bool write (const Trk &t, std::ostream &os, std::string tag=mc_keys::track_in_t)
 Write track to a stream. More...
 
std::vector< double > read_line_to_vector (std::istream &is)
 Read data. More...
 
template<typename T >
void push_front (std::vector< T > &vec, T &value)
 Put value in front of data. More...
 
bool read (Evt &evt, std::istream &is, bool skip_hits=false)
 Read event from a stream. More...
 
bool write (const Evt &evt, std::ostream &os)
 Write event to a stream. More...
 
bool read (Head &hdr, std::istream &is)
 Read header from a stream. More...
 
bool write (const Head &hdr, std::ostream &os)
 Write header to a stream. More...
 

Variables

const char *const mc_keys::auto_t = "auto"
 
const char *const mc_keys::start_run_t = "start_run:"
 
const char *const mc_keys::start_event_t = "start_event:"
 
const char *const mc_keys::hit_t = "hit:"
 
const char *const mc_keys::hit_raw_t = "hit_raw:"
 
const char *const mc_keys::track_in_t = "track_in:"
 
const char *const mc_keys::track_t = "track:"
 
const char *const mc_keys::track_fit_t = "track_fit:"
 
const char *const mc_keys::neutrino_t = "neutrino:"
 
const char *const mc_keys::track_primary_t = "track_primary:"
 
const char *const mc_keys::primarylepton_t = "primarylepton:"
 
const char *const mc_keys::weights_t = "weights:"
 
const char *const mc_keys::w2list_t = "w2list:"
 
const char *const mc_keys::w3list_t = "w3list:"
 
const char *const mc_keys::hourangle_t = "hourangle:"
 
const char *const mc_keys::center_on_can_t = "center_on_can:"
 
const char *const mc_keys::muon_decay_t = "muon_decay:"
 
const char *const mc_keys::end_event_t = "end_event:"
 
const char *const mc_usr_keys::energy_lost_in_can = "energy_lost_in_can"
 
const char *const mc_usr_keys::bx = "bx"
 
const char *const mc_usr_keys::by = "by"
 
const char *const mc_usr_keys::ichan = "ichan"
 
const char *const mc_usr_keys::cc = "cc"
 
const char *const mc_usr_keys::muon_decay_x = "muon_decay_x"
 
const char *const mc_usr_keys::muon_decay_y = "muon_decay_y"
 
const char *const mc_usr_keys::muon_decay_z = "muon_decay_z"
 
const char *const mc_usr_keys::center_on_can_x = "center_on_can_x"
 
const char *const mc_usr_keys::center_on_can_y = "center_on_can_y"
 
const char *const mc_usr_keys::center_on_can_z = "center_on_can_z"
 
const char *const mc_usr_keys::hourangle = "hourangle"
 

Function Documentation

◆ pdg_code()

int pdg_code ( int  geant3_code)
inline

Convert Geant3 to PDG particle type.

Parameters
geant3_codeGeant3 code
Returns
PDG code

Definition at line 110 of file io_ascii.hh.

111 {
112  if ( geant3_code==-1 ) return -1; // used for k40 hits
113  if ( geant3_code < 0 ) return pdg_code( -geant3_code ); // used for scattered
114 
115  return TDatabasePDG::Instance()->ConvertGeant3ToPdg( geant3_code );
116 }

◆ geant3_code()

int geant3_code ( int  pdg_code)
inline

Convert PDG to Geant3 particle type.

Parameters
pdg_codePDG code
Returns
Geant3 code

Definition at line 124 of file io_ascii.hh.

125 {
126  if (pdg_code == -1 ) return -1;
127  if (pdg_code == +311 ) return geant3_code( 130 ); // K0 -> K0long
128  if (pdg_code == -311 ) return geant3_code( 130 ); // K0bar -> K0long
129 
130  return TDatabasePDG::Instance()->ConvertPdgToGeant3( pdg_code );
131 }

◆ read() [1/5]

bool read ( Vec v,
std::istream &  is 
)
inline

Read a Vec(tor) from a stream.

Parameters
vvector
isinput stream
Returns
true if correctly read; else false

Definition at line 141 of file io_ascii.hh.

142 {
143  is >> v.x >> v.y >> v.z;
144  return !is.fail();
145 }

◆ write() [1/5]

bool write ( const Vec v,
std::ostream &  os 
)
inline

Write a Vec(tor) to a stream.

Parameters
vvector
osoutput stream
Returns
true if correctly written; else false

Definition at line 154 of file io_ascii.hh.

155 {
156  os << v.x << ' ' << v.y << ' ' << v.z;
157  return !os.fail();
158 }

◆ read() [2/5]

bool read ( Hit h,
std::istream &  is,
bool  read_mc = false 
)
inline

Read a hit from a stream.

Parameters
hhit
isinput stream
read_mcoption to read also type and origin
Returns
true if correctly read; else false

Definition at line 168 of file io_ascii.hh.

169 {
170  h.dom_id = 0; // need a proper det file to
171  h.channel_id = 0; // set these.
172 
173  is >> h.id >> h.pmt_id >> h.a >> h.t;
174  if ( !read_mc )
175  {
176  return !is.fail();
177  }
178  else
179  {
180  is >> h.type >> h.origin;
181  }
182 
183  // If we get here without failing, we will return true, but
184  // will attempt to read also pure_a and pure_t which may
185  // or may not be present, depending on the km3 version.
186 
187  bool r = !is.fail();
188  is >> h.pure_a >> h.pure_t;
189  if (is.fail())
190  {
191  h.pure_a = h.pure_t =0 ;
192  is.clear();
193  }
194  return r;
195 }

◆ write() [2/5]

bool write ( const Hit h,
std::ostream &  os,
const std::string &  tag = mc_keys::hit_t 
)
inline

Write a hit to a stream.

Parameters
hhit
osoutput stream
tagtag
Returns
true if correctly written; else false

Definition at line 206 of file io_ascii.hh.

207 {
208  int om_id = h.pmt_id; // todo: deal with this better.
209 
210  os << tag << ' ' << h.id << ' ' << om_id << ' ' << h.a << ' ' << h.t;
211  if ( tag != mc_keys::hit_raw_t ) {
212  os << ' ' << h.type << ' ' << h.origin << ' ' << h.pure_a << ' ' << h.pure_t;
213  }
214  os << std::endl;
215  return !os.fail();
216 }

◆ read() [3/5]

bool read ( Trk t,
std::istream &  is,
const std::string &  tag = mc_keys::track_in_t 
)
inline

Read track from a stream.

Parameters
ttrack
isinput stream
tagtag
Returns
true if correctly read; else false

Definition at line 227 of file io_ascii.hh.

228 {
229  using namespace std;
230 
231  string line;
232  getline( is, line );
233  istringstream ii(line);
234 
235  ii >> t.id >> t.pos >> t.dir >> t.E >> t.t;
236 
237  if (!ii) return false;
238 
239  t.len = 0.0;
240  t.clearusr();
241  t.comment = tag;
242 
243  if ( tag == mc_keys::track_in_t)
244  {
245  ii >> t.type; if (!ii) return false;
246  t.type = pdg_code( t.type );
247  ii >> t.len;
248  if (!ii) return true; // missing length is not an error
249 
250  double eloss=0;
251  ii >> eloss;
252  if (!ii) return true; // missing eloss is not an error
253 
254  //dbg(eloss);
256  }
257 
258  if (tag == mc_keys::primarylepton_t)
259  {
260  ii >> t.type; if (!ii) return false;
261  t.type = pdg_code( t.type ); // treat the same as track_in
262  }
263 
264 
265  if ( tag == mc_keys::neutrino_t )
266  {
267  double bx,by;
268  int cc, ichan;
269  ii >> bx >> by >> ichan >> t.type >> cc;
270 
271  t.clearusr();
276  }
277 
278  if ( tag == mc_keys::track_primary_t )
279  {
280  ii >> t.type; // nucleus id (in pdg format or not?)
281  }
282 
283  if ( ii.fail() )
284  {
285  ostream& out = Exception::getOstream();
286 
287  out << "Error reading trk ";
288 
289  t.print(out);
290 
291  throw Exception(static_cast<ostringstream&>(out).str());
292  }
293 
294  return !ii.fail();
295 }

◆ write() [3/5]

bool write ( const Trk t,
std::ostream &  os,
std::string  tag = mc_keys::track_in_t 
)
inline

Write track to a stream.

Parameters
ttrack
osoutput stream
tagtag
Returns
true if correctly read; else false

Definition at line 305 of file io_ascii.hh.

306 {
307  using namespace std;
308 
309  int type = t.type;
310 
311  if ( tag == mc_keys::auto_t )
312  {
313  tag = t.comment;
314  }
315 
316  os << tag << ' ' << t.id <<' '<< t.pos <<' '<< t.dir <<' '<< t.E << ' ' << t.t;
317 
318  if ( tag == mc_keys::track_in_t)
319  {
320  os << ' ' << geant3_code(type) << ' ' << t.len;
321 
323  {
324  os << ' ' << t.getusr( mc_usr_keys::energy_lost_in_can );
325  }
326  os << endl;
327  }
328 
329  else if (tag == mc_keys::track_primary_t)
330  {
331  os << ' ' << t.type << endl;
332  }
333 
334  else if (tag == mc_keys::primarylepton_t)
335  {
336  os << ' ' << geant3_code(type) << endl;
337  }
338 
339  else if ( tag == mc_keys::neutrino_t )
340  {
341  os << ' ' << t.getusr(mc_usr_keys::bx)
342  << ' ' << t.getusr(mc_usr_keys::by)
343  << ' ' << t.getusr(mc_usr_keys::ichan)
344  << ' ' << t.type
345  << ' ' << t.getusr(mc_usr_keys::cc)
346  << endl;
347  }
348 
349  else
350  os << endl;
351 
352  return !os.fail();
353 }

◆ read_line_to_vector()

std::vector<double> read_line_to_vector ( std::istream &  is)
inline

Read data.

Parameters
isinput stream
Returns
data

Definition at line 362 of file io_ascii.hh.

363 {
364  using namespace std;
365 
367 
368  string ss;
369  getline(is,ss);
370  istringstream il(ss);
371  for ( double x; il >> x ; ) r.push_back( x );
372 
373  return r;
374 }

◆ push_front()

template<typename T >
void push_front ( std::vector< T > &  vec,
T &  value 
)
inline

Put value in front of data.

Parameters
vecdata
valuevalue

Definition at line 384 of file io_ascii.hh.

385 {
386  vec.insert( vec.begin(), value );
387 }

◆ read() [4/5]

bool read ( Evt evt,
std::istream &  is,
bool  skip_hits = false 
)
inline

Read event from a stream.

Parameters
evtevent
isinput stream
skip_hitsoption to skip reading of hits
Returns
true if correctly read; else false

Definition at line 398 of file io_ascii.hh.

399 {
400  using namespace std;
401 
402  string w;
403 
404  // find next start_event
405 
406  while ( w != mc_keys::start_event_t && is.good() ) is >> w;
407 
408  int mc_event_type; // dummy - this is always 1 in all files.
409  is >> evt.mc_id >> mc_event_type;
410 
411  Trk trk_nu, trk_primary, trk_primary_lepton;
412  bool have_trk_nu(false), have_trk_primary(false), have_trk_primary_lepton(false);
413 
414 
415  evt.mc_trks.clear();
416  evt.hits.clear();
417  evt.mc_hits.clear();
418 
419  string w_old;
420 
421  while ( is )
422  {
423  static Hit h;
424  static Trk t;
425 
426  is >> w;
427 
428  if (skip_hits && ( w == mc_keys::hit_t || w == mc_keys::hit_raw_t) )
429  {
430  is.ignore( 1000, '\n' );
431  continue;
432  }
433 
434  if ( w == mc_keys::hit_t )
435  {
436  read( h, is, true );
437  evt.mc_hits.push_back( h );
438  }
439  else if ( w == mc_keys::hit_raw_t )
440  {
441  read( h, is, false);
442  evt.hits.push_back( h );
443  }
444  else if ( w == mc_keys::track_in_t )
445  {
446  read( t, is , w);
447  evt.mc_trks.push_back( t );
448  }
449  else if ( w == mc_keys::track_t )
450  {
451  read( t, is );
452  evt.trks.push_back( t );
453  }
454  else if ( w == mc_keys::neutrino_t)
455  {
456  read( trk_nu ,is, w);
457  have_trk_nu = true;
458  }
459  else if ( w == mc_keys::track_primary_t)
460  {
461  read( trk_primary, is, w);
462  have_trk_primary = true;
463  }
464  else if ( w == mc_keys::primarylepton_t)
465  {
466  read( trk_primary_lepton, is, w);
467  have_trk_primary_lepton = true;
468  }
469  else if ( w == mc_keys::weights_t)
470  {
471  evt.w = read_line_to_vector( is );
472  }
473  else if ( w == mc_keys::w2list_t)
474  {
475  evt.w2list = read_line_to_vector( is );
476  }
477  else if ( w == mc_keys::w3list_t)
478  {
479  evt.w3list = read_line_to_vector( is );
480  }
481  else if ( w == mc_keys::hourangle_t )
482  {
483  double ha;
484  is >> ha;
485  evt.setusr(mc_usr_keys::hourangle, ha );
486  }
487 
488 
489  else if ( w == mc_keys::center_on_can_t)
490  {
491  // in corsika files, there is the (undocumented?) center_on_can tag,
492  // which denoets the projection of the primary on the can. The direction
493  // of the center_on_can 'track' is by defintion the direction of the
494  // primary. We record the position in the usr data.
495 
497  if ( v.size() > 3 )
498  {
502  }
503  }
504 
505  else if ( w == mc_keys::muon_decay_t)
506  {
507  // in km3sim files, there are additional tags, including this one
509  if ( v.size() > 3 )
510  {
514  }
515  }
516 
517 
518  else if ( w == mc_keys::end_event_t)
519  {
520  // finalize
521 
522  Trk none;
523 
524  if ( have_trk_primary_lepton )
525  {
526  Trk* p_primlep = 0 ;
527 
528  double min_edif = 1e100;
529  for( auto& t: evt.mc_trks )
530  {
531  if ( t.type != trk_primary_lepton.type ) continue;
532 
533  // since we are reading ascii, we cannot demand an exact match
534  // in the floating point... so take the one that best matches
535  double edif = fabs( (t.E / trk_primary_lepton.E) -1 );
536  if (edif < min_edif )
537  {
538  min_edif = edif;
539  p_primlep = &t;
540  }
541  }
542 
543  if ( p_primlep ) p_primlep -> comment =mc_keys:: primarylepton_t;
544  }
545 
546 
547  // If there is both a primary, and a neutrino, then the primary
548  // will go second (mc_trks[1]) and the neutrino will be mc_trks[0].
549  // The primarylepton tag is not stored as a seperate Trk.
550 
551  if ( have_trk_primary )
552  {
553  trk_primary.id = 0;
554  push_front( evt.mc_trks, trk_primary);
555  }
556 
557  if ( have_trk_nu )
558  {
559  trk_nu.id = 0;
560  push_front( evt.mc_trks, trk_nu);
561  }
562 
563 
564  return true;
565  }
566  else
567  {
568  //cout << "unknown tag " << w << endl;
569  //cout << "previous = " << w_old << endl;
570  is.ignore( 1000, '\n' );
571  }
572  w_old = w;
573  }
574 
575  if (!is.eof())
576  {
577  THROW(Exception, "Error while reading ascii event" << w << ' ' << evt.id);
578  }
579 
580  //else cout << "eof"<< endl;
581  return false;
582 }

◆ write() [4/5]

bool write ( const Evt evt,
std::ostream &  os 
)
inline

Write event to a stream.

Parameters
evtevent
osoutput stream
Returns
true if correctly read; else false

Definition at line 592 of file io_ascii.hh.

593 {
594  using namespace std;
595 
596  os << mc_keys::start_event_t << ' ' << evt.mc_id << ' ' << 1 << endl;
597 
598  for( auto& trk: evt.mc_trks ) write ( trk, os, mc_keys::auto_t );
599  for( auto& trk: evt.trks ) write ( trk, os, mc_keys::track_fit_t );
600  for( auto& hit: evt.mc_hits ) write ( hit, os, mc_keys::hit_t);
601  for( auto& hit: evt.hits ) write ( hit, os, mc_keys::hit_raw_t);
602 
603  os << mc_keys::weights_t; for (auto& w: evt.w ) os << ' ' << w; os << endl;
604  os << mc_keys::w2list_t; for (auto& w: evt.w2list ) os << ' ' << w; os << endl;
605  os << mc_keys::w3list_t; for (auto& w: evt.w3list ) os << ' ' << w; os << endl;
606  os << mc_keys::end_event_t << endl;
607 
608  return true;
609 }

◆ read() [5/5]

bool read ( Head hdr,
std::istream &  is 
)
inline

Read header from a stream.

The stream may be positioned at any point before the tag mc_keys::start_run_t, which marks the beginning of the header. Information before the header (if any) is disgarded.

Parameters
hdrheader
isinput stream
Returns
true if correctly read; else false

Definition at line 624 of file io_ascii.hh.

625 {
626  using namespace std;
627 
628  string line;
629 
630  bool start = false;
631 
632  while (getline( is, line ))
633  {
635  {
636  break;
637  }
638 
640  {
641  start = true;
642  }
643 
645  {
646  // this should not happen:
647  THROW(Exception, "Unexpected tag " << mc_keys::start_event_t << " found while reading header at " << line << " (could mean the evt file has no header)");
648  }
649 
650  if (!start) continue;
651 
652  vector<string> v = splitstring( line, ':' );
653  if (v.size() < 2 )
654  {
655  THROW(Exception, "Invalid line found when reading header at " << line);
656  continue;
657  }
658 
659  // make sure key is unique
660  string key = v[0];
661  for (int i=1; hdr.find(key) != hdr.end() ; i++)
662  {
663  key = v[0]+"_"+to_string(i);
664  }
665 
666  hdr[key] = io_stringutil::trim(v[1]);
667  }
668 
669  if (!start)
670  {
671  THROW(Exception, "Reading of MC header terminated before finding a start_run: tag. Please check your file");
672  }
673 
674  return start;
675 }

◆ write() [5/5]

bool write ( const Head hdr,
std::ostream &  os 
)
inline

Write header to a stream.

Parameters
hdrheader
osoutput stream
Returns
true if correctly written; else false

Definition at line 685 of file io_ascii.hh.

686 {
687  hdr.print(os);
688  return true;
689 }
Evt::hits
std::vector< Hit > hits
list of hits
Definition: Evt.hh:35
mc_keys::track_primary_t
const char *const track_primary_t
Definition: io_ascii.hh:28
mc_keys::end_event_t
const char *const end_event_t
Definition: io_ascii.hh:36
AAObject::clearusr
void clearusr()
Clear user data.
Definition: AAObject.hh:139
Hit
Definition: Hit.hh:7
Hit::pure_t
double pure_t
photon time before pmt simultion (MC only)
Definition: Hit.hh:26
mc_keys::track_t
const char *const track_t
Definition: io_ascii.hh:25
mc_usr_keys::muon_decay_y
const char *const muon_decay_y
Definition: io_ascii.hh:50
Hit::origin
int origin
track id of the track that created this hit
Definition: Hit.hh:29
Evt::mc_trks
std::vector< Trk > mc_trks
MC: list of MC truth tracks
Definition: Evt.hh:45
read_line_to_vector
std::vector< double > read_line_to_vector(std::istream &is)
Read data.
Definition: io_ascii.hh:362
JTOOLS::w
data_type w[N+1][M+1]
Definition: JPolint.hh:708
mc_usr_keys::bx
const char *const bx
Definition: io_ascii.hh:43
mc_keys::track_fit_t
const char *const track_fit_t
Definition: io_ascii.hh:26
mc_usr_keys::energy_lost_in_can
const char *const energy_lost_in_can
Definition: io_ascii.hh:42
io_stringutil::startswith
bool startswith(const std::string &a, const std::string &b)
Check if string starts with given text.
Definition: io_ascii.hh:69
Hit::pmt_id
int pmt_id
global PMT identifier as found in evt files
Definition: Hit.hh:18
mc_keys::start_event_t
const char *const start_event_t
Definition: io_ascii.hh:21
mc_keys::weights_t
const char *const weights_t
Definition: io_ascii.hh:30
mc_usr_keys::center_on_can_y
const char *const center_on_can_y
Definition: io_ascii.hh:54
Trk::E
double E
Energy (either MC truth or reconstructed)
Definition: Trk.hh:18
std::vector< double >
Trk
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:12
mc_usr_keys::muon_decay_x
const char *const muon_decay_x
Definition: io_ascii.hh:49
Trk::comment
std::string comment
use as you like
Definition: Trk.hh:32
Trk::t
double t
track time (when the particle is at pos )
Definition: Trk.hh:17
write
bool write(const Vec &v, std::ostream &os)
Write a Vec(tor) to a stream.
Definition: io_ascii.hh:154
mc_keys::neutrino_t
const char *const neutrino_t
Definition: io_ascii.hh:27
mc_keys::w3list_t
const char *const w3list_t
Definition: io_ascii.hh:32
mc_keys::muon_decay_t
const char *const muon_decay_t
Definition: io_ascii.hh:35
Trk::dir
Vec dir
track direction
Definition: Trk.hh:16
Evt::mc_id
int mc_id
identifier of the MC event (as found in ascii or antcc file).
Definition: Evt.hh:23
Hit::a
double a
hit amplitude (in p.e.)
Definition: Hit.hh:22
push_front
void push_front(std::vector< T > &vec, T &value)
Put value in front of data.
Definition: io_ascii.hh:384
Trk::len
double len
length, if applicable
Definition: Trk.hh:20
Hit::t
double t
hit time (from calibration or MC truth)
Definition: Hit.hh:21
mc_keys::start_run_t
const char *const start_run_t
Definition: io_ascii.hh:20
mc_usr_keys::by
const char *const by
Definition: io_ascii.hh:44
mc_keys::auto_t
const char *const auto_t
Definition: io_ascii.hh:19
splitstring
std::vector< std::string > splitstring(const std::string &str, char delim=' ')
Split string into separate tokens.
Definition: Head.hh:23
Hit::id
int id
Definition: Hit.hh:9
Hit::dom_id
int dom_id
module identifier from the data (unique in the detector).
Definition: Hit.hh:12
AAObject::setusr
void setusr(const std::string &key, double value)
Set user data item with given key.
Definition: AAObject.hh:95
AAObject::haveusr
bool haveusr(const std::string &key) const
Check availability of user data of the item with given key.
Definition: AAObject.hh:42
Hit::pure_a
double pure_a
amptitude before pmt simution (MC only)
Definition: Hit.hh:27
mc_usr_keys::center_on_can_x
const char *const center_on_can_x
Definition: io_ascii.hh:53
THROW
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
mc_keys::hourangle_t
const char *const hourangle_t
Definition: io_ascii.hh:33
Exception::getOstream
static std::ostream & getOstream()
Get output stream for conversion of exception.
Definition: Exception.hh:63
Exception
General exception.
Definition: Exception.hh:13
Head::print
void print(std::ostream &out=std::cout) const
Print header.
Definition: Head.hh:192
Trk::type
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:22
mc_usr_keys::cc
const char *const cc
Definition: io_ascii.hh:46
mc_usr_keys::hourangle
const char *const hourangle
Definition: io_ascii.hh:56
Trk::print
void print(std::ostream &out) const
Print track.
Definition: Trk.hh:172
read
bool read(Vec &v, std::istream &is)
Read a Vec(tor) from a stream.
Definition: io_ascii.hh:141
JLANG::to_string
std::string to_string(const T &value)
Convert value to string.
Definition: JLangToolkit.hh:192
Trk::pos
Vec pos
postion of the track at time t
Definition: Trk.hh:15
AAObject::getusr
double getusr(const std::string &key) const
Get user data item with given key.
Definition: AAObject.hh:72
JTOOLS::v
data_type v[N+1][M+1]
Definition: JPolint.hh:707
mc_keys::primarylepton_t
const char *const primarylepton_t
Definition: io_ascii.hh:29
Trk::id
int id
track identifier
Definition: Trk.hh:14
mc_usr_keys::ichan
const char *const ichan
Definition: io_ascii.hh:45
std
Definition: jaanetDictionary.h:36
io_stringutil::trim
std::string trim(const std::string &s)
Remove leading and trailing white spaces.
Definition: io_ascii.hh:81
mc_keys::hit_t
const char *const hit_t
Definition: io_ascii.hh:22
mc_keys::center_on_can_t
const char *const center_on_can_t
Definition: io_ascii.hh:34
Evt::id
int id
offline event identifier
Definition: Evt.hh:21
JTOOLS::r
data_type r[M+1]
Definition: JPolint.hh:709
pdg_code
int pdg_code(int geant3_code)
Convert Geant3 to PDG particle type.
Definition: io_ascii.hh:110
Evt::trks
std::vector< Trk > trks
list of reconstructed tracks (can be several because of prefits,showers, etc).
Definition: Evt.hh:36
Evt::mc_hits
std::vector< Hit > mc_hits
MC: list of MC truth hits.
Definition: Evt.hh:44
geant3_code
int geant3_code(int pdg_code)
Convert PDG to Geant3 particle type.
Definition: io_ascii.hh:124
mc_usr_keys::center_on_can_z
const char *const center_on_can_z
Definition: io_ascii.hh:55
Evt::w
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]]=w3 (see e.g. Tag list)
Definition: Evt.hh:39
JLANG::getline
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:468
Hit::channel_id
unsigned int channel_id
PMT channel id {0,1, .., 31} local to moduke.
Definition: Hit.hh:13
mc_keys::hit_raw_t
const char *const hit_raw_t
Definition: io_ascii.hh:23
Hit::type
int type
particle type or parametrisation used for hit (mc only)
Definition: Hit.hh:28
mc_usr_keys::muon_decay_z
const char *const muon_decay_z
Definition: io_ascii.hh:51
Evt::w2list
std::vector< double > w2list
MC: factors that make up w[1]=w2 (see e.g. Tag list)
Definition: Evt.hh:40
mc_keys::track_in_t
const char *const track_in_t
Definition: io_ascii.hh:24
Evt::w3list
std::vector< double > w3list
MC: atmospheric flux information.
Definition: Evt.hh:41
mc_keys::w2list_t
const char *const w2list_t
Definition: io_ascii.hh:31