27#include "HILDataVersion.h"
78 std::cout << R
"(Failed to open ")" << GetFilename() << "/" <<
Filename() << R
"("!)" << std::endl;
97 }
catch(std::exception& e) {
98 std::cout <<
"Caught " << e.what() <<
" at " << __FILE__ <<
" : " << __LINE__ << std::endl;
131 if(Event ==
nullptr)
return -1;
133 size_t LastReadSize = 0;
134 std::shared_ptr<TRlmdEvent> RlmdEvent = std::static_pointer_cast<TRlmdEvent>(Event);
143 LastReadSize +=
static_cast<size_t>(
fInputStream.gcount());
152 LastReadSize +=
static_cast<size_t>(
fInputStream.gcount());
157 }
catch(std::exception& e) {
158 std::cout <<
"Caught " << e.what() <<
" at " << __FILE__ <<
" : " << __LINE__ << std::endl;
189 std::cerr <<
"Sorry, but we can't skip events in an RLMD file, the whole file is treated as a single event!" << std::endl;
200 std::size_t found =
Filename().rfind(
".rlmd");
201 if(found == std::string::npos) {
205 temp =
Filename().substr(found - 3, 3);
206 return atoi(temp.c_str());
217 std::stringstream str;
220 str >> std::get_time(&t,
"%d-%b-%Y %H:%M:S");
221 return std::mktime(&t);
static void SetMnemonicClass(const TClassRef &cls)
std::vector< char > & ReadBuffer()
virtual const char * GetFilename() const
Get the name of this file.
virtual size_t FileSize()
virtual std::string Filename() const
Get the name of this file.
void IncrementBytesRead(size_t val=1)
virtual size_t BytesRead()
void ResizeBuffer(size_t newSize)
RlmdBufferHeader fBufferHeader
std::ifstream fInputStream
int GetSubRunNumber() override
void Close() override
Close input file.
int Read(std::shared_ptr< TRawEvent > rlmdEvent) override
Read one event from the file.
~TRlmdFile() override
destructor
std::string Status(bool long_file_description=true) override
time_t ConvertToEpoch(const std::string &date, const std::string &time)
TRlmdFile()=default
default constructor
int GetRunNumber() override
void Skip(size_t nofEvents) override
Skip nofEvents from the file.
bool Open(const char *filename) override
Open input file.
static void ClearVersion()
static void SetRunStart(double tmp)
static void SetRunStop(double tmp)
static void SetRunInfo(int runnum=0, int subrunnum=-1)
static void SetVersion(const char *ver)
static void SetDetectorInformation(TDetectorInformation *inf)
static void SetRunLength()