Jpp
io_ascii.hh
Go to the documentation of this file.
1 #ifndef IO_ASCII_INCLUDED
2 #define IO_ASCII_INCLUDED
3 
4 #include <string>
5 #include <istream>
6 #include <ostream>
7 #include <sstream>
8 
9 #include "Evt.hh"
10 #include "Hit.hh"
11 #include "Trk.hh"
12 #include "Head.hh"
13 #include "Exception.hh"
14 
15 #include "TDatabasePDG.h"
16 
17 namespace mc_keys
18 {
19  const char* const auto_t = "auto";
20  const char* const start_run_t = "start_run:";
21  const char* const start_event_t = "start_event:";
22  const char* const hit_t = "hit:";
23  const char* const hit_raw_t = "hit_raw:";
24  const char* const track_in_t = "track_in:";
25  const char* const track_t = "track:";
26  const char* const track_fit_t = "track_fit:";
27  const char* const neutrino_t = "neutrino:";
28  const char* const track_primary_t = "track_primary:";
29  const char* const primarylepton_t = "primarylepton:";
30  const char* const weights_t = "weights:";
31  const char* const w2list_t = "w2list:";
32  const char* const w3list_t = "w3list:";
33  const char* const hourangle_t = "hourangle:";
34  const char* const center_on_can_t = "center_on_can:";
35  const char* const muon_decay_t = "muon_decay:";
36  const char* const end_event_t = "end_event:";
37 }
38 
39 namespace mc_usr_keys
40 {
41  // track-level quantities
42  const char* const energy_lost_in_can = "energy_lost_in_can";
43  const char* const bx = "bx"; // these follow naming from
44  const char* const by = "by"; // 'updated tag list' document.
45  const char* const ichan = "ichan";
46  const char* const cc = "cc";
47 
48  // event-level corsika variables
49  const char* const muon_decay_x = "muon_decay_x";
50  const char* const muon_decay_y = "muon_decay_y";
51  const char* const muon_decay_z = "muon_decay_z";
52 
53  const char* const center_on_can_x = "center_on_can_x";
54  const char* const center_on_can_y = "center_on_can_y";
55  const char* const center_on_can_z = "center_on_can_z";
56  const char* const hourangle = "hourangle";
57 }
58 
59 
60 namespace io_stringutil
61 {
62  /**
63  * Check if string starts with given text.
64  *
65  * \param a input string
66  * \param b text
67  * \return true if string start with text; else false
68  */
69  inline bool startswith( const std::string& a, const std::string& b )
70  {
71  if ( a.find( b ) == 0 ) return true;
72  return false;
73  }
74 
75  /**
76  * Remove leading and trailing white spaces.
77  *
78  * \param s input string
79  * \return trimmed string
80  */
81  inline std::string trim(const std::string& s)
82  {
83  using namespace std;
84 
85  if ( s=="" ) return s;
86 
87  string::size_type i1;
88  string::size_type i2;
89 
90  for (i1=0; i1< s.length(); i1++)
91  {
92  if ( !isspace (s[i1]) ) break;
93  }
94  for (i2 = s.length()-1 ; i2 >i1 ; i2--)
95  {
96  if ( !isspace (s[i2]) ) break;
97  }
98  return s.substr( i1, i2-i1+1 );
99  }
100 
101 }
102 
103 
104 /**
105  * Convert Geant3 to PDG particle type.
106  *
107  * \param geant3_code Geant3 code
108  * \return PDG code
109  */
110 inline int pdg_code( int geant3_code )
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 }
117 
118 /**
119  * Convert PDG to Geant3 particle type.
120  *
121  * \param pdg_code PDG code
122  * \return Geant3 code
123  */
124 inline int geant3_code( int pdg_code )
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 }
132 
133 
134 /**
135  * Read a Vec(tor) from a stream.
136  *
137  * \param v vector
138  * \param is input stream
139  * \return true if correctly read; else false
140  */
141 inline bool read ( Vec& v, std::istream& is)
142 {
143  is >> v.x >> v.y >> v.z;
144  return !is.fail();
145 }
146 
147 /**
148  * Write a Vec(tor) to a stream.
149  *
150  * \param v vector
151  * \param os output stream
152  * \return true if correctly written; else false
153  */
154 inline bool write( const Vec& v, std::ostream& os)
155 {
156  os << v.x << ' ' << v.y << ' ' << v.z;
157  return !os.fail();
158 }
159 
160 /**
161  * Read a hit from a stream.
162  *
163  * \param h hit
164  * \param is input stream
165  * \param read_mc option to read also type and origin
166  * \return true if correctly read; else false
167  */
168 inline bool read ( Hit& h, std::istream& is, bool read_mc = false )
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 }
196 
197 
198 /**
199  * Write a hit to a stream.
200  *
201  * \param h hit
202  * \param os output stream
203  * \param tag tag
204  * \return true if correctly written; else false
205  */
206 inline bool write( const Hit& h, std::ostream& os, const std::string& tag = mc_keys::hit_t)
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 }
217 
218 
219 /**
220  * Read track from a stream.
221  *
222  * \param t track
223  * \param is input stream
224  * \param tag tag
225  * \return true if correctly read; else false
226  */
227 inline bool read ( Trk& t, std::istream& is , const std::string& tag = mc_keys::track_in_t)
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 }
296 
297 /**
298  * Write track to a stream.
299  *
300  * \param t track
301  * \param os output stream
302  * \param tag tag
303  * \return true if correctly read; else false
304  */
305 inline bool write( const Trk& t, std::ostream& os, std::string tag = mc_keys::track_in_t)
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 }
354 
355 
356 /**
357  * Read data.
358  *
359  * \param is input stream
360  * \return data
361  */
362 inline std::vector<double> read_line_to_vector( std::istream& is )
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 }
375 
376 
377 /**
378  * Put value in front of data.
379  *
380  * \param vec data
381  * \param value value
382  */
383 template<typename T>
384 inline void push_front( std::vector<T>& vec, T& value )
385 {
386  vec.insert( vec.begin(), value );
387 }
388 
389 
390 /**
391  * Read event from a stream.
392  *
393  * \param evt event
394  * \param is input stream
395  * \param skip_hits option to skip reading of hits
396  * \return true if correctly read; else false
397  */
398 inline bool read ( Evt& evt, std::istream& is, bool skip_hits = false )
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 }
583 
584 
585 /**
586  * Write event to a stream.
587  *
588  * \param evt event
589  * \param os output stream
590  * \return true if correctly read; else false
591  */
592 inline bool write( const Evt& evt, std::ostream& os)
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 }
610 
611 
612 
613 /**
614  * Read header from a stream.
615  *
616  * The stream may be positioned at any point before the tag mc_keys::start_run_t,
617  * which marks the beginning of the header.
618  * Information before the header (if any) is disgarded.
619  *
620  * \param hdr header
621  * \param is input stream
622  * \return true if correctly read; else false
623  */
624 inline bool read( Head& hdr, std::istream& is )
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 }
676 
677 
678 /**
679  * Write header to a stream.
680  *
681  * \param hdr header
682  * \param os output stream
683  * \return true if correctly written; else false
684  */
685 inline bool write( const Head& hdr, std::ostream& os )
686 {
687  hdr.print(os);
688  return true;
689 }
690 
691 #endif
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
Head.hh
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
Exception.hh
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
Definition: io_ascii.hh:60
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
Evt
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:19
Evt.hh
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
Hit.hh
mc_usr_keys::by
const char *const by
Definition: io_ascii.hh:44
Trk.hh
mc_usr_keys
Definition: io_ascii.hh:39
mc_keys
Definition: io_ascii.hh:17
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
Head
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Definition: Head.hh:39
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
Vec
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
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