GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
TGo4MbsSubEvent Class Reference

#include <TGo4MbsSubEvent.h>

+ Inheritance diagram for TGo4MbsSubEvent:

Public Member Functions

 TGo4MbsSubEvent ()
 
 TGo4MbsSubEvent (Int_t datasize)
 
virtual ~TGo4MbsSubEvent ()
 
Int_t Fill () override
 
void Clear (Option_t *opt="") override
 
void PrintEvent () override
 
void PrintMbsSubevent (Bool_t longw=kTRUE, Bool_t hexw=kTRUE, Bool_t dataw=kTRUE)
 
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 GetByteLen () 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
 
void SetFullId (Int_t fullid)
 
Int_t GetFullId () const
 
Int_t GetAllocatedLength () const
 
Int_t * GetDataField () const
 
Int_t Data (Int_t i) const
 
Bool_t IsFilled () const
 
- Public Member Functions inherited from TGo4EventElement
 TGo4EventElement ()
 
 TGo4EventElement (const char *name)
 
 TGo4EventElement (const char *aName, const char *aTitle, Short_t aBaseCat=0)
 
virtual ~TGo4EventElement ()
 
void SetValid (Bool_t on)
 
Bool_t IsValid () const
 
void SetEventSource (TGo4EventSource *src)
 
void SetParent (TGo4EventElement *par)
 
void SetKeepContents (Bool_t on=kTRUE)
 
TGo4EventElementGetParent () const
 
virtual TGo4EventElementGetChild (const char *name)
 
TGo4EventSourceGetEventSource () const
 
Bool_t CheckEventSource (const char *classname)
 
virtual Int_t Init ()
 
virtual void makeBranch (TBranch *parent)
 
virtual void deactivate ()
 
virtual void activate ()
 
void Clear (Option_t *opt="") override
 
virtual void clearAll (Int_t)
 
virtual Bool_t isComposed ()
 
virtual Short_t getId ()
 
virtual void setDebug (Bool_t debug)
 
virtual TGo4EventElementoperator[] (Int_t)
 
void Print (Option_t *option="") const override
 
virtual void synchronizeWithTree (TTree *tree, TGo4EventElement **var_ptr=nullptr)
 
virtual Int_t activateBranch (TBranch *branch, Int_t index=0, TGo4EventElement **var_ptr=nullptr)
 
virtual TTree * CreateSampleTree (TGo4EventElement **sample=nullptr)
 
void ShowSampleTree ()
 

Private Member Functions

void ReAllocate (Int_t newsize)
 

Private Attributes

Bool_t fbIsFilled {kFALSE}
 
Bool_t fbIsDataOwner {kFALSE}
 
TGo4SubEventHeader10 fxHeader
 
Int_t fiAllocLen {0}
 
Int_t * fiData {nullptr}
 

Friends

class TGo4MbsSource
 
class TGo4MbsEvent
 

Additional Inherited Members

- Protected Attributes inherited from TGo4EventElement
Short_t fIdentifier {-1}
 
Bool_t fDebug {kFALSE}
 
Bool_t fbKeepContents {kFALSE}
 Debug level. More...
 

Detailed Description

Subevent class for gsi mbs data.

Definition at line 24 of file TGo4MbsSubEvent.h.

Constructor & Destructor Documentation

◆ TGo4MbsSubEvent() [1/2]

TGo4MbsSubEvent::TGo4MbsSubEvent ( )

Definition at line 19 of file TGo4MbsSubEvent.cxx.

References GO4TRACE.

◆ TGo4MbsSubEvent() [2/2]

TGo4MbsSubEvent::TGo4MbsSubEvent ( Int_t  datasize)

Definition at line 31 of file TGo4MbsSubEvent.cxx.

References fbIsDataOwner, fiAllocLen, fiData, and GO4TRACE.

◆ ~TGo4MbsSubEvent()

TGo4MbsSubEvent::~TGo4MbsSubEvent ( )
virtual

Member Function Documentation

◆ Clear()

void TGo4MbsSubEvent::Clear ( Option_t *  opt = "")
override

◆ Data()

Int_t TGo4MbsSubEvent::Data ( Int_t  i) const
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 90 of file TGo4MbsSubEvent.h.

References fiData, and GetAllocatedLength().

Referenced by main().

◆ Fill()

Int_t TGo4MbsSubEvent::Fill ( )
inlineoverridevirtual

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.

References Clear(), PrintEvent(), PrintMbsSubevent(), and Set().

◆ GetAllocatedLength()

Int_t TGo4MbsSubEvent::GetAllocatedLength ( ) const
inline

Return length of allocated memory for data field.

Definition at line 82 of file TGo4MbsSubEvent.h.

References fiAllocLen.

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

◆ GetByteLen()

Int_t TGo4MbsSubEvent::GetByteLen ( ) const
inline

Return raw data length in bytes

Definition at line 58 of file TGo4MbsSubEvent.h.

References GetDlen().

Referenced by GetIntLen().

◆ GetControl()

Char_t TGo4MbsSubEvent::GetControl ( ) const
inline

Definition at line 76 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fcControl, and fxHeader.

Referenced by TGo4MbsEvent::AddSubEvent(), and PrintMbsSubevent().

◆ GetDataField()

