GSI Object Oriented Online Offline (Go4) GO4-6.4.5
Loading...
Searching...
No Matches
TGo4MbsSubEvent Class Reference

Subevent class for gsi mbs data. More...

#include <TGo4MbsSubEvent.h>

Inheritance diagram for TGo4MbsSubEvent:

Public Member Functions

 TGo4MbsSubEvent ()
 TGo4MbsSubEvent ()
 TGo4MbsSubEvent (Int_t datasize)
 TGo4MbsSubEvent (Int_t datasize)
virtual ~TGo4MbsSubEvent ()
virtual ~TGo4MbsSubEvent ()
void Clear (Option_t *opt="") override
void Clear (Option_t *opt="") override
Int_t Data (Int_t i) const
 Returns the value at position i in the fiData field.
Int_t Data (Int_t i) const
 Returns the value at position i in the fiData field.
Int_t Fill () override
 Method called by the event owner (analysis step) to fill the event element from the set event source.
Int_t Fill () override
 Method called by the event owner (analysis step) to fill the event element from the set event source.
Int_t GetAllocatedLength () const
 Return length of allocated memory for data field.
Int_t GetAllocatedLength () const
 Return length of allocated memory for data field.
Int_t GetByteLen () const
 Return raw data length in bytes.
Int_t GetByteLen () const
 Return raw data length in bytes.
Char_t GetControl () const
Char_t GetControl () const
Int_t * GetDataField () const
 Direct access to the fiData field pointer.
Int_t * GetDataField () const
 Direct access to the fiData field pointer.
Int_t GetDlen () const
Int_t GetDlen () const
Int_t GetFullId () const
Int_t GetFullId () const
Int_t GetIntLen () const
 Return raw data length in int (4-bytes).
Int_t GetIntLen () const
 Return raw data length in int (4-bytes).
Short_t GetProcid () const
Short_t GetProcid () const
Char_t GetSubcrate () const
Char_t GetSubcrate () const
Short_t GetSubtype () const
Short_t GetSubtype () const
Short_t GetType () const
Short_t GetType () const
Bool_t IsFilled () const
 true if this subevent was filled since the last Clear()
Bool_t IsFilled () const
 true if this subevent was filled since the last Clear()
void PrintEvent () override
 Print event with default arguments.
void PrintEvent () override
 Print event with default arguments.
void PrintMbsSubevent (Bool_t longw=kTRUE, Bool_t hexw=kTRUE, Bool_t dataw=kTRUE)
 Print MBS subevent.
void PrintMbsSubevent (Bool_t longw=kTRUE, Bool_t hexw=kTRUE, Bool_t dataw=kTRUE)
 Print MBS subevent.
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 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 SetControl (Char_t control)
void SetControl (Char_t control)
void SetDlen (Int_t dlen)
void SetDlen (Int_t dlen)
void SetFullId (Int_t fullid)
void SetFullId (Int_t fullid)
void SetProcid (Short_t procid)
void SetProcid (Short_t procid)
void SetSubcrate (Char_t subcrate)
void SetSubcrate (Char_t subcrate)
void SetSubtype (Short_t subtype)
void SetSubtype (Short_t subtype)
void SetType (Short_t type)
void SetType (Short_t type)
Public Member Functions inherited from TGo4EventElement
 TGo4EventElement ()
 TGo4EventElement ()
 TGo4EventElement (const char *aName, const char *aTitle, Short_t aBaseCat=0)
 TGo4EventElement (const char *aName, const char *aTitle, Short_t aBaseCat=0)
 TGo4EventElement (const char *name)
 TGo4EventElement (const char *name)
virtual ~TGo4EventElement ()
virtual ~TGo4EventElement ()
virtual void activate ()
virtual void activate ()
virtual Int_t activateBranch (TBranch *branch, Int_t index=0, TGo4EventElement **var_ptr=nullptr)
virtual Int_t activateBranch (TBranch *branch, Int_t index=0, TGo4EventElement **var_ptr=nullptr)
Bool_t CheckEventSource (const char *classname)
 Check if event source is valid.
Bool_t CheckEventSource (const char *classname)
 Check if event source is valid.
void Clear (Option_t *opt="") override
void Clear (Option_t *opt="") override
virtual void clearAll (Int_t)
virtual void clearAll (Int_t)
virtual TTree * CreateSampleTree (TGo4EventElement **sample=nullptr)
virtual TTree * CreateSampleTree (TGo4EventElement **sample=nullptr)
virtual void deactivate ()
virtual void deactivate ()
virtual TGo4EventElementGetChild (const char *name)
virtual TGo4EventElementGetChild (const char *name)
TGo4EventSourceGetEventSource () const
TGo4EventSourceGetEventSource () const
virtual Short_t getId ()
virtual Short_t getId ()
TGo4EventElementGetParent () const
TGo4EventElementGetParent () const
virtual Int_t Init ()
 Method called on initialization of event classes.
virtual Int_t Init ()
 Method called on initialization of event classes.
virtual Bool_t isComposed ()
virtual Bool_t isComposed ()
Bool_t IsValid () const
 Returns the valid state of this event.
Bool_t IsValid () const
 Returns the valid state of this event.
virtual void makeBranch (TBranch *parent)
virtual void makeBranch (TBranch *parent)
virtual TGo4EventElementoperator[] (Int_t)
virtual TGo4EventElementoperator[] (Int_t)
void Print (Option_t *option="") const override
void Print (Option_t *option="") const override
virtual void setDebug (Bool_t debug)
virtual void setDebug (Bool_t debug)
void SetEventSource (TGo4EventSource *src)
 Setter for the event source that is currently used by the Fill method.
void SetEventSource (TGo4EventSource *src)
 Setter for the event source that is currently used by the Fill method.
void SetKeepContents (Bool_t on=kTRUE)
void SetKeepContents (Bool_t on=kTRUE)
void SetParent (TGo4EventElement *par)
 Setter for the parent event structure reference.
void SetParent (TGo4EventElement *par)
 Setter for the parent event structure reference.
void SetValid (Bool_t on)
 Switches the valid state of this event.
void SetValid (Bool_t on)
 Switches the valid state of this event.
void ShowSampleTree ()
void ShowSampleTree ()
virtual void synchronizeWithTree (TTree *tree, TGo4EventElement **var_ptr=nullptr)
 Use this method to map event structure with the Tree branch(es).
virtual void synchronizeWithTree (TTree *tree, TGo4EventElement **var_ptr=nullptr)
 Use this method to map event structure with the Tree branch(es).

Private Member Functions

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

Private Attributes

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

Friends

class TGo4MbsEvent
class TGo4MbsSource

Additional Inherited Members

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

Detailed Description

Subevent class for gsi mbs data.

Definition at line 26 of file TGo4MbsSubEvent.h.

Constructor & Destructor Documentation

◆ TGo4MbsSubEvent() [1/4]

TGo4MbsSubEvent::TGo4MbsSubEvent ( )

◆ TGo4MbsSubEvent() [2/4]

TGo4MbsSubEvent::TGo4MbsSubEvent ( Int_t datasize)

◆ ~TGo4MbsSubEvent() [1/2]

TGo4MbsSubEvent::~TGo4MbsSubEvent ( )
virtual

◆ TGo4MbsSubEvent() [3/4]

TGo4MbsSubEvent::TGo4MbsSubEvent ( )

◆ TGo4MbsSubEvent() [4/4]

TGo4MbsSubEvent::TGo4MbsSubEvent ( Int_t datasize)

◆ ~TGo4MbsSubEvent() [2/2]

virtual TGo4MbsSubEvent::~TGo4MbsSubEvent ( )
virtual

Member Function Documentation

◆ Clear() [1/2]

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

◆ Clear() [2/2]

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

◆ Data() [1/2]

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 92 of file TGo4MbsSubEvent.h.

References fiData, and GetAllocatedLength().

Referenced by main().

◆ Data() [2/2]

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 92 of file TGo4MbsSubEvent.h.

References fiData, and GetAllocatedLength().

◆ Fill() [1/2]

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 40 of file TGo4MbsSubEvent.h.

◆ Fill() [2/2]

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 40 of file TGo4MbsSubEvent.h.

◆ GetAllocatedLength() [1/2]

Int_t TGo4MbsSubEvent::GetAllocatedLength ( ) const
inline

Return length of allocated memory for data field.

Definition at line 84 of file TGo4MbsSubEvent.h.

References fiAllocLen.

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

◆ GetAllocatedLength() [2/2]

Int_t TGo4MbsSubEvent::GetAllocatedLength ( ) const
inline

