Go to the documentation of this file. 1 #ifndef __JSUPPORT__JAANETSUPPORTKIT__
2 #define __JSUPPORT__JAANETSUPPORTKIT__
106 read(hit, in,
false);
145 template<
class T,
template<
class>
class JFileReader_t>
155 template<
template<
class>
class JFileReader_t>
157 public JFileReader_t<Head>
164 JFileReader_t<
Head>(),
174 virtual void open(
const char* file_name)
193 return JFileReader_t<Head>::hasNext();
212 template<
template<
class>
class JFileReader_t>
214 public JFileReader_t<Evt>
222 virtual void open(
const char* file_name)
228 if (this->is_open()) {
232 static_cast<istream&>(*
this) >> buffer;
350 static_cast<JMultipleFileScanner_t&>(*
this) = file_list;
373 using namespace JLANG;
379 unsigned int count = 0;
383 for (const_iterator i = this->begin(); i != this->end(); ++i) {
385 scanner.
open(i->c_str());
393 else if (header.
match(buffer))
396 THROW(
JException,
"JMultipleFileScanner<Head>::setObject(): inconsistent headers.");
404 copy(header,
object);
406 if (count != 0 && count != this->size()) {
408 THROW(
JException,
"JMultipleFileScanner<Head>::setObject(): missing header(s): " << count <<
" != " << this->size());
428 const Head* p = NULL;
430 if (!this->hasNext() || (p = this->next()) == NULL) {
476 const bool option =
false)
482 for (JMultipleFileScanner_t::const_iterator i = input.begin(); i != input.end(); ++i) {
488 catch(std::exception&) {}
bool match(const JHead &header, const bool option=true) const
Test match of headers.
const Head & getHeader()
Get Monte Carlo Header.
Object reading from file.
JMultipleFileScanner()
Default constructor.
Auxiliary base class for list of file names.
std::ostream & rewind(std::ostream &out)
Rewind character.
Abstract object iterator with rewinding.
std::istream & operator>>(std::istream &in, Head &header)
Read header from input.
Exception for null pointer operation.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
virtual bool hasNext()=0
Check availability of next element.
JMonteCarloFileReader()
Default constructor.
bool write(const Vec &v, std::ostream &os)
Write a Vec(tor) to a stream.
void copy(const Head &from, JHead &to)
Copy header from from to to.
virtual void open(const char *file_name)
Open file.
JMonteCarloStreamObjectOutput(std::ostream &out)
Constructor.
virtual bool hasNext()
Check availability of next element.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Template implementation of stream output for single data type.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
virtual void open(const char *file_name)
Open file.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
std::ostream & operator<<(std::ostream &out, const Evt &evt)
Template specialisation of JMultipleFileScanner for Monte Carlo header.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Template definition of Monte Carlo object reader.
T * open(const std::string &file_name)
Open file.
Template definition of Monte Carlo object reader for gzipped ASCII formatted file (i....
bool read(Vec &v, std::istream &is)
Read a Vec(tor) from a stream.
JHead & add(const JHead &header)
Addition of headers.
JMultipleFileScanner(const JMultipleFileScanner_t &file_list)
Copy constructor.
JMonteCarloStreamObjectOutput(std::ostream &out)
Constructor.
Template definition of Monte Carlo stream output for single data type.
virtual void open(const char *file_name)
Open file.
General purpose class for object reading from a list of file names.
static bool merge
Allow merging of files w/o header.
Support classes and methods for experiment specific I/O.
virtual void close()=0
Close device.
Object reading from gzipped file.
virtual void rewind()
Rewind.
Auxiliary classes and methods for language specific functionality.
virtual bool setObject(Head &object)
Set object.
Template definition of Monte Carlo object reader for ASCII formatted file (i.e.
virtual const pointer_type & next()=0
Get next element.
Object reading from ASCII file.
JMultipleFileScanner_t getAAnetFiles(const JMultipleFileScanner_t &input, const JHead &header, const bool option=false)
Get list of files compatible with geven header.