Int_t* TGo4MbsSubEvent::GetDataField ( ) const
inline

Direct access to the fiData field pointer. User has to care about allocated range as specified in fiAllocLen.

Definition at line 86 of file TGo4MbsSubEvent.h.

References fiData.

Referenced by PrintMbsSubevent().

◆ GetDlen()

Int_t TGo4MbsSubEvent::GetDlen ( ) const
inline

◆ GetFullId()

Int_t TGo4MbsSubEvent::GetFullId ( ) const
inline

Definition at line 79 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fiFullid, and fxHeader.

◆ GetIntLen()

Int_t TGo4MbsSubEvent::GetIntLen ( ) const
inline

Return raw data length in int (4-bytes)

Definition at line 61 of file TGo4MbsSubEvent.h.

References GetByteLen().

Referenced by PrintMbsSubevent().

◆ GetProcid()

Short_t TGo4MbsSubEvent::GetProcid ( ) const
inline

Definition at line 70 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fsProcid, and fxHeader.

Referenced by TGo4MbsEvent::AddSubEvent(), and PrintMbsSubevent().

◆ GetSubcrate()

Char_t TGo4MbsSubEvent::GetSubcrate ( ) const
inline

Definition at line 73 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fcSubcrate, and fxHeader.

Referenced by TGo4MbsEvent::AddSubEvent(), and PrintMbsSubevent().

◆ GetSubtype()

Short_t TGo4MbsSubEvent::GetSubtype ( ) const
inline

◆ GetType()

Short_t TGo4MbsSubEvent::GetType ( ) const
inline

◆ IsFilled()

Bool_t TGo4MbsSubEvent::IsFilled ( ) const
inline

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

Definition at line 93 of file TGo4MbsSubEvent.h.

References fbIsFilled, and ReAllocate().

Referenced by TGo4MbsEvent::NextSubEvent().

◆ PrintEvent()

void TGo4MbsSubEvent::PrintEvent ( )
overridevirtual

Print event with default arguments

Reimplemented from TGo4EventElement.

Definition at line 64 of file TGo4MbsSubEvent.cxx.

References GO4TRACE, and PrintMbsSubevent().

Referenced by Fill().

◆ PrintMbsSubevent()

void TGo4MbsSubEvent::PrintMbsSubevent ( Bool_t  longw = kTRUE,
Bool_t  hexw = kTRUE,
Bool_t  dataw = kTRUE 
)

Print MBS subevent

Parameters
longw- data in long format (4 bytes)
hexw- print in hex format
dataw- print raw data

Definition at line 93 of file TGo4MbsSubEvent.cxx.

References GetControl(), GetDataField(), GetDlen(), GetIntLen(), GetProcid(), GetSubcrate(), GetSubtype(), GetType(), and l.

Referenced by Fill(), and PrintEvent().

◆ ReAllocate()

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 176 of file TGo4MbsSubEvent.cxx.

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

Referenced by TGo4MbsEvent::AddSubEvent(), and IsFilled().

◆ Set()

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 138 of file TGo4MbsSubEvent.cxx.

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

Referenced by Clear(), and Fill().

◆ SetControl()

void TGo4MbsSubEvent::SetControl ( Char_t  control)
inline

◆ SetDlen()

void TGo4MbsSubEvent::SetDlen ( Int_t  dlen)
inline

◆ SetFullId()

void TGo4MbsSubEvent::SetFullId ( Int_t  fullid)
inline

Definition at line 78 of file TGo4MbsSubEvent.h.

References TGo4SubEventHeader10::fiFullid, and fxHeader.

◆ SetProcid()

void TGo4MbsSubEvent::SetProcid ( Short_t  procid)
inline

◆ SetSubcrate()

void TGo4MbsSubEvent::SetSubcrate ( Char_t  subcrate)
inline

◆ SetSubtype()

void TGo4MbsSubEvent::SetSubtype ( Short_t  subtype)
inline

◆ SetType()

void TGo4MbsSubEvent::SetType ( Short_t  type)
inline

Friends And Related Function Documentation

◆ TGo4MbsEvent

friend class TGo4MbsEvent
friend

Definition at line 27 of file TGo4MbsSubEvent.h.

◆ TGo4MbsSource

friend class TGo4MbsSource
friend

Definition at line 26 of file TGo4MbsSubEvent.h.

Member Data Documentation

◆ fbIsDataOwner

Bool_t TGo4MbsSubEvent::fbIsDataOwner {kFALSE}
private

True if subevent owns data field. note that this should not be streamed to root file!

Definition at line 107 of file TGo4MbsSubEvent.h.

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

◆ fbIsFilled

Bool_t TGo4MbsSubEvent::fbIsFilled {kFALSE}
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 103 of file TGo4MbsSubEvent.h.

Referenced by TGo4MbsEvent::AddSubEvent(), Clear(), and IsFilled().

◆ fiAllocLen

Int_t TGo4MbsSubEvent::fiAllocLen {0}
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 120 of file TGo4MbsSubEvent.h.

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

◆ fiData

Int_t* TGo4MbsSubEvent::fiData {nullptr}
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 126 of file TGo4MbsSubEvent.h.

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

◆ fxHeader

TGo4SubEventHeader10 TGo4MbsSubEvent::fxHeader
private

The documentation for this class was generated from the following files: