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

TGo4MbsSubEvent Class Reference

Subevent class for gsi mbs data. More...

#include <TGo4MbsSubEvent.h>

Inheritance diagram for TGo4MbsSubEvent:

TGo4EventElement List of all members.

Public Methods

 TGo4MbsSubEvent ()
 TGo4MbsSubEvent (Int_t datasize)
virtual ~TGo4MbsSubEvent ()
virtual Int_t Fill ()
 Method called by the event owner (analysis step) to fill the event element from the set event source. More...

virtual void Clear (Option_t *t="")
void PrintEvent ()
 Method called by the event owner (analysis step) to clear the event element. More...

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)
void SetDlen (Int_t dlen)
Int_t GetDlen () const
Int_t GetIntLen () const
void SetType (Short_t type)
Short_t GetType () const
void SetSubtype (Short_t subtype)
Short_t GetSubtype () const
void SetProcid (Short_t procid)
Short_t GetProcid () const
void SetSubcrate (Char_t subcrate)
Char_t GetSubcrate () const
void SetControl (Char_t control)
Char_t GetControl () const
Int_t GetAllocatedLength ()
 Return length of allocated memory for data field. More...

Int_t * GetDataField ()
 Direct access to the fiData field pointer. More...

Int_t Data (Int_t i)
 Returns the value at position i in the fiData field. More...

Bool_t IsFilled ()
 true if this subevent was filled since the last Clear(). More...


Private Methods

void ReAllocate (Int_t newsize)
 Allocate the data field with newsize. More...


Private Attributes

Bool_t fbIsFilled
 True if this subevent has already been filled in this event cycle. More...

Bool_t fbIsDataOwner
 True if subevent owns data field. More...

TGo4SubEventHeader10 fxHeader
  More...

Int_t fiAllocLen
 Length of the allocated data field. More...

Int_t * fiData
 Pointer to external integer field containing the subevent data. More...


Friends

class TGo4MbsSource
class TGo4RevServ
class TGo4TreeSource

Detailed Description

Subevent class for gsi mbs data.

Definition at line 27 of file TGo4MbsSubEvent.h.


Constructor & Destructor Documentation

TGo4MbsSubEvent::TGo4MbsSubEvent  
 

Definition at line 24 of file TGo4MbsSubEvent.cxx.

References TRACE.

TGo4MbsSubEvent::TGo4MbsSubEvent Int_t    datasize
 

Definition at line 35 of file TGo4MbsSubEvent.cxx.

References fiAllocLen, fiData, and TRACE.

TGo4MbsSubEvent::~TGo4MbsSubEvent   [virtual]
 

Definition at line 51 of file TGo4MbsSubEvent.cxx.

References Clear(), TGo4Log::Debug(), fiData, GetAllocatedLength(), and TRACE.


Member Function Documentation

virtual Int_t TGo4MbsSubEvent::Fill   [inline, virtual]
 

Method called by the event owner (analysis step) to fill the event element from the set event source.

Event source can be the source of the analysis step (if this is a raw event) or the event processor (if this is a reduced event). Fill method has to specify how the event source writes to the members of this event structure. Either by calling methods of the source (like myevent.a=fxEventSource->GetA(); etc ), or by direct copy to the member (like fxEventSource->FillMemoryAt(&myevent.a);)

Reimplemented from TGo4EventElement.

Definition at line 41 of file TGo4MbsSubEvent.h.

void TGo4MbsSubEvent::Clear Option_t *    t = "" [virtual]
 

Reimplemented from TGo4EventElement.

Definition at line 139 of file TGo4MbsSubEvent.cxx.

References TGo4SubEventHeader10::Clear(), fbIsFilled, TGo4MbsSource::fguLONGBYSHORT, fiAllocLen, fiData, fxHeader, GetDlen(), Set(), and TRACE.

Referenced by TGo4MbsEvent::Clear(), ReAllocate(), and ~TGo4MbsSubEvent().

void TGo4MbsSubEvent::PrintEvent   [virtual]
 

Method called by the event owner (analysis step) to clear the event element.

Reimplemented from TGo4EventElement.

Definition at line 72 of file TGo4MbsSubEvent.cxx.

References GetControl(), GetDataField(), GetDlen(), GetProcid(), GetSubcrate(), GetSubtype(), GetType(), i, and TRACE.

Referenced by TGo4MbsEvent::PrintEvent().

void TGo4MbsSubEvent::Set Int_t    dlen,
Short_t    type = 10,
Short_t    subtype = 1,
Short_t    procid = 0,
Char_t    subcrate = 0,
Char_t    ctrl = 0
 