Return length of allocated memory for data field.

Definition at line 84 of file TGo4MbsSubEvent.h.

References fiAllocLen.

◆ GetByteLen() [1/2]

Int_t TGo4MbsSubEvent::GetByteLen ( ) const
inline

Return raw data length in bytes.

Definition at line 60 of file TGo4MbsSubEvent.h.

References GetDlen().

Referenced by GetIntLen().

◆ GetByteLen() [2/2]

Int_t TGo4MbsSubEvent::GetByteLen ( ) const
inline

Return raw data length in bytes.

Definition at line 60 of file TGo4MbsSubEvent.h.

References GetDlen().

◆ GetControl() [1/2]

Char_t TGo4MbsSubEvent::GetControl ( ) const
inline

Definition at line 78 of file TGo4MbsSubEvent.h.

References fxHeader.

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

◆ GetControl() [2/2]

Char_t TGo4MbsSubEvent::GetControl ( ) const
inline

Definition at line 78 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ GetDataField() [1/2]

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 88 of file TGo4MbsSubEvent.h.

References fiData.

Referenced by PrintMbsSubevent().

◆ GetDataField() [2/2]

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 88 of file TGo4MbsSubEvent.h.

References fiData.

◆ GetDlen() [1/2]

Int_t TGo4MbsSubEvent::GetDlen ( ) const
inline

Definition at line 57 of file TGo4MbsSubEvent.h.

References fxHeader.

Referenced by Clear(), GetByteLen(), and PrintMbsSubevent().

◆ GetDlen() [2/2]

Int_t TGo4MbsSubEvent::GetDlen ( ) const
inline

Definition at line 57 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ GetFullId() [1/2]

Int_t TGo4MbsSubEvent::GetFullId ( ) const
inline

Definition at line 81 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ GetFullId() [2/2]

Int_t TGo4MbsSubEvent::GetFullId ( ) const
inline

Definition at line 81 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ GetIntLen() [1/2]

Int_t TGo4MbsSubEvent::GetIntLen ( ) const
inline

Return raw data length in int (4-bytes).

Definition at line 63 of file TGo4MbsSubEvent.h.

References GetByteLen().

Referenced by PrintMbsSubevent().

◆ GetIntLen() [2/2]

Int_t TGo4MbsSubEvent::GetIntLen ( ) const
inline

Return raw data length in int (4-bytes).

Definition at line 63 of file TGo4MbsSubEvent.h.

References GetByteLen().

◆ GetProcid() [1/2]

Short_t TGo4MbsSubEvent::GetProcid ( ) const
inline

Definition at line 72 of file TGo4MbsSubEvent.h.

References fxHeader.

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

◆ GetProcid() [2/2]

Short_t TGo4MbsSubEvent::GetProcid ( ) const
inline

Definition at line 72 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ GetSubcrate() [1/2]

Char_t TGo4MbsSubEvent::GetSubcrate ( ) const
inline

Definition at line 75 of file TGo4MbsSubEvent.h.

References fxHeader.

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

◆ GetSubcrate() [2/2]

Char_t TGo4MbsSubEvent::GetSubcrate ( ) const
inline

Definition at line 75 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ GetSubtype() [1/2]

Short_t TGo4MbsSubEvent::GetSubtype ( ) const
inline

Definition at line 69 of file TGo4MbsSubEvent.h.

References fxHeader.

Referenced by PrintMbsSubevent().

◆ GetSubtype() [2/2]

Short_t TGo4MbsSubEvent::GetSubtype ( ) const
inline

Definition at line 69 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ GetType() [1/2]

Short_t TGo4MbsSubEvent::GetType ( ) const
inline

Definition at line 66 of file TGo4MbsSubEvent.h.

References fxHeader.

Referenced by PrintMbsSubevent().

◆ GetType() [2/2]

Short_t TGo4MbsSubEvent::GetType ( ) const
inline

Definition at line 66 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ IsFilled() [1/2]

Bool_t TGo4MbsSubEvent::IsFilled ( ) const
inline

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

Definition at line 95 of file TGo4MbsSubEvent.h.

References fbIsFilled.

Referenced by TGo4MbsEvent::NextSubEvent().

◆ IsFilled() [2/2]

Bool_t TGo4MbsSubEvent::IsFilled ( ) const
inline

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

