24 #include "TObjString.h"
26 #include "TDataMember.h"
43 ThrowError(66,0, Form(
"!!! ERROR: Cannot open source %s!!!", GetName()));
53 ThrowError(66,0, Form(
"!!! ERROR: Cannot open source %s!!!", GetName()));
75 if ((mask==0) || (strlen(mask)==0))
return 0;
77 TString dirname, basename(mask);
79 if (!basename.MaybeWildcard()) {
85 TList* lst =
new TList();
87 lst->Add(
new TObjString(basename));
91 Bool_t withdir = kFALSE;
92 Int_t slash = basename.Last(
'/');
95 if (slash<0) slash = basename.Last(
'\\');
99 dirname = basename(0, slash);
100 basename.Remove(0, slash+1);
103 dirname = gSystem->WorkingDirectory();
106 void *dir = gSystem->OpenDirectory(gSystem->ExpandPathName(dirname.Data()));
108 if (dir==0)
return 0;
112 TRegexp re(basename, kTRUE);
113 const char* file = 0;
114 while ((file = gSystem->GetDirEntry(dir)) != 0) {
115 if (!strcmp(file,
".") || !strcmp(file,
".."))
continue;
117 if ( (basename!=s) && s.Index(re) == kNPOS)
continue;
120 lst->SetOwner(kTRUE);
123 lst->Add(
new TObjString(dirname +
"/" + file));
125 lst->Add(
new TObjString(file));
127 gSystem->FreeDirectory(dir);
129 if (lst) lst->Sort();
158 catch(H5::Exception& ex)
160 TString
msg= TString::Format(
"Close File %s with HDF5 exception in %s : %s\n",
fxCurrentFileName.Data(), ex. getCFuncName (), ex.getCDetailMsg ());
170 TString buffer(fname);
176 fxFile =
new H5::H5File(buffer.Data(), H5F_ACC_RDONLY);
177 TGo4Log::Info(
"TGo4HDF5Source %s: Open file %s for reading", GetName(), buffer.Data());
179 catch(H5::Exception& ex)
181 TString
msg= TString::Format(
"OpenFile with HDF5 exception in %s : %s\n", ex. getCFuncName (), ex.getCDetailMsg ());
196 if (event==0 ||
fxFile==0)
return;
205 catch(H5::Exception& ex)
207 TString
msg= TString::Format(
"BuildDataSet with HDF5 exception in %s : %s\n", ex.getCFuncName (), ex.getCDetailMsg ());
228 if(dest==0)
ThrowError(0,22,
"!!! ERROR BuildEvent: no destination event!!!");
237 printf(
"TGo4HDF5Source: fxEvent=0x%lx\n", (
unsigned long)
fxEvent);
238 printf(
"TGo4HDF5Source: Eventname:%s\n", fxEvent->GetName());
239 printf(
"TGo4HDF5Source: is valid:%d\n", fxEvent->IsValid());
240 printf(
"Go4 event has eventsource pointer 0x%lx \n",(
long) fxEvent->GetEventSource());
241 printf(
"TGo4HDF5Source: Event printout:\n");
242 fxEvent->PrintEvent();
250 printf(
"Go4 event has eventsource pointer 0x%lx \n",(
long) fxEvent->GetEventSource());
251 printf(
"Go4 event has identifier 0x%lx \n",(
long) fxEvent->getId());
256 catch(H5::Exception& ex)
258 TString
msg= TString::Format(
"BuildEvent() with HDF5 exception in %s : %s\n", ex.getCFuncName (), ex.getCDetailMsg ());
virtual void BuildReadDataset(H5::H5File *file, TGo4HDF5Source *parent)
static const char * fgcFILESUF
TString fxCurrentFileName
void BuildDataType(TGo4EventElement *event, TGo4HDF5DataHandle *parent=0, Int_t index=0)
void ThrowError(Int_t creastat, Int_t errstat, const char *message,...)
Bool_t CloseCurrentFile()
void SetErrMess(const char *txt)
virtual void Read(hsize_t sequencenum, H5::H5File *file)
virtual void DeleteDataSet()
TGo4EventElement * fxEvent
virtual Bool_t BuildEvent(TGo4EventElement *dest)
virtual void DeleteDataSet()
virtual ~TGo4HDF5Source()
static TList * ProducesFilesList(const char *mask)
virtual void OpenFile(const char *fname)
virtual void BuildDataSet(TGo4EventElement *event)
static void Error(const char *text,...)
static void Info(const char *text,...)
TGo4HDF5DataHandle * fxHandle