31 GO4TRACE((12,
"TGo4MbsEvent::TGo4MbsEvent()",__LINE__, __FILE__));
41 GO4TRACE((12,
"TGo4MbsEvent::TGo4MbsEvent(UInt_t, Short_t *, UInt_t)",__LINE__, __FILE__));
44 for (UInt_t t = 0; t < subnum; ++t) {
62 GO4TRACE((12,
"TGo4MbsEvent::TGo4MbsEvent(UInt_t, Char_t *, Char_t *, Short_t *, UInt_t *)",__LINE__, __FILE__));
65 for (UInt_t t = 0; t < subnum; ++t) {
82 GO4TRACE((12,
"TGo4MbsEvent::TGo4MbsEvent(const char *)",__LINE__, __FILE__));
103 GO4TRACE((12,
"TGo4MbsEvent::~TGo4MbsEvent()",__LINE__, __FILE__));
116 GO4TRACE((11,
"TGo4MbsEvent::Clear()",__LINE__, __FILE__));
154 Short_t dummy, Short_t trigger, Int_t count)
188 printf(
"***** File header:\n");
194 printf(
"\t#commentlines: %d\n", head->
filhe_lines);
204 printf(
"***** Buffer header:\n");
205 printf(
"\tbuffernumber: %d \n", head->
l_buf);
206 printf(
"\tdatalen: %d \n", head->
l_dlen);
207 printf(
"\ttime lo: %u\n", head->
l_time[0]);
208 printf(
"\ttime hi: %u\n", head->
l_time[1]);
211 printf(
"\ttimestring: %s\n", sbuf);
212 printf(
"\ttype: %d \n", head->
i_type);
213 printf(
"\tsubtype: %d \n", head->
i_subtype);
219 static TString oldfname =
"";
220 static TString timestring =
"";
223 if (head && (TString(head->
filhe_file) != oldfname)) {
228 static int oldbnum = 0;
231 if ( head && (head->
l_buf != oldbnum) ) {
233 oldbnum = head->
l_buf;
243 printf(
"Event %9d Type/Subtype %5d %5d Length %5d[w] Trigger %2d %s\n",
246 printf(
"Event type %d, subtype %d, data longwords %d",
253 if ((subid >= 0) && (sub->GetProcid() != subid))
continue;
255 sub->PrintMbsSubevent(longw, hexw, dataw);
269 GO4TRACE((11,
"TGo4MbsEvent::NextSubEvent()", __LINE__, __FILE__));
287 GO4TRACE((11,
"TGo4MbsEvent::GetSubEvent(Char_t)",__LINE__, __FILE__));
290 if ((sub->GetSubcrate() == subcrate) && (sub->GetControl() == ctrl) && (sub->GetProcid() == procid))
297 GO4TRACE((11,
"TGo4MbsEvent::GetSubEvent(Short_t)",__LINE__, __FILE__));
300 if(sub->GetProcid()== procid)
320 Int_t fieldlength = 0;
323 fieldlength = (datalength-2) / (
sizeof(Int_t) /
sizeof(Short_t));
332 Int_t *subtargetid= &((subtargetindex->fxHeader).fiFullid);
333 if(*subtargetid == fullID) {
335 if(!subtargetindex->fbIsFilled) {
337 subtarget=subtargetindex;
350 Int_t *newsubtargetid= &((subtarget->
fxHeader).fiFullid);
353 delete [] (subtarget->
fiData);
356 *newsubtargetid = fullID;
357 TGo4Log::Debug(
" Created new output subevent for event\n\tpid:%d subcrate:%d ctrl:%d",
363 subtarget->
SetDlen(datalength);
364 void *data = (
void *) source;
370 memcpy((
void *) (subtarget->
fiData),
371 data, (datalength-2)*
sizeof(Short_t));
377 subtarget->
fiData = (Int_t *) data;
379 subtarget->
fiData =
nullptr;
TGo4EventSource * GetEventSource() const
static void Debug(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 0.
void PrintMbsFileHeader()
Method to print MBS source header.
void PrintEvent() override
Print event with default settings.
TGo4MbsSubEvent * GetSubEvent(Char_t subcrate, Char_t ctrl, Short_t procid)
Access to subevent in list by procid, subcrate and ctrl identifiers.
TGo4EventHeader10 fxHeader
aggregationByValue
void SetSubtype(Short_t subtype)
s_filhe * GetMbsSourceHeader()
Access to the info header of the current mbs source.
TGo4MbsSubEvent * AddSubEvent(Int_t fullID, Short_t *source, Int_t datalength, Bool_t copydata=kFALSE)
Add new subevent to mbs event.
void SetPrintEvent(Int_t num, Int_t sid, Int_t longw, Int_t hexw, Int_t dataw)
Set print parameter for MBS event source See TGo4MbsSource for more details.
TObjArray * fxSubEvArray
dynamic array of subevents.
void SetDummy(Short_t dummy)
void PrintMbsBufferHeader()
Method to print MBS buffer header.
void Clear(Option_t *opt="") override
Method called by the event owner (analysis step) to clear the event element.
TGo4MbsSubEvent * NextSubEvent(Bool_t all=kFALSE)
Iterator for subevent array.
Int_t fiSubEvIndex
Subevent index in array, replacement for Iterator.
s_bufhe * GetMbsBufferHeader()
Access to the buffer header of the current event.
void SetCount(Int_t count)
friend class TGo4MbsSource
void Set(Int_t dlen=0, Short_t type=10, Short_t subtype=1, Short_t dummy=0, Short_t trigger=0, Int_t count=0)
void PrintMbsEvent(Int_t subid=-1, Bool_t longw=kTRUE, Bool_t hexw=kTRUE, Bool_t dataw=kTRUE, Bool_t bufhead=kFALSE, Bool_t filhead=kFALSE)
Print MBS event.
void ResetIterator()
Set the internal iterator of the subevent array to the beginning of the array.
void SetTrigger(Short_t trigger)
Short_t GetTrigger() const
void SetType(Short_t type)
void AssignReference(TGo4MbsEvent *ref)
Bool_t fbIsReference
Indicates if this object is mere reference to another mbs event.
Short_t GetSubtype() const
s_filhe * GetInfoHeader() const
User access to info header.
void SetPrintEvent(Int_t num=1, Int_t sid=-1, Int_t longw=1, Int_t hexw=1, Int_t dataw=0)
Set mbs source into printout (verbose) mode for the next num events.
virtual s_bufhe * GetBufferHeader()
User access to current event buffer header.
Subevent class for gsi mbs data.
Bool_t fbIsFilled
True if this subevent has already been filled in this event cycle.
void SetProcid(Short_t procid)
TGo4SubEventHeader10 fxHeader
aggregationByValue
Int_t * fiData
Pointer to external integer field containing the subevent data.
Char_t GetSubcrate() const
Bool_t IsFilled() const
true if this subevent was filled since the last Clear()
void SetSubcrate(Char_t subcrate)
void ReAllocate(Int_t newsize)
Allocate the data field with newsize.
Char_t GetControl() const
Short_t GetProcid() const
Bool_t fbIsDataOwner
True if subevent owns data field.
void SetControl(Char_t control)
Int_t fiAllocLen
Length of the allocated data field.
INTS4 f_ut_utime(INTS4, INTS4, CHARS *)
struct cv_string s_strings[30]