Jpp  17.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Functions
JMonteCarloFileSupportkit.hh File Reference
#include "km3net-dataformat/offline/Head.hh"
#include "km3net-dataformat/offline/MultiHead.hh"
#include "km3net-dataformat/offline/Evt.hh"
#include "km3net-dataformat/offline/io_ascii.hh"
#include "JLang/JASCIIFileReader.hh"
#include "JLang/JGZFileReader.hh"
#include "JLang/JStreamObjectOutput.hh"
#include "JLang/JAbstractObjectIterator.hh"
#include "JLang/JObjectOutput.hh"
#include "JLang/JException.hh"
#include "JAAnet/JHead.hh"
#include "JAAnet/JHeadToolkit.hh"
#include "JSupport/JMonteCarloFileReader.hh"
#include "JSupport/JMonteCarloFileWriter.hh"
#include "JSupport/JMultipleFileScanner.hh"

Go to the source code of this file.

Classes

class  JSUPPORT::JMonteCarloFileReader< T, JFileReader_t >
 Template definition of Monte Carlo object reader. More...
 
class  JSUPPORT::JMonteCarloFileReader< Head, JFileReader_t >
 Template specialisation of JMonteCarloFileReader for Head. More...
 
class  JSUPPORT::JMonteCarloFileReader< Evt, JFileReader_t >
 Template specialisation of JMonteCarloFileReader for Event. More...
 
class  JSUPPORT::JMonteCarloASCIIFileReader< Head >
 Template implementation of Monte Carlo object reader for ASCII formatted file (i.e. '.evt') More...
 
class  JSUPPORT::JMonteCarloASCIIFileReader< Evt >
 Template implementation of Monte Carlo object reader for ASCII formatted file (i.e. '.evt') More...
 
class  JSUPPORT::JMonteCarloGZFileReader< Head >
 Template implementation of Monte Carlo object reader for gzipped ASCII formatted file (i.e. '.gz') More...
 
class  JSUPPORT::JMonteCarloGZFileReader< Evt >
 Template implementation of Monte Carlo object reader for gzipped ASCII formatted file (i.e. '.gz') More...
 
class  JSUPPORT::JMonteCarloStreamObjectOutput< Head >
 Template specialisation of JMonteCarloStreamObjectOutput for Head. More...
 
class  JSUPPORT::JMonteCarloStreamObjectOutput< Evt >
 Template specialisation of JMonteCarloStreamObjectOutput for Evt. More...
 
class  JSUPPORT::JMultipleFileScanner< Head >
 Template specialisation of JMultipleFileScanner for Monte Carlo header. More...
 

Namespaces

 JSUPPORT
 Support classes and methods for experiment specific I/O.
 
 JPP
 This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 

Functions

std::istream & operator>> (std::istream &in, Head &header)
 Read header from input. More...
 
std::ostream & operator<< (std::ostream &out, const MultiHead &header)
 Write multi-header to output. More...
 
std::istream & operator>> (std::istream &in, Evt &evt)
 Read event from input. More...
 
std::ostream & operator<< (std::ostream &out, const Evt &evt)
 Write event to output. More...
 
std::istream & operator>> (std::istream &in, Hit &hit)
 Read hit from input. More...
 
std::ostream & operator<< (std::ostream &out, const Hit &hit)
 Write hit to output. More...
 
Head JSUPPORT::getHeader (const JMultipleFileScanner_t &file_list)
 Get Monte Carlo header. More...
 
template<class JFunction_t >
JMultipleFileScanner_t JSUPPORT::getAAnetFiles (const JMultipleFileScanner_t &input, JFunction_t test)
 Get list of files compatible with geven header. More...
 

Function Documentation

std::istream& operator>> ( std::istream &  in,
Head header 
)
inline

Read header from input.

Author
mdejong
Parameters
ininput stream
headerheader
Returns
input stream

Definition at line 36 of file JMonteCarloFileSupportkit.hh.

37 {
38  header.clear();
39 
40  read(header, in);
41 
42  return in;
43 }
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
std::ostream& operator<< ( std::ostream &  out,
const MultiHead header 
)
inline

Write multi-header to output.

Parameters
outoutput stream
headerheader
Returns
output stream

Definition at line 73 of file JMonteCarloFileSupportkit.hh.

74 {
75  for (MultiHead::const_iterator i = header.begin(); i != header.end(); ++i) {
76  write(*i, out);
77  }
78 
79  return out;
80 }
bool write(const Vec &v, std::ostream &os)
Write a Vec(tor) to a stream.
Definition: io_ascii.hh:155
std::istream& operator>> ( std::istream &  in,
Evt evt 
)
inline

Read event from input.

Parameters
ininput stream
evtevent
Returns
input stream

Definition at line 90 of file JMonteCarloFileSupportkit.hh.

91 {
92  evt = Evt();
93 
94  read(evt, in, false);
95 
96  return in;
97 }
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:20
std::ostream& operator<< ( std::ostream &  out,
const Evt evt 
)
inline

Write event to output.

Parameters
outoutput stream
evtevent
Returns
output stream

Definition at line 108 of file JMonteCarloFileSupportkit.hh.

109 {
110  using namespace std;
111 
112  const ios_base::fmtflags flags = out.flags();
113 
114  write(evt, out << fixed);
115 
116  out.flags(flags);
117 
118  return out;
119 }
bool write(const Vec &v, std::ostream &os)
Write a Vec(tor) to a stream.
Definition: io_ascii.hh:155
std::istream& operator>> ( std::istream &  in,
Hit hit 
)
inline

Read hit from input.

Parameters
ininput stream
hithit
Returns
input stream

Definition at line 129 of file JMonteCarloFileSupportkit.hh.

130 {
131  hit = Hit();
132 
133  read(hit, in, false);
134 
135  return in;
136 }
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
Definition: Hit.hh:8
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
std::ostream& operator<< ( std::ostream &  out,
const Hit hit 
)
inline

Write hit to output.

Parameters
outoutput stream
hithit
Returns
output stream

Definition at line 147 of file JMonteCarloFileSupportkit.hh.

148 {
149  using namespace std;
150 
151  const ios_base::fmtflags flags = out.flags();
152 
153  write(hit, out << fixed);
154 
155  out.flags(flags);
156 
157  return out;
158 }
bool write(const Vec &v, std::ostream &os)
Write a Vec(tor) to a stream.
Definition: io_ascii.hh:155