GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4MbsEvent.h
Go to the documentation of this file.
1 // $Id: TGo4MbsEvent.h 3346 2021-10-18 14:00:53Z linev $
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 
22 extern "C" {
23  #include "s_bufhe.h"
24  #include "s_filhe.h"
25 }
26 
27 class TIterator;
28 class TObjArray;
29 class TGo4MbsSource;
30 class TGo4MbsSubEvent;
31 
37 
38  friend class TGo4MbsSource;
39 
40  public:
41 
42  // should only be used in streaming
43  TGo4MbsEvent();
44 
49  TGo4MbsEvent(UInt_t subnum, Short_t* subids, UInt_t datasize=100);
50 
56  TGo4MbsEvent(UInt_t subnum, Char_t* subcrates, Char_t* controls, Short_t* procids, UInt_t* datasizes);
57 
60  TGo4MbsEvent(const char* name);
61 
62  virtual ~TGo4MbsEvent();
63 
65  virtual void Clear(Option_t *t="");
66 
67  /* Declare this mbs event object as "reference" to another.
68  * This will just set event header accordingly and will use
69  * reference to subevents of original mbs event. No ownership is adopted!
70  * Use case: Mbsevent as Go4 output event that just uses input event data
71  * without copying, purpose: store to Go4 event store (root file)*/
72  void AssignReference(TGo4MbsEvent* ref);
73 
74  /* remove reference to external mbsevent object
75  * afterwards, this object will contain new subevtarray*/
76  void RemoveReference();
77 
78  void Set(Int_t dlen=0, Short_t type=10, Short_t subtype=1,
79  Short_t dummy=0, Short_t trigger=0, Int_t count=0);
80 
82  virtual void PrintEvent();
83 
92  void PrintMbsEvent(Int_t subid = -1, Bool_t longw = kTRUE, Bool_t hexw = kTRUE, Bool_t dataw = kTRUE,
93  Bool_t bufhead = kFALSE, Bool_t filhead=kFALSE);
94 
97  void SetPrintEvent(Int_t num, Int_t sid, Int_t longw, Int_t hexw, Int_t dataw);
98 
101  inline void ResetIterator() { fiSubEvIndex = 0; }
102 
107  TGo4MbsSubEvent* NextSubEvent(Bool_t all=kFALSE);
108 
113  TGo4MbsSubEvent * GetSubEvent(Char_t subcrate,
114  Char_t ctrl,
115  Short_t procid);
116 
121  TGo4MbsSubEvent * GetSubEvent(Short_t procid);
122 
129  TGo4MbsSubEvent* AddSubEvent(Int_t fullID,
130  Short_t* source,
131  Int_t datalength,
132  Bool_t copydata = kFALSE);
133 
134  void SetDlen(Int_t dlen) { fxHeader.fxGSIHeader.fiDlen = dlen; }
135  Int_t GetDlen() const { return fxHeader.fxGSIHeader.fiDlen; }
136  Int_t GetIntLen() const { return (GetDlen()-4)*2/4; }
137  Int_t GetByteLen() const { return (GetDlen()-4)*2; }
138 
139  void SetType(Short_t type) { fxHeader.fxGSIHeader.fsType = type; }
140  Short_t GetType() const { return fxHeader.fxGSIHeader.fsType; }
141 
142  void SetSubtype(Short_t subtype) { fxHeader.fxGSIHeader.fsSubtype = subtype; }
143  Short_t GetSubtype() const { return fxHeader.fxGSIHeader.fsSubtype; }
144 
145  void SetDummy(Short_t dummy) { fxHeader.fsDummy = dummy; }
146  Short_t GetDummy() const { return fxHeader.fsDummy; }
147 
148  void SetTrigger(Short_t trigger) { fxHeader.fsTrigger = trigger; }
149  Short_t GetTrigger() const { return fxHeader.fsTrigger; }
150 
151  void SetCount(Int_t count) { fxHeader.fiCount = count; }
152  Int_t GetCount() const { return fxHeader.fiCount; }
153 
156 
158  void PrintMbsFileHeader();
159 
162 
164  void PrintMbsBufferHeader();
165 
166 
167  private:
168 
171 
173  TObjArray* fxSubEvArray;
174 
177 
179  Bool_t fbIsReference;
180 
181  /* initialize this event with a simple dummy subevent*/
182  void SimpleInit();
183 
184 
185 
186  ClassDef(TGo4MbsEvent,3)
187 };
188 
189 #endif //TGO4MBSEVENT_H
void SetCount(Int_t count)
Definition: TGo4MbsEvent.h:151
TGo4MbsSubEvent * AddSubEvent(Int_t fullID, Short_t *source, Int_t datalength, Bool_t copydata=kFALSE)
virtual void Clear(Option_t *t="")
s_bufhe * GetMbsBufferHeader()
Short_t GetSubtype() const
Definition: TGo4MbsEvent.h:143
TGo4GSIEventHeader fxGSIHeader
void RemoveReference()
Int_t GetIntLen() const
Definition: TGo4MbsEvent.h:136
virtual void PrintEvent()
Int_t fiSubEvIndex
Definition: TGo4MbsEvent.h:176
TGo4MbsSubEvent * NextSubEvent(Bool_t all=kFALSE)
Bool_t fbIsReference
Definition: TGo4MbsEvent.h:179
Int_t GetByteLen() const
Definition: TGo4MbsEvent.h:137
Int_t GetDlen() const
Definition: TGo4MbsEvent.h:135
Short_t GetDummy() const
Definition: TGo4MbsEvent.h:146
Short_t GetType() const
Definition: TGo4MbsEvent.h:140
TGo4EventHeader10 fxHeader
Definition: TGo4MbsEvent.h:170
void SetSubtype(Short_t subtype)
Definition: TGo4MbsEvent.h:142
void SetDummy(Short_t dummy)
Definition: TGo4MbsEvent.h:145
void SetDlen(Int_t dlen)
Definition: TGo4MbsEvent.h:134
void SetType(Short_t type)
Definition: TGo4MbsEvent.h:139
TObjArray * fxSubEvArray
Definition: TGo4MbsEvent.h:173
Int_t GetCount() const
Definition: TGo4MbsEvent.h:152
void SimpleInit()
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)
void AssignReference(TGo4MbsEvent *ref)
void PrintMbsFileHeader()
void PrintMbsBufferHeader()
s_filhe * GetMbsSourceHeader()
void SetPrintEvent(Int_t num, Int_t sid, Int_t longw, Int_t hexw, Int_t dataw)
virtual ~TGo4MbsEvent()
Short_t GetTrigger() const
Definition: TGo4MbsEvent.h:149
void ResetIterator()
Definition: TGo4MbsEvent.h:101
TGo4MbsSubEvent * GetSubEvent(Char_t subcrate, Char_t ctrl, Short_t procid)
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 SetTrigger(Short_t trigger)
Definition: TGo4MbsEvent.h:148