00001 //------------------------------------------------------------- 00002 // Go4 Release Package v3.04-01 (build 30401) 00003 // 28-November-2008 00004 //--------------------------------------------------------------- 00005 // The GSI Online Offline Object Oriented (Go4) Project 00006 // Experiment Data Processing at EE department, GSI 00007 //--------------------------------------------------------------- 00008 // 00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI 00010 // Planckstr. 1, 64291 Darmstadt, Germany 00011 //Contact: http://go4.gsi.de 00012 //---------------------------------------------------------------- 00013 //This software can be used under the license agreements as stated 00014 //in Go4License.txt file which is part of the distribution. 00015 //---------------------------------------------------------------- 00016 #ifndef TGO4MBSSUBEVENT_H 00017 #define TGO4MBSSUBEVENT_H 00018 00019 #include "TGo4EventElement.h" 00020 00021 #include "TGo4SubEventHeader10.h" 00022 00024 class TGo4MbsSubEvent : public TGo4EventElement { 00025 00026 friend class TGo4MbsSource; 00027 00028 00029 public: 00030 00031 // only for streaming 00032 TGo4MbsSubEvent(); 00033 00034 TGo4MbsSubEvent(Int_t datasize); 00035 00036 virtual ~TGo4MbsSubEvent(); 00037 00038 virtual Int_t Fill(){return -1; }// method not used 00039 00040 virtual void Clear(Option_t *t=""); 00041 00042 void PrintEvent(); 00043 00044 void Set(Int_t dlen, Short_t type=10, Short_t subtype=1, 00045 Short_t procid=0, Char_t subcrate=0, Char_t ctrl=0); 00046 00047 void SetDlen(Int_t dlen) { fxHeader.fxGSIHeader.fiDlen = dlen; } 00048 Int_t GetDlen() const { return fxHeader.fxGSIHeader.fiDlen; } 00049 Int_t GetIntLen() const { return (GetDlen()-2)*sizeof(Short_t)/sizeof(Int_t); } 00050 00051 void SetType(Short_t type) { fxHeader.fxGSIHeader.fsType = type; } 00052 Short_t GetType() const { return fxHeader.fxGSIHeader.fsType; } 00053 00054 void SetSubtype(Short_t subtype) { fxHeader.fxGSIHeader.fsSubtype = subtype; } 00055 Short_t GetSubtype() const { return fxHeader.fxGSIHeader.fsSubtype; } 00056 00057 void SetProcid(Short_t procid) { fxHeader.fsProcid = procid; } 00058 Short_t GetProcid() const { return fxHeader.fsProcid; } 00059 00060 void SetSubcrate(Char_t subcrate) { fxHeader.fcSubcrate = subcrate; } 00061 Char_t GetSubcrate() const { return fxHeader.fcSubcrate; } 00062 00063 void SetControl(Char_t control) { fxHeader.fcControl = control; } 00064 Char_t GetControl() const { return fxHeader.fcControl; } 00065 00067 Int_t GetAllocatedLength() { return fiAllocLen; } 00068 00071 Int_t* GetDataField() { return fiData; } 00072 00075 Int_t Data(Int_t i) 00076 { return ((i<0) || (i>=GetAllocatedLength())) ? 0 : fiData[i]; } 00077 00079 Bool_t IsFilled() { return fbIsFilled; } 00080 00081 private: 00082 00085 void ReAllocate(Int_t newsize); 00086 00089 Bool_t fbIsFilled; 00090 00092 Bool_t fbIsDataOwner; 00093 00095 TGo4SubEventHeader10 fxHeader; 00096 00105 Int_t fiAllocLen; 00106 00111 Int_t* fiData; //[fiAllocLen] 00112 00113 ClassDef(TGo4MbsSubEvent,1) 00114 }; 00115 00116 #endif //TGO4MBSSUBEVENT_H 00117 00118 //----------------------------END OF GO4 SOURCE FILE ---------------------