Definition at line 124 of file TGo4MbsSubEvent.cxx.

References SetDlen(), SetSubtype(), and SetType().

Referenced by Clear().

void TGo4MbsSubEvent::SetDlen Int_t    dlen [inline]
 

Definition at line 50 of file TGo4MbsSubEvent.h.

References TGo4GSIEventHeader::fiDlen, TGo4SubEventHeader10::fxGSIHeader, and fxHeader.

Referenced by TGo4MbsSource::BuildMbsEvent(), and Set().

Int_t TGo4MbsSubEvent::GetDlen   const [inline]
 

Definition at line 51 of file TGo4MbsSubEvent.h.

References TGo4GSIEventHeader::fiDlen, TGo4SubEventHeader10::fxGSIHeader, and fxHeader.

Referenced by TGo4SimpleEventProcessor::BuildSimpleEvent(), Clear(), TXXXProc::Event(), GetIntLen(), PrintEvent(), TMeshUnpackProc::UnpackBranch1(), TMeshUnpackProc::UnpackBranch2(), TMeshUnpackProc::UnpackBranch3(), and TXXXUnpackProc::XXXUnpack().

Int_t TGo4MbsSubEvent::GetIntLen   const [inline]
 

Definition at line 52 of file TGo4MbsSubEvent.h.

References GetDlen().

void TGo4MbsSubEvent::SetType Short_t    type [inline]
 

Definition at line 54 of file TGo4MbsSubEvent.h.

References TGo4GSIEventHeader::fsType, TGo4SubEventHeader10::fxGSIHeader, and fxHeader.

Referenced by TGo4MbsSource::BuildMbsEvent(), and Set().

Short_t TGo4MbsSubEvent::GetType   const [inline]
 

Definition at line 55 of file TGo4MbsSubEvent.h.

References TGo4GSIEventHeader::fsType, TGo4SubEventHeader10::fxGSIHeader, and fxHeader.

Referenced by PrintEvent().

void TGo4MbsSubEvent::SetSubtype Short_t    subtype [inline]
 

Definition at line 57 of file TGo4MbsSubEvent.h.

References TGo4GSIEventHeader::fsSubtype, TGo4SubEventHeader10::fxGSIHeader, and fxHeader.

Referenced by TGo4MbsSource::BuildMbsEvent(), and Set().

Short_t TGo4MbsSubEvent::GetSubtype   const [inline]
 

Definition at line 58 of file TGo4MbsSubEvent.h.

References TGo4GSIEventHeader::fsSubtype, TGo4SubEventHeader10::fxGSIHeader, and fxHeader.

Referenced by PrintEvent().

void TGo4MbsSubEvent::SetProcid Short_t    procid [inline]
 

Definition at line 60 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fsProcid, and fxHeader.

Referenced by TGo4MbsSource::BuildMbsEvent(), and TGo4MbsEvent::TGo4MbsEvent().

Short_t TGo4MbsSubEvent::GetProcid   const [inline]
 

Definition at line 61 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fsProcid, and fxHeader.

Referenced by TGo4SimpleEventProcessor::BuildSimpleEvent(), TGo4MbsEvent::GetSubEvent(), and PrintEvent().

void TGo4MbsSubEvent::SetSubcrate Char_t    subcrate [inline]
 

Definition at line 63 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fcSubcrate, and fxHeader.

Referenced by TGo4MbsSource::BuildMbsEvent(), and TGo4MbsEvent::TGo4MbsEvent().

Char_t TGo4MbsSubEvent::GetSubcrate   const [inline]
 

Definition at line 64 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fcSubcrate, and fxHeader.

Referenced by TXXXProc::Event(), TGo4MbsEvent::GetSubEvent(), PrintEvent(), TMeshUnpackProc::UnpackBranch1(), TMeshUnpackProc::UnpackBranch2(), TMeshUnpackProc::UnpackBranch3(), and TXXXUnpackProc::XXXUnpack().

void TGo4MbsSubEvent::SetControl Char_t    control [inline]
 

Definition at line 66 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fcControl, and fxHeader.

Referenced by TGo4MbsSource::BuildMbsEvent(), and TGo4MbsEvent::TGo4MbsEvent().

Char_t TGo4MbsSubEvent::GetControl   const [inline]
 

Definition at line 67 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fcControl, and fxHeader.

Referenced by TGo4MbsEvent::GetSubEvent(), and PrintEvent().

