1 #ifndef __JROOTFILEREADER__
2 #define __JROOTFILEREADER__
24 namespace JPP {
using namespace JROOT; }
42 inline void getObject(TFile* file,
const TString& key, T*& ps)
45 file->GetObject(key, ps);
119 virtual void open(
const char* file_name)
override
123 actionAtFileOpen<T>(this->
getFile());
138 if (cycleOld != cycleNew) {
150 actionAtFileRead<T>(__p);
153 return (cycleOld == cycleNew && __p != NULL);
195 cycleNew += (Short_t)
ns;
197 cycleNew = numeric_limits<Short_t>::max();
199 return cycleNew - cycleOld;
237 virtual void open(
const char* file_name)
override
241 if (this->get() != NULL) {
242 actionAtFileOpen<T>(this->get()->GetCurrentFile());
std::ostream & rewind(std::ostream &out)
Rewind character.
Data type dependent action methods for customised ROOT version management.
Interface for object iteration with named access.
virtual void reset() override
Reset pointer.
Interface for object iteration with rewinding.
virtual bool hasNext() override
Check availability of next element.
JAccessibleObjectIterator< T >::pointer_type pointer_type
JRootFileReader()
Default constructor.
virtual void open(const char *file_name) override
Open file.
virtual const pointer_type & next() override
Get next element.
virtual skip_type skip(const skip_type ns) override
Skip items.
Short_t getCycle() const
Get cycle number of last read object.
virtual void rewind() override
Rewind.
JRootFileReader(const char *file_name, const char *key=getName(JType< T >()))
Constructor.
virtual void open(const char *file_name) override
Open file.
JTemplateTreeReader object iterator.
virtual void open(const char *file_name) override
Open file.
T * open(const std::string &file_name)
Open file.
TFile * getFile(const std::string &file_name, const std::string &option="exist")
Get TFile pointer corresponding to give file name.
unsigned int skip_type
Type definition for number of objects to skip.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for ROOT I/O.
const char * getName()
Get ROOT name of given data type.
void getObject(TFile *file, const TString &key, T *&ps)
Read object from ROOT file.
Auxiliary class for a type holder.