Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class 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 Member Functions

 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.
virtual void Clear (Option_t *t="")
void PrintEvent ()
 Method called by the event owner (analysis step) to clear the event element.
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.
Int_t * GetDataField ()
 Direct access to the fiData field pointer.
Int_t Data (Int_t i)
 Returns the value at position i in the fiData field.
Bool_t IsFilled ()
 true if this subevent was filled since the last Clear()

Private Member Functions

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

Private Attributes

Bool_t fbIsFilled
 True if this subevent has already been filled in this event cycle.
Bool_t fbIsDataOwner
 True if subevent owns data field.
TGo4SubEventHeader10 fxHeader
 
Int_t fiAllocLen
 Length of the allocated data field.
Int_t * fiData
 Pointer to external integer field containing the subevent data.

Friends

class TGo4MbsSource

Detailed Description

Subevent class for gsi mbs data.

Definition at line 24 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 fbIsDataOwner, fiAllocLen, fiData, and TRACE.

TGo4MbsSubEvent::~TGo4MbsSubEvent  )  [virtual]
 

Definition at line 50 of file TGo4MbsSubEvent.cxx.

References Clear(), TGo4Log::Debug(), fbIsDataOwner, 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 38 of file TGo4MbsSubEvent.h.

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

Reimplemented from TGo4EventElement.

Definition at line 138 of file TGo4MbsSubEvent.cxx.

References TGo4SubEventHeader10::Clear(), fbIsDataOwner, 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 71 of file TGo4MbsSubEvent.cxx.

References GetControl(), GetDataField(), GetDlen(), GetProcid(), GetSubcrate(), GetSubtype(), GetType(), 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 123 of file TGo4MbsSubEvent.cxx.

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

Referenced by Clear().

void TGo4MbsSubEvent::SetDlen Int_t  dlen  )  [inline]
 

Definition at line 47 of file TGo4MbsSubEvent.h.

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

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

Int_t TGo4MbsSubEvent::GetDlen  )  const [inline]
 

Definition at line 48 of file TGo4MbsSubEvent.h.

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

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

Int_t TGo4MbsSubEvent::GetIntLen  )  const [inline]
 

Definition at line 49 of file TGo4MbsSubEvent.h.

References GetDlen().

Referenced by TXXXProc::BuildEvent(), and TXXXUnpackProc::XXXUnpack().

void TGo4MbsSubEvent::SetType Short_t  type  )  [inline]
 

Definition at line 51 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 52 of file TGo4MbsSubEvent.h.

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

Referenced by PrintEvent().

void TGo4MbsSubEvent::SetSubtype Short_t  subtype  )  [inline]
 

Definition at line 54 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 55 of file TGo4MbsSubEvent.h.

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

Referenced by PrintEvent().

void TGo4MbsSubEvent::SetProcid Short_t  procid  )  [inline]
 

Definition at line 57 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fsProcid, and fxHeader.

Referenced by TGo4MbsEvent::TGo4MbsEvent().

Short_t TGo4MbsSubEvent::GetProcid  )  const [inline]
 

Definition at line 58 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fsProcid, and fxHeader.

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

void TGo4MbsSubEvent::SetSubcrate Char_t  subcrate  )  [inline]
 

Definition at line 60 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fcSubcrate, and fxHeader.

Referenced by TGo4MbsEvent::TGo4MbsEvent().

Char_t TGo4MbsSubEvent::GetSubcrate  )  const [inline]
 

Definition at line 61 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fcSubcrate, and fxHeader.

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

void TGo4MbsSubEvent::SetControl Char_t  control  )  [inline]
 

Definition at line 63 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fcControl, and fxHeader.

Referenced by TGo4MbsEvent::TGo4MbsEvent().

Char_t TGo4MbsSubEvent::GetControl  )  const [inline]
 

Definition at line 64 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fcControl, and fxHeader.

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

Int_t TGo4MbsSubEvent::GetAllocatedLength  )  [inline]
 

Return length of allocated memory for data field.

Definition at line 67 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 71 of file TGo4MbsSubEvent.h.

References fiData.

Referenced by TXXXProc::BuildEvent(), TGo4SimpleEventProcessor::BuildSimpleEvent(), 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 75 of file TGo4MbsSubEvent.h.

References fiData, and GetAllocatedLength().

Bool_t TGo4MbsSubEvent::IsFilled  )  [inline]
 

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

Definition at line 79 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 167 of file TGo4MbsSubEvent.cxx.

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

Referenced by TGo4MbsSource::BuildMbsSubEvent().


Friends And Related Function Documentation

friend class TGo4MbsSource [friend]
 

Definition at line 26 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 89 of file TGo4MbsSubEvent.h.

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

Bool_t TGo4MbsSubEvent::fbIsDataOwner [private]
 

True if subevent owns data field.

Definition at line 92 of file TGo4MbsSubEvent.h.

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

TGo4SubEventHeader10 TGo4MbsSubEvent::fxHeader [private]
 

Definition at line 95 of file TGo4MbsSubEvent.h.

Referenced by TGo4MbsSource::BuildMbsSubEvent(), 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 105 of file TGo4MbsSubEvent.h.

Referenced by TGo4MbsSource::BuildMbsSubEvent(), 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 111 of file TGo4MbsSubEvent.h.

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


The documentation for this class was generated from the following files:
Generated on Fri Nov 28 13:01:06 2008 for Go4-v3.04-1 by  doxygen 1.4.2