27#include "HILDataVersion.h"
108 }
catch(std::exception& e) {
109 std::cout<<
"Caught "<<e.what()<<
" at "<<__FILE__<<
" : "<<__LINE__<<std::endl;
142 if(Event ==
nullptr)
return -1;
144 size_t LastReadSize = 0;
145 std::shared_ptr<TRlmdEvent> RlmdEvent = std::static_pointer_cast<TRlmdEvent>(Event);
154 LastReadSize +=
static_cast<size_t>(
fInputStream.gcount());
163 LastReadSize +=
static_cast<size_t>(
fInputStream.gcount());
168 }
catch(std::exception& e) {
169 std::cout<<
"Caught "<<e.what()<<
" at "<<__FILE__<<
" : "<<__LINE__<<std::endl;
200 std::cerr<<
"Sorry, but we can't skip events in an RLMD file, the whole file is treated as a single event!"<<std::endl;
211 std::size_t found =
fFilename.rfind(
".rlmd");
212 if(found == std::string::npos) {
217 return atoi(temp.c_str());
228 std::stringstream str;
231 str>>std::get_time(&t,
"%d-%b-%Y %H:%M:S");
232 return std::mktime(&t);
ClassImp(THILMnemonic) void THILMnemonic
static void SetMnemonicClass(const TClassRef &cls)
virtual const char * GetFilename() const
Get the name of this file.
std::vector< char > fReadBuffer
std::string fFilename
name of the currently open file
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()
default constructor
~TRlmdFile() override
destructor
std::string Status(bool long_file_description=true) override
time_t ConvertToEpoch(const std::string &date, const std::string &time)
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()