24#include "TObjString.h"
47 GO4TRACE((15,
"TGo4MbsFile::TGo4MbsFile()",__LINE__, __FILE__));
59 GO4TRACE((15,
"TGo4MbsFile::TGo4MbsFile(const char *)",__LINE__, __FILE__));
78 GO4TRACE((15,
"TGo4MbsFile::TGo4MbsFile(TGo4MbsFileParameter*)",__LINE__, __FILE__));
95 GO4TRACE((15,
"TGo4MbsFile::~TGo4MbsFile()",__LINE__, __FILE__));
103 if (!name || !*name)
return;
107 bool read_multi =
false;
116 }
else if(fname.Contains(
"*") || fname.Contains(
"?")) {
122 SetErrMess(TString::Format(
"No lmd file with mask %s", GetName()).Data());
129 lst->SetOwner(kFALSE);
134 }
else if (!isonly) {
150 std::ifstream ff(fname.Data());
153 SetErrMess(TString::Format(
"Error opening multiple file:%s", fname.Data()).Data());
174 SetName(
"LmdFilesSelection");
184 GO4TRACE((12,
"TGo4MbsFile::NextEvent()",__LINE__, __FILE__));
254 GO4TRACE((12,
"TGo4MbsFile::Close()",__LINE__, __FILE__));
268 GO4TRACE((12,
"TGo4MbsFile::Open()",__LINE__, __FILE__));
305 const char *command =
nullptr;
306 const char *rem1 =
nullptr;
307 const char *rem2 =
nullptr;
320 nextline = obj->GetName();
327 rem1 = strstr(nextline.Data(),
"!");
328 rem2 = strstr(nextline.Data(),
"#");
329 command = strstr(nextline.Data(),
"@");
330 if(command && !(rem1 && rem1 < command) && !(rem2 && rem2 < command)) {
336 gROOT->ProcessLineSync(command);
338 }
while(nextline.IsNull() || rem1 || rem2 || command);
339 convs = sscanf(nextline.Data(),
"%s %s %lu %lu %lu",nextfile,nexttag,
349 if(!strcmp(nexttag,
"0") || !strcmp(nexttag,
""))
389 const_cast<char *
>(tagfile),
391 (Char_t**) headptr, 0);
424 fname.ReplaceAll(
".lmd",4,
"_ASF",4);
427 TString asfname = fname+
".root";
428 std::cout <<
"Setting autosavefile to name " << asfname << std::endl;
The mother of all go4 analysis.
static TGo4Analysis * Instance()
return analysis instance
void Message(Int_t prio, const char *text,...)
Display a user message.
void SetNewInputFile(Bool_t on=kTRUE)
Set flag that input file has changed.
Bool_t ClearObjects(const char *name)
Clear (reset) the specified objects.
Bool_t IsAutoSaveFileChange() const
True if autosave file is changed according to the current input file of lmd file list.
void AutoSave()
Perform autosave of all active stores, save existing calibration objects, write known objects into us...
void SetAutoSaveFile(const char *filename=nullptr, Bool_t overwrite=kFALSE, Int_t compression=5)
Set file for autosave action.
void SetInputFileName(const char *fname)
Set current input file name.
Exception to throw on event source timeout.
Exception to be thrown on error of event source.
Int_t Handle() override
This is a default handler function for the respective exception type.
void SetErrMess(const char *txt)
To be used for modification of the message by the event source implementation.
void SetEventStatus(Int_t status)
Status of the last event.
Int_t GetEventStatus() const
Status of the last event.
Int_t GetCreateStatus() const
Status value of server/file open.
void SetCreateStatus(Int_t status)
Status value of event source init (file/server open).
static TList * ProducesFilesList(const char *mask)
static void Info(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 1.
static void Debug(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 0.
Int_t NumMoreFiles() const
Number of more file names in parameter.
const char * GetTagName() const
Name of the Tagfile.
const char * GetMoreName(Int_t n) const
Returns name of extra files names, configured in the parameter.
const char * GetActiveName() const override
interface from eventsource base class to give active file
static const char * fgcFILELISTSUF
standard suffix for list of listmode files
Int_t NextEvent() override
Requests the next event from mbs source.
static const char * fgcNOTAGFILE
string to indicate that no lmd tagfile is chosen
Int_t Open() override
Open the file or connection.
TString fxCurrentFile
Currently processed file (for multiple input mode)
const char * GetTagName() const
Name of the Tagfile.
Int_t NewFileAction(Bool_t dosave=kTRUE)
Called whenever new file is opened in multiple mode.
Bool_t fbFileOpen
This indicates if the current file is open or not.
TList * fxMultiFile
file that contains the list of mbs filenames.
void AddFileName(const char *name, const char *tagname=nullptr, bool isonly=kFALSE)
TString fxCurrentTag
Currently processed tagfile (for multiple input mode)
static const char * fgcLMDSUF
standard suffix for listmode data files
const char * GetCurrentTagName() const
Int_t NextFile()
For multiple input mode: Open next file in list.
Int_t Close() override
Close the file or connection.
Int_t OpenFile()
Open current file/tagfile.
Int_t CloseFile()
Close current file/tagfile.
const char * GetCurrentFileName() const
TString fxTagFile
Name of the tagfile associated with the listmode event file.
Bool_t fbShowInfo
Indicates if mbs file should show information about new open file.
s_evt_channel * fxInputChannel
Event channel structure used by event source.
ULong_t fuStopEvent
Index of last event to process.
ULong_t fuStartEvent
Index of first event to process.
Bool_t fbFirstEvent
Indicates if first event should be extracted.
ULong_t fuEventCounter
Current event index counter.
TGo4MbsSource()
default for streamer
ULong_t fuEventInterval
Number of events to skip from file in between two read events.
s_filhe * fxInfoHeader
Reference to header info delivered by source.
INTS4 f_evt_get_tagopen(s_evt_channel *ps_chan, CHARS *pc_tag, CHARS *pc_lmd, CHARS **ps_head, INTS4 l_prihe)
INTS4 f_evt_error(INTS4 l_error, CHARS *pc_dest, INTS4 l_out)
INTS4 f_evt_get_tagclose(s_evt_channel *ps_chan)
INTS4 f_evt_get_tagnext(s_evt_channel *ps_chan, INTS4 l_skip, INTS4 **pl_event)