Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4EventServer/TGo4MbsSubEvent.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE 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 "Go4Event/TGo4EventElement.h"
00020 
00021 #include "Go4Log/TGo4Log.h"
00022 #include "Go4Exceptions/Go4Exceptions.h"
00023 
00024 #include "TGo4SubEventHeader10.h"
00025 
00027 class TGo4MbsSubEvent : public TGo4EventElement {
00028 
00029   friend class TGo4MbsSource;
00030   friend class TGo4RevServ;
00031   friend class TGo4TreeSource;
00032   
00033   public:
00034     // should be only used by ROOT streaming, but public otherwise ROOT problems!
00035     TGo4MbsSubEvent();
00036 
00037     TGo4MbsSubEvent(Int_t datasize);
00038 
00039     virtual ~TGo4MbsSubEvent();
00040 
00041     virtual Int_t Fill(){return -1; }// method not used
00042 
00043     virtual void Clear(Option_t *t="");
00044 
00045     void PrintEvent();
00046 
00047     void Set(Int_t dlen, Short_t type=10, Short_t subtype=1,
00048              Short_t procid=0, Char_t subcrate=0, Char_t ctrl=0);
00049 
00050     void  SetDlen(Int_t dlen) { fxHeader.fxGSIHeader.fiDlen = dlen; }
00051     Int_t  GetDlen() const { return fxHeader.fxGSIHeader.fiDlen; }
00052     Int_t  GetIntLen() const { return (GetDlen()-2)*sizeof(Short_t)/sizeof(Int_t); }
00053 
00054     void  SetType(Short_t type) { fxHeader.fxGSIHeader.fsType  = type; }
00055     Short_t GetType() const { return fxHeader.fxGSIHeader.fsType; }
00056 
00057     void  SetSubtype(Short_t subtype) { fxHeader.fxGSIHeader.fsSubtype = subtype; }
00058     Short_t GetSubtype() const { return fxHeader.fxGSIHeader.fsSubtype; }
00059 
00060     void  SetProcid(Short_t procid) { fxHeader.fsProcid = procid; }
00061     Short_t GetProcid() const { return fxHeader.fsProcid; }
00062 
00063     void  SetSubcrate(Char_t subcrate) { fxHeader.fcSubcrate = subcrate; }
00064     Char_t GetSubcrate() const { return fxHeader.fcSubcrate; }
00065 
00066     void  SetControl(Char_t control) { fxHeader.fcControl = control; }
00067     Char_t GetControl() const { return fxHeader.fcControl; }
00068 
00070     Int_t GetAllocatedLength() { return fiAllocLen; }
00071 
00074     Int_t* GetDataField() { return fiData; }
00075 
00078     Int_t Data(Int_t i)
00079      { return ((i<0) || (i>=GetAllocatedLength())) ? 0 : fiData[i]; }
00080 
00082      Bool_t IsFilled() { return fbIsFilled; }
00083 
00084   private:
00085 
00088     void ReAllocate(Int_t newsize);
00089 
00092     Bool_t fbIsFilled;
00093 
00095     Bool_t fbIsDataOwner;
00096 
00098     TGo4SubEventHeader10 fxHeader;
00099 
00108     Int_t fiAllocLen;
00109 
00114     Int_t* fiData; //[fiAllocLen]
00115 
00116   ClassDef(TGo4MbsSubEvent,1)
00117 };
00118 
00119 #endif //TGO4MBSSUBEVENT_H
00120 
00121 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:54 2005 for Go4-v2.10-5 by doxygen1.2.15