1 #ifndef __JSUPPORT__JAANETSUPPORTKIT__
2 #define __JSUPPORT__JAANETSUPPORTKIT__
106 read(hit, in,
false);
128 namespace JSUPPORT {}
129 namespace JPP {
using namespace JSUPPORT; }
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;
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());
387 if (scanner.hasNext()) {
389 const JHead buffer = *scanner.next();
393 else if (header.match(buffer))
396 THROW(
JException,
"JMultipleFileScanner<Head>::setObject(): inconsistent headers.");
404 copy(header,
object);
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&) {}
JMultipleFileScanner(const JMultipleFileScanner_t &file_list)
Copy constructor.
std::ostream & rewind(std::ostream &out)
Rewind character.
Object reading from ASCII file.
virtual void open(const char *file_name)
Open file.
JMultipleFileScanner_t getAAnetFiles(const JMultipleFileScanner_t &input, const JHead &header, const bool option=false)
Get list of files compatible with geven header.
virtual void open(const char *file_name)
Open file.
bool read(Vec &v, std::istream &is)
Read a Vec(tor) from a stream.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
virtual void rewind()
Rewind.
JMonteCarloFileReader()
Default constructor.
JMonteCarloStreamObjectOutput(std::ostream &out)
Constructor.
JHead & add(const JHead &header)
Addition of headers.
Template definition of Monte Carlo object reader for gzipped ASCII formatted file (i...
static bool merge
Allow merging of files w/o header.
T * open(const std::string &file_name)
Open file.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
Template definition of Monte Carlo object reader for ASCII formatted file (i.e. '.evt')
virtual void open(const char *file_name)
Open file.
JMonteCarloStreamObjectOutput(std::ostream &out)
Constructor.
Exception for null pointer operation.
virtual bool setObject(Head &object)
Set object.
const Head & getHeader()
Get Monte Carlo Header.
JMultipleFileScanner()
Default constructor.
Template specialisation of JMultipleFileScanner for Monte Carlo header.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Template definition of Monte Carlo object reader.
Auxiliary base class for list of file names.
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input.
General purpose class for object reading from a list of file names.
bool write(const Vec &v, std::ostream &os)
Write a Vec(tor) to a stream.
Object reading from gzipped file.
Template implementation of stream output for single data type.
virtual bool hasNext()
Check availability of next element.
void copy(const Head &from, JHead &to)
Copy header from from to to.
Object reading from file.
Abstract object iterator with rewinding.
bool match(const JHead &header, const bool option=true) const
Test match of headers.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Template definition of Monte Carlo stream output for single data type.