Definition at line 95 of file TGo4MbsSubEvent.h.

References fbIsFilled.

◆ PrintEvent() [1/2]

void TGo4MbsSubEvent::PrintEvent ( )
overridevirtual

Print event with default arguments.

Reimplemented from TGo4EventElement.

Definition at line 64 of file TGo4MbsSubEvent.cxx.

References GO4TRACE, and PrintMbsSubevent().

◆ PrintEvent() [2/2]

void TGo4MbsSubEvent::PrintEvent ( )
overridevirtual

Print event with default arguments.

Reimplemented from TGo4EventElement.

◆ PrintMbsSubevent() [1/2]

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 PrintEvent().

◆ PrintMbsSubevent() [2/2]

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

◆ ReAllocate() [1/2]

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().

◆ ReAllocate() [2/2]

void TGo4MbsSubEvent::ReAllocate ( Int_t newsize)
private

Allocate the data field with newsize.

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

References fbIsFilled.

◆ Set() [1/2]

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().

◆ Set() [2/2]

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 )

◆ SetControl() [1/2]

void TGo4MbsSubEvent::SetControl ( Char_t control)
inline

Definition at line 77 of file TGo4MbsSubEvent.h.

References fxHeader.

Referenced by TGo4MbsEvent::TGo4MbsEvent(), and TGo4MbsEvent::SimpleInit().

◆ SetControl() [2/2]

void TGo4MbsSubEvent::SetControl ( Char_t control)
inline

Definition at line 77 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ SetDlen() [1/2]

void TGo4MbsSubEvent::SetDlen ( Int_t dlen)
inline

Definition at line 56 of file TGo4MbsSubEvent.h.

References fxHeader.

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

◆ SetDlen() [2/2]

void TGo4MbsSubEvent::SetDlen ( Int_t dlen)
inline

Definition at line 56 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ SetFullId() [1/2]

void TGo4MbsSubEvent::SetFullId ( Int_t fullid)
inline

Definition at line 80 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ SetFullId() [2/2]

void TGo4MbsSubEvent::SetFullId ( Int_t fullid)
inline

Definition at line 80 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ SetProcid() [1/2]

void TGo4MbsSubEvent::SetProcid ( Short_t procid)
inline

◆ SetProcid() [2/2]

void TGo4MbsSubEvent::SetProcid ( Short_t procid)
inline

Definition at line 71 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ SetSubcrate() [1/2]

void TGo4MbsSubEvent::SetSubcrate ( Char_t subcrate)
inline

Definition at line 74 of file TGo4MbsSubEvent.h.

References fxHeader.

Referenced by TGo4MbsEvent::TGo4MbsEvent(), and TGo4MbsEvent::SimpleInit().

◆ SetSubcrate() [2/2]

void TGo4MbsSubEvent::SetSubcrate ( Char_t subcrate)
inline

Definition at line 74 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ SetSubtype() [1/2]

void TGo4MbsSubEvent::SetSubtype ( Short_t subtype)
inline

Definition at line 68 of file TGo4MbsSubEvent.h.

References fxHeader.

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

◆ SetSubtype() [2/2]

void TGo4MbsSubEvent::SetSubtype ( Short_t subtype)
inline

Definition at line 68 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ SetType() [1/2]

void TGo4MbsSubEvent::SetType ( Short_t type)
inline

Definition at line 65 of file TGo4MbsSubEvent.h.

References fxHeader.

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

◆ SetType() [2/2]

void TGo4MbsSubEvent::SetType ( Short_t type)
inline

Definition at line 65 of file TGo4MbsSubEvent.h.

References fxHeader.

◆ TGo4MbsEvent

TGo4MbsEvent
friend

Definition at line 29 of file TGo4MbsSubEvent.h.

References TGo4MbsEvent.

Referenced by TGo4MbsEvent.

◆ TGo4MbsSource

TGo4MbsSource
friend

Definition at line 28 of file TGo4MbsSubEvent.h.

References TGo4MbsSource.

Referenced by TGo4MbsSource.

Field 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 109 of file TGo4MbsSubEvent.h.

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

◆ 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 105 of file TGo4MbsSubEvent.h.

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

◆ 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 122 of file TGo4MbsSubEvent.h.

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

◆ 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 128 of file TGo4MbsSubEvent.h.

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

◆ fxHeader


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