GSI Object Oriented Online Offline (Go4) GO4-6.4.5
Loading...
Searching...
No Matches
TGo4MbsEvent.h
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
14#ifndef TGO4MBSEVENT_H
15#define TGO4MBSEVENT_H
16
17#include "TGo4EventElement.h"
18
19#include "TGo4EventHeader10.h"
20#include "TGo4MbsSubEvent.h"
21
22extern "C" {
23 #include "s_bufhe.h"
24 #include "s_filhe.h"
25}
26
27class TObjArray;
28class TGo4MbsSource;
29class TGo4MbsSubEvent;
30
35class TGo4MbsEvent : public TGo4EventElement {
36
37 friend class TGo4MbsSource;
38
39 public:
40
41 // should only be used in streaming
43
48 TGo4MbsEvent(UInt_t subnum, Short_t *subids, UInt_t datasize = 100);
49
55 TGo4MbsEvent(UInt_t subnum, Char_t *subcrates, Char_t *controls, Short_t *procids, UInt_t *datasizes);
56
59 TGo4MbsEvent(const char *name);
60
61 virtual ~TGo4MbsEvent();
62
64 void Clear(Option_t *opt = "") override;
65
66 /* Declare this mbs event object as "reference" to another.
67 * This will just set event header accordingly and will use
68 * reference to subevents of original mbs event. No ownership is adopted!
69 * Use case: Mbsevent as Go4 output event that just uses input event data
70 * without copying, purpose: store to Go4 event store (root file)*/
72
73 /* remove reference to external mbsevent object
74 * afterwards, this object will contain new subevtarray*/
76
77 void Set(Int_t dlen = 0, Short_t type = 10, Short_t subtype = 1,
78 Short_t dummy = 0, Short_t trigger = 0, Int_t count = 0);
79
81 void PrintEvent() override;
82
91 void PrintMbsEvent(Int_t subid = -1, Bool_t longw = kTRUE, Bool_t hexw = kTRUE, Bool_t dataw = kTRUE,
92 Bool_t bufhead = kFALSE, Bool_t filhead=kFALSE);
93
96 void SetPrintEvent(Int_t num, Int_t sid, Int_t longw, Int_t hexw, Int_t dataw);
97
100 inline void ResetIterator() { fiSubEvIndex = 0; }
101
106 TGo4MbsSubEvent *NextSubEvent(Bool_t all=kFALSE);
107
112 TGo4MbsSubEvent *GetSubEvent(Char_t subcrate,
113 Char_t ctrl,
114 Short_t procid);
115
120 TGo4MbsSubEvent *GetSubEvent(Short_t procid);
121
129 Short_t *source,
130 Int_t datalength,
131 Bool_t copydata = kFALSE);
132
133 void SetDlen(Int_t dlen) { fxHeader.fxGSIHeader.fiDlen = dlen; }
134 Int_t GetDlen() const { return fxHeader.fxGSIHeader.fiDlen; }
135 Int_t GetIntLen() const { return (GetDlen()-4)*2/4; }
136 Int_t GetByteLen() const { return (GetDlen()-4)*2; }
137
138 void SetType(Short_t type) { fxHeader.fxGSIHeader.fsType = type; }
139 Short_t GetType() const { return fxHeader.fxGSIHeader.fsType; }
140
141 void SetSubtype(Short_t subtype) { fxHeader.fxGSIHeader.fsSubtype = subtype; }
142 Short_t GetSubtype() const { return fxHeader.fxGSIHeader.fsSubtype; }
143
144 void SetDummy(Short_t dummy) { fxHeader.fsDummy = dummy; }
145 Short_t GetDummy() const { return fxHeader.fsDummy; }
146
147 void SetTrigger(Short_t trigger) { fxHeader.fsTrigger = trigger; }
148 Short_t GetTrigger() const { return fxHeader.fsTrigger; }
149
150 void SetCount(Int_t count) { fxHeader.fiCount = count; }
151 Int_t GetCount() const { return fxHeader.fiCount; }
152
155
158
161
164
165 private:
166
169
171 TObjArray *fxSubEvArray{nullptr};
172
174 Int_t fiSubEvIndex{0};
175
177 Bool_t fbIsReference{kFALSE};
178
179 /* initialize this event with a simple dummy subevent*/
181
182 ClassDefOverride(TGo4MbsEvent,3)
183};
184
185#endif //TGO4MBSEVENT_H
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
Standard GSI (goosy, mbs) event header implementation.
Wrapper for the standard gsi event structure as delivered from mbs.
Short_t GetDummy() const
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
Short_t GetType() const
Int_t GetByteLen() const
Int_t GetDlen() const
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.
virtual ~TGo4MbsEvent()
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.
void SetDummy(Short_t dummy)
Int_t GetCount() const
void PrintMbsBufferHeader()
Method to print MBS buffer header.
friend class TGo4MbsSource
TObjArray * fxSubEvArray
dynamic array of subevents.
void SimpleInit()
void Clear(Option_t *opt="") override
Method called by the event owner (analysis step) to clear the event element.
TGo4MbsEvent(UInt_t subnum, Char_t *subcrates, Char_t *controls, Short_t *procids, UInt_t *datasizes)
Ctor expecting the number of subevents to initialize and arrays which specify the subevent ids (subcr...
TGo4MbsEvent(const char *name)
Ctor expecting just a name.
TGo4MbsSubEvent * NextSubEvent(Bool_t all=kFALSE)
Iterator for subevent array.
Int_t fiSubEvIndex
Subevent index in array, replacement for Iterator.
Int_t GetIntLen() const
s_bufhe * GetMbsBufferHeader()
Access to the buffer header of the current event.
void SetDlen(Int_t dlen)
void SetCount(Int_t count)
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.
TGo4MbsSubEvent * GetSubEvent(Short_t procid)
Access to subevent in list by procid.
TGo4MbsEvent(UInt_t subnum, Short_t *subids, UInt_t datasize=100)
Ctor expecting the number of subevents to initialize and an array which specifies the subevent ids (p...
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
void RemoveReference()
Generic MBS source.
Subevent class for gsi mbs data.