GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4MbsSubEvent.h
Go to the documentation of this file.
1 // $Id: TGo4MbsSubEvent.h 896 2012-11-22 14:35:47Z 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 TGO4MBSSUBEVENT_H
15 #define TGO4MBSSUBEVENT_H
16 
17 #include "TGo4EventElement.h"
18 
19 #include "TGo4SubEventHeader10.h"
20 
21 class TGo4MbsEvent;
22 
25 
26  friend class TGo4MbsSource;
27  friend class TGo4MbsEvent;
28 
29  public:
30 
31  // only for streaming
33 
34  TGo4MbsSubEvent(Int_t datasize);
35 
36  virtual ~TGo4MbsSubEvent();
37 
38  virtual Int_t Fill() { return -1; } // method not used
39 
40  virtual void Clear(Option_t *t="");
41 
43  virtual void PrintEvent();
44 
49  void PrintMbsSubevent(Bool_t longw = kTRUE, Bool_t hexw = kTRUE, Bool_t dataw = kTRUE);
50 
51  void Set(Int_t dlen, Short_t type=10, Short_t subtype=1,
52  Short_t procid=0, Char_t subcrate=0, Char_t ctrl=0);
53 
54  void SetDlen(Int_t dlen) { fxHeader.fxGSIHeader.fiDlen = dlen; }
55  Int_t GetDlen() const { return fxHeader.fxGSIHeader.fiDlen; }
56 
58  Int_t GetByteLen() const { return (GetDlen()-2) * 2; }
59 
61  Int_t GetIntLen() const { return GetByteLen() / 4; }
62 
63  void SetType(Short_t type) { fxHeader.fxGSIHeader.fsType = type; }
64  Short_t GetType() const { return fxHeader.fxGSIHeader.fsType; }
65 
66  void SetSubtype(Short_t subtype) { fxHeader.fxGSIHeader.fsSubtype = subtype; }
67  Short_t GetSubtype() const { return fxHeader.fxGSIHeader.fsSubtype; }
68 
69  void SetProcid(Short_t procid) { fxHeader.fsProcid = procid; }
70  Short_t GetProcid() const { return fxHeader.fsProcid; }
71 
72  void SetSubcrate(Char_t subcrate) { fxHeader.fcSubcrate = subcrate; }
73  Char_t GetSubcrate() const { return fxHeader.fcSubcrate; }
74 
75  void SetControl(Char_t control) { fxHeader.fcControl = control; }
76  Char_t GetControl() const { return fxHeader.fcControl; }
77 
78  void SetFullId(Int_t fullid) { fxHeader.fiFullid = fullid; }
79  Int_t GetFullId() const { return fxHeader.fiFullid; }
80 
82  Int_t GetAllocatedLength() const { return fiAllocLen; }
83 
86  Int_t* GetDataField() { return fiData; }
87 
90  Int_t Data(Int_t i) const
91  { return ((i<0) || (i>=GetAllocatedLength())) ? 0 : fiData[i]; }
92 
94  Bool_t IsFilled() const { return fbIsFilled; }
95 
96  private:
97 
100  void ReAllocate(Int_t newsize);
101 
104  Bool_t fbIsFilled;
105 
108  Bool_t fbIsDataOwner;
109 
112 
121  Int_t fiAllocLen;
122 
127  Int_t* fiData; //[fiAllocLen]
128 
129  ClassDef(TGo4MbsSubEvent,2)
130 };
131 
132 #endif //TGO4MBSSUBEVENT_H
virtual void Clear(Option_t *t="")
Int_t GetFullId() const
void PrintMbsSubevent(Bool_t longw=kTRUE, Bool_t hexw=kTRUE, Bool_t dataw=kTRUE)
Int_t GetDlen() const
void SetControl(Char_t control)
TGo4GSIEventHeader fxGSIHeader
void SetDlen(Int_t dlen)
Short_t GetType() const
TGo4SubEventHeader10 fxHeader
Bool_t IsFilled() const
virtual Int_t Fill()
void SetFullId(Int_t fullid)
void SetSubcrate(Char_t subcrate)
void SetProcid(Short_t procid)
Int_t * GetDataField()
virtual void PrintEvent()
virtual ~TGo4MbsSubEvent()
void SetType(Short_t type)
Int_t GetByteLen() const
Short_t GetProcid() const
Int_t GetIntLen() const
Char_t GetSubcrate() const
Short_t GetSubtype() const
Char_t GetControl() const
void SetSubtype(Short_t subtype)
void Set(Int_t dlen, Short_t type=10, Short_t subtype=1, Short_t procid=0, Char_t subcrate=0, Char_t ctrl=0)
Int_t Data(Int_t i) const
Int_t GetAllocatedLength() const
void ReAllocate(Int_t newsize)