18 #include <TIterator.h>
20 #include <TObjString.h>
23 #include <TSystemDirectory.h>
24 #include <TSystemFile.h>
31 , fFileNames(new TList())
32 , fxInputChannel(nullptr)
35 , fxEventData(nullptr)
37 , fxInfoHeader(nullptr)
42 , fCurrentFile(source.GetCurrentFile())
45 , fFileNames(new TList())
46 , fxInputChannel(nullptr)
49 , fxEventData(nullptr)
51 , fxInfoHeader(nullptr)
63 if (1 == gSystem->GetPathInfo(fileName.Data(), buf)) {
64 LOG(warn) <<
"FairLmdSource: not found: " << fileName;
68 TObjString* str =
new TObjString(fileName);
75 if (1 == gSystem->GetPathInfo(dir.Data(), buf)) {
76 LOG(warn) <<
"FairLmdSource: not found: " << dir;
80 TRegexp* re =
new TRegexp(wildCard.Data(), kTRUE);
81 TSystemDirectory* sdir =
new TSystemDirectory(
"dir", dir.Data());
83 if (!dname.EndsWith(
"/")) {
86 TList* list = sdir->GetListOfFiles();
88 TIterator* iter = list->MakeIterator();
91 while (
nullptr != (file = static_cast<TSystemFile*>(iter->Next()))) {
92 name = file->GetName();
93 if (name.Contains(*re)) {
128 LOG(info) <<
"File " << fileName <<
" will be opened.";
131 inputMode, const_cast<char*>(fileName.Data()),
fxInputChannel, static_cast<Char_t**>(headptr), 1, 1);
134 LOG(error) <<
"File " << fileName <<
" opening failed.";
138 LOG(info) <<
"File " << fileName <<
" opened.";
158 LOG(info) <<
"FairMbsStreamSource::ReadEvent()";
160 CHARS* sErrorString =
nullptr;
185 Bool_t result = kFALSE;
196 LOG(debug2) <<
"FairLmdSource::ReadEvent => Found " << nrSubEvts <<
" Sub-event ";
202 for (Int_t i = 1; i <= nrSubEvts; i++) {
207 fxEvent, i, static_cast<Int_t**>(SubEvtptr), static_cast<Int_t**>(EvtDataptr), &nrlongwords);
211 sebuflength = nrlongwords;
220 if (
Unpack(
fxEventData, sebuflength, setype, sesubtype, seprocid, sesubcrate, secontrol)) {
INTS4 f_evt_get_subevent(s_ve10_1 *ps_ve10_1, INTS4 l_subevent, INTS4 **pl_se, INTS4 **pl_d, INTS4 *pl_lwords)
INTS4 f_evt_get_close(s_evt_channel *ps_chan)
INTS4 f_evt_get_open(INTS4 l_mode, CHARS *pc_server, s_evt_channel *ps_chan, CHARS **ps_info, INTS4 l_sample, INTS4 l_param)
Bool_t Unpack(Int_t *data, Int_t size, Short_t type, Short_t subType, Short_t procId, Short_t subCrate, Short_t control)
INTS4 f_evt_error(INTS4 l_error, CHARS *pc_dest, INTS4 l_out)
ClassImp(FairEventBuilder)
void AddFile(TString fileName)
Bool_t OpenNextFile(TString fileName)
virtual Int_t ReadEvent(UInt_t=0)
void AddPath(TString dir, TString wildCard)
INTS4 f_evt_get_event(s_evt_channel *ps_chan, INTS4 **ppl_buffer, INTS4 **ppl_goobuf)
s_evt_channel * fxInputChannel