Int_t TGo4MbsSubEvent::GetAllocatedLength   [inline]
 

Return length of allocated memory for data field.

Definition at line 70 of file TGo4MbsSubEvent.h.

References fiAllocLen.

Referenced by Data(), and ~TGo4MbsSubEvent().

Int_t* TGo4MbsSubEvent::GetDataField   [inline]
 

Direct access to the fiData field pointer.

User has to care about allocated range as specified in fiAllocLen.

Definition at line 74 of file TGo4MbsSubEvent.h.

References fiData.

Referenced by TGo4SimpleEventProcessor::BuildSimpleEvent(), TXXXProc::Event(), PrintEvent(), TMeshUnpackProc::UnpackBranch1(), TMeshUnpackProc::UnpackBranch2(), TMeshUnpackProc::UnpackBranch3(), and TXXXUnpackProc::XXXUnpack().

Int_t TGo4MbsSubEvent::Data Int_t    i [inline]
 

Returns the value at position i in the fiData field.

If Index i is out of DLen range, zero is returned.

Definition at line 78 of file TGo4MbsSubEvent.h.

References fiData, GetAllocatedLength(), and i.

Referenced by main().

Bool_t TGo4MbsSubEvent::IsFilled   [inline]
 

true if this subevent was filled since the last Clear().

Definition at line 82 of file TGo4MbsSubEvent.h.

References fbIsFilled.

Referenced by TGo4MbsEvent::NextSubEvent().

void TGo4MbsSubEvent::ReAllocate Int_t    newsize [private]
 

Allocate the data field with newsize.

Free the previously allocated field before, and set new fiAllocLen value.

Definition at line 168 of file TGo4MbsSubEvent.cxx.

References Clear(), TGo4Log::Debug(), fbIsDataOwner, fiAllocLen, fiData, and TRACE.

Referenced by TGo4MbsSource::BuildMbsEvent().


Friends And Related Function Documentation

friend class TGo4MbsSource [friend]
 

Definition at line 29 of file TGo4MbsSubEvent.h.

friend class TGo4RevServ [friend]
 

Definition at line 30 of file TGo4MbsSubEvent.h.

friend class TGo4TreeSource [friend]
 

Definition at line 31 of file TGo4MbsSubEvent.h.


Member Data Documentation

Bool_t TGo4MbsSubEvent::fbIsFilled [private]
 

True if this subevent has already been filled in this event cycle.

For subsequent subevents of identical header ids, prevents overwriting.

Definition at line 92 of file TGo4MbsSubEvent.h.

Referenced by TGo4MbsSource::BuildMbsEvent(), Clear(), and IsFilled().

Bool_t TGo4MbsSubEvent::fbIsDataOwner [private]
 

True if subevent owns data field.

Definition at line 95 of file TGo4MbsSubEvent.h.

Referenced by TGo4MbsSource::BuildMbsEvent(), and ReAllocate().

TGo4SubEventHeader10 TGo4MbsSubEvent::fxHeader [private]
 

Definition at line 98 of file TGo4MbsSubEvent.h.

Referenced by TGo4MbsSource::BuildMbsEvent(), Clear(), GetControl(), GetDlen(), GetProcid(), GetSubcrate(), GetSubtype(), GetType(), SetControl(), SetDlen(), SetProcid(), SetSubcrate(), SetSubtype(), and SetType().

Int_t TGo4MbsSubEvent::fiAllocLen [private]
 

Length of the allocated data field.

Is _not_ equal to the subevent data length which can be smaller. On filling the subevent, it is tested if the source data fits into the already allocated field; if the source data is larger, we will re-allocate the field with the larger size before filling it. If the source data is smaller, we leave the data field as is and use only the first DLen words.

Definition at line 108 of file TGo4MbsSubEvent.h.

Referenced by TGo4MbsSource::BuildMbsEvent(), Clear(), GetAllocatedLength(), ReAllocate(), and TGo4MbsSubEvent().

Int_t* TGo4MbsSubEvent::fiData [private]
 

Pointer to external integer field containing the subevent data.

Length of this field may be changed dynamically depending on the maximum length of the incoming subevent of this type.

Definition at line 114 of file TGo4MbsSubEvent.h.

Referenced by TGo4MbsSource::BuildMbsEvent(), Clear(), Data(), GetDataField(), ReAllocate(), TGo4MbsSubEvent(), and ~TGo4MbsSubEvent().


The documentation for this class was generated from the following files:
Generated on Tue Nov 8 10:56:47 2005 for Go4-v2.10-5 by doxygen1.2.15