GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4MbsEvent.h
Go to the documentation of this file.
1 // $Id: TGo4MbsEvent.h 1487 2015-06-03 16:49:26Z 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 für 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 "s_bufhe_swap.h"
21 #include "s_filhe_swap.h"
22 #include "TGo4MbsSubEvent.h"
23 
24 class TIterator;
25 class TObjArray;
26 class TGo4MbsSource;
27 class TGo4MbsSubEvent;
28 
34 
35  friend class TGo4MbsSource;
36 
37  public:
38 
39  // should only be used in streaming
40  TGo4MbsEvent();
41 
46  TGo4MbsEvent(UInt_t subnum, Short_t* subids, UInt_t datasize=100);
47 
53  TGo4MbsEvent(UInt_t subnum, Char_t* subcrates, Char_t* controls, Short_t* procids, UInt_t* datasizes);
54 
57  TGo4MbsEvent(const char* name);
58 
59  virtual ~TGo4MbsEvent();
60 
62  virtual void Clear(Option_t *t="");
63 
64  /* Declare this mbs event object as "reference" to another.
65  * This will just set event header accordingly and will use
66  * reference to subevents of original mbs event. No ownership is adopted!
67  * Use case: Mbsevent as Go4 output event that just uses input event data
68  * without copying, purpose: store to Go4 event store (root file)*/
69  void AssignReference(TGo4MbsEvent* ref);
70 
71  /* remove reference to external mbsevent object
72  * afterwards, this object will contain new subevtarray*/
73  void RemoveReference();
74 
75  void Set(Int_t dlen=0, Short_t type=10, Short_t subtype=1,
76  Short_t dummy=0, Short_t trigger=0, Int_t count=0);
77 
79  virtual void PrintEvent();
80 
89  void PrintMbsEvent(Int_t subid = -1, Bool_t longw = kTRUE, Bool_t hexw = kTRUE, Bool_t dataw = kTRUE,
90  Bool_t bufhead = kFALSE, Bool_t filhead=kFALSE);
91 
94  void SetPrintEvent(Int_t num, Int_t sid, Int_t longw, Int_t hexw, Int_t dataw);
95 
98  inline void ResetIterator() { fiSubEvIndex = 0; }
99 
104  TGo4MbsSubEvent* NextSubEvent(Bool_t all=kFALSE);
105 
110  TGo4MbsSubEvent * GetSubEvent(Char_t subcrate,
111  Char_t ctrl,
112  Short_t procid);
113 
118  TGo4MbsSubEvent * GetSubEvent(Short_t procid);
119 
126  TGo4MbsSubEvent* AddSubEvent(Int_t fullID,
127  Short_t* source,
128  Int_t datalength,
129  Bool_t copydata = kFALSE);
130 
131  void SetDlen(Int_t dlen) { fxHeader.fxGSIHeader.fiDlen = dlen; }
132  Int_t GetDlen() const { return fxHeader.fxGSIHeader.fiDlen; }
133  Int_t GetIntLen() const { return (GetDlen()-4)*2/4; }
134  Int_t GetByteLen() const { return (GetDlen()-4)*2; }
135 
136  void SetType(Short_t type) { fxHeader.fxGSIHeader.fsType = type; }
137  Short_t GetType() const { return fxHeader.fxGSIHeader.fsType; }
138 
139  void SetSubtype(Short_t subtype) { fxHeader.fxGSIHeader.fsSubtype = subtype; }
140  Short_t GetSubtype() const { return fxHeader.fxGSIHeader.fsSubtype; }
141 
142  void SetDummy(Short_t dummy) { fxHeader.fsDummy = dummy; }
143  Short_t GetDummy() const { return fxHeader.fsDummy; }
144 
145  void SetTrigger(Short_t trigger) { fxHeader.fsTrigger = trigger; }
146  Short_t GetTrigger() const { return fxHeader.fsTrigger; }
147 
148  void SetCount(Int_t count) { fxHeader.fiCount = count; }
149  Int_t GetCount() const { return fxHeader.fiCount; }
150 
153 
155  void PrintMbsFileHeader();
156 
159 
161  void PrintMbsBufferHeader();
162 
163 
164  private:
165 
168 
170  TObjArray* fxSubEvArray;
171 
174 
176  Bool_t fbIsReference;
177 
178  /* initialize this event with a simple dummy subevent*/
179  void SimpleInit();
180 
181 
182 
183  ClassDef(TGo4MbsEvent,3)
184 };
185 
186 #endif //TGO4MBSEVENT_H
void SetCount(Int_t count)
Definition: TGo4MbsEvent.h:148
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:140
TGo4GSIEventHeader fxGSIHeader
void RemoveReference()
Int_t GetIntLen() const
Definition: TGo4MbsEvent.h:133
virtual void PrintEvent()
Int_t fiSubEvIndex
Definition: TGo4MbsEvent.h:173
TGo4MbsSubEvent * NextSubEvent(Bool_t all=kFALSE)
Bool_t fbIsReference
Definition: TGo4MbsEvent.h:176
Int_t GetByteLen() const
Definition: TGo4MbsEvent.h:134
Int_t GetDlen() const
Definition: TGo4MbsEvent.h:132
Short_t GetDummy() const
Definition: TGo4MbsEvent.h:143
Short_t GetType() const
Definition: TGo4MbsEvent.h:137
TGo4EventHeader10 fxHeader
Definition: TGo4MbsEvent.h:167
void SetSubtype(Short_t subtype)
Definition: TGo4MbsEvent.h:139
void SetDummy(Short_t dummy)
Definition: TGo4MbsEvent.h:142
void SetDlen(Int_t dlen)
Definition: TGo4MbsEvent.h:131
void SetType(Short_t type)
Definition: TGo4MbsEvent.h:136
TObjArray * fxSubEvArray
Definition: TGo4MbsEvent.h:170
Int_t GetCount() const
Definition: TGo4MbsEvent.h:149
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:146
void ResetIterator()
Definition: TGo4MbsEvent.h:98
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:145