4 #include "KVFzDataReader.h"
6 #include <google/protobuf/io/coded_stream.h>
7 #include "FzEventSet.pb.h"
8 #include "KVDataSetRepository.h"
10 #include "KVAvailableRunsFile.h"
23 DAQ::FzEventSet fFzEvSet;
28 bool KVFzDataReader::parse_event_from_message()
30 google::protobuf::io::CodedInputStream codedIStream((
const uint8_t*)(fBuffer + fEvOffset), fEvSize);
31 if (!fFzEvSet.ParseFromCodedStream(&codedIStream)) {
32 KVError::Error(
this,
"parse_event_from_message",
"problem parsing event set");
35 if (fFzEvSet.ev_size() > 1) {
36 KVError::Error(
this,
"parse_event_from_message",
"FzEventSet with %d events", fFzEvSet.ev_size());
47 bool KVFzDataReader::read_buffer()
51 if (fReachedEndOfFile) {
52 TObject* o = fFileListIterator->operator()();
58 return KVProtobufDataReader::read_buffer();
75 fFullFilePath = filepath;
88 std::map<int, std::string> filelist;
89 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
90 fFileListIterator.reset(
new TIter(&fListOfFiles));
93 fFileListIterator =
new TIter(fListOfFiles);
96 while ((
b = (
KVBase*)fFileListIterator->operator()())) {
99 for (
int i = 0; i < 2; ++i) bb.
Next();
100 filelist[bb.
Next().
Atoi()] =
b->GetName();
102 fListOfFiles.
Clear();
103 for (std::map<int, std::string>::iterator mapit = filelist.begin(); mapit != filelist.end(); ++mapit) {
104 fListOfFiles.
Add(
new KVBase((*mapit).second.c_str()));
107 fFileListIterator->Reset();
109 KVString url = fFullFilePath + fFileListIterator->operator()()->
GetName();
119 return fFzEvSet.ev(0);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
R__EXTERN TSystem * gSystem
std::optional< run_index_t > IsRunFileName(const Char_t *filename)
Base class for KaliVeda framework.
KVBase()
Default constructor.
A repository for experimental datasets.
KVAvailableRunsFile * GetAvailableRunsFile(const TString &type) const
Handle FAZIA protobuf-format raw data files.
const DAQ::FzEvent & get_fazia_event() const
static KVFzDataReader * Open(const Char_t *filename, Option_t *opt="")
Read Google Protobuf DAQ files.
void Clear(Option_t *option="") override
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
void Add(TObject *obj) override
void ls(Option_t *option="") const override
const char * GetName() const override
virtual const char * GetName() const
virtual const char * BaseName(const char *pathname)
void Error(UserClass p, const char *location, const char *va_(fmt),...)