42 SetName(par->GetName());
47 TGo4Log::Error(
"TYYYEventSource constructor with zero parameter!");
66 return cl->InheritsFrom(TYYYRawEvent::Class());
72 if (!evnt)
return kFALSE;
74 char sbuf[1024], buffer[1024];
78 fxFile->getline(sbuf,
sizeof(sbuf),
'\n' );
82 TString errmsg = TString::Format(
"End of input file %s", GetName());
87 }
while(strstr(sbuf,
"#") || strstr(sbuf,
"!") );
94 const char *cursor = sbuf;
96 evnt->ReAllocate(numval+1);
97 scanresult = sscanf(cursor,
"%s",buffer);
98 if(scanresult != 0 && scanresult != -1) {
99 evnt->fdData[numval] = atof(buffer);
103 cursor += strlen(buffer)+1;
104 }
while( scanresult != 0 && scanresult != -1);
109 evnt->SetValid(kFALSE);
123 fxFile =
new std::ifstream(GetName());
127 TString errmsg = TString::Format(
"Eror opening user file:%s",GetName());
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
Exception to throw on event source timeout.
Exception to be thrown on error of event source.
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.
void SetCreateStatus(Int_t status)
Status value of event source init (file/server open).
static void Info(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 1.
static void Error(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 3.
const char * GetExpression() const
User expression as string.
Int_t fiPort
Optional port number.
Bool_t BuildEvent(TGo4EventElement *dest) override
This methods actually fills the target event class which is passed as pointer.
std::ifstream * fxFile
file that contains the data in ascii format.
virtual Int_t Open()
Open the file or connection.
TString fxArgs
Optional argument string.
Bool_t CheckEventClass(TClass *cl) override
This method checks if event class is suited for the source.
virtual ~TYYYEventSource()
void SetArgs(const char *arg)
virtual Int_t Close()
Close the file or connection.
Example for user defined raw event class.