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

#include <TGo4MbsRandom.h>

+ Inheritance diagram for TGo4MbsRandom:

Public Member Functions

 TGo4MbsRandom (const char *name)
 
 TGo4MbsRandom ()
 
 TGo4MbsRandom (TGo4MbsRandomParameter *par)
 
virtual ~TGo4MbsRandom ()
 
Int_t Close () override
 
Int_t Open () override
 
Int_t NextEvent () override
 
s_bufheGetBufferHeader () override
 
- Public Member Functions inherited from TGo4MbsSource
 TGo4MbsSource ()
 
 TGo4MbsSource (const char *name, Int_t mode)
 
 TGo4MbsSource (TGo4MbsSourceParameter *par, Int_t mode)
 
virtual ~TGo4MbsSource ()
 
Bool_t CheckEventClass (TClass *cl) override
 
Bool_t BuildEvent (TGo4EventElement *dest) override
 
void BuildMbsEvent (TGo4MbsEvent *target)
 
TGo4MbsSubEventBuildMbsSubEvent (TGo4MbsEvent *target, Int_t fullID, Short_t *source, Int_t datalength)
 
void SetStartEvent (UInt_t firstindex)
 
void SetStopEvent (UInt_t lastindex)
 
void SetEventInterval (UInt_t skipinterval)
 
void SetTimeout (Int_t time)
 
void SetPort (Int_t port)
 
s_filheGetInfoHeader () const
 
void SetPrintEvent (Int_t num=1, Int_t sid=-1, Int_t longw=1, Int_t hexw=1, Int_t dataw=0)
 
void SetDataCopyMode (Bool_t on)
 
- Public Member Functions inherited from TGo4EventSource
 TGo4EventSource ()
 
 TGo4EventSource (const char *name)
 
virtual ~TGo4EventSource ()
 
void Clear (Option_t *opt="") override
 
Int_t GetCreateStatus () const
 
Int_t GetEventStatus () const
 
const char * GetErrMess () const
 
virtual const char * GetActiveName () const
 

Private Member Functions

void get_rand_seed ()
 
double gauss_rnd (double mean, double sigma)
 
double get_int (double low, double high)
 
long rand_event (long choice)
 

Private Attributes

Int_t fiDLen {0}
 
Int_t fiNumSub {0}
 
Int_t fiNumDat {0}
 
Short_t * fxEventMem {nullptr}
 
UInt_t fuSeed {0}
 

Static Private Attributes

static double fgdPeak [] = { 200., 302., 653., 1024., 2800.}
 
static double fgdSigma [] = { 10., 22., 153., 104., 38.}
 
static double fgdPeak2 [] = { 300., 402., 853., 2000., 3024.}
 
static double fgdSigma2 [] = { 22., 153., 104., 100., 20.}
 

Additional Inherited Members

- Static Public Member Functions inherited from TGo4MbsSource
static void SetPollingMode (Bool_t on=kTRUE)
 
- Static Public Attributes inherited from TGo4MbsSource
static const UInt_t fguLONGBYCHAR = sizeof(Int_t) / sizeof(Char_t)
 
static const UInt_t fguSHORTBYCHAR = sizeof(Short_t) / sizeof(Char_t)
 
static const UInt_t fguLONGBYSHORT = sizeof(Int_t) / sizeof(Short_t)
 
static const UInt_t fguEVHEBYCHAR = sizeof(s_evhe) / sizeof(Char_t)
 
- Static Public Attributes inherited from TGo4EventSource
static const Int_t fgiTIMEOUTDEFAULT =1
 
- Protected Types inherited from TGo4EventSource
enum  { fguTXTLEN = 256 }
 
- Protected Member Functions inherited from TGo4EventSource
void SetErrMess (const char *txt)
 
void SetEventStatus (Int_t status)
 
void SetCreateStatus (Int_t status)
 
void ThrowError (Int_t creastat, Int_t errstat, const char *message,...)
 
void ThrowEOF (Int_t creastat, Int_t errstat, const char *message,...)
 
- Protected Attributes inherited from TGo4MbsSource
s_evt_channelfxInputChannel {nullptr}
 
s_ve10_1fxEvent {nullptr}
 
s_bufhefxBuffer {nullptr}
 
s_filhefxInfoHeader {nullptr}
 
Bool_t fbIsOpen {kFALSE}
 
Bool_t fbDataCopyMode {kFALSE}
 
ULong_t fuEventCounter {0}
 
Bool_t fbFirstEvent {kFALSE}
 
ULong_t fuStartEvent {0}
 
ULong_t fuStopEvent {0}
 
ULong_t fuEventInterval {0}
 
Int_t fiTimeout {0}
 
Bool_t fbPollingMode {kFALSE}
 
Int_t fiPort {0}
 if true, use short timeout to keep gSystem->ProcessEvents() running More...
 
TGo4MbsSourcePrintPar fxPrEventPar
 
- Static Protected Attributes inherited from TGo4MbsSource
static Bool_t gbPollingMode = kFALSE
 

Detailed Description

Implements a random generator as source for mbs events. Produces events with 2 subevents containing gaussian spectra

Author
J. Adamczewski, N.Kurz
Since
5/2003

Definition at line 29 of file TGo4MbsRandom.h.

Constructor & Destructor Documentation

◆ TGo4MbsRandom() [1/3]

TGo4MbsRandom::TGo4MbsRandom ( const char *  name)

Definition at line 57 of file TGo4MbsRandom.cxx.

References TGo4Log::Debug(), GO4TRACE, and Open().

◆ TGo4MbsRandom() [2/3]

TGo4MbsRandom::TGo4MbsRandom ( )

Definition at line 34 of file TGo4MbsRandom.cxx.

References GO4TRACE.

◆ TGo4MbsRandom() [3/3]

TGo4MbsRandom::TGo4MbsRandom ( TGo4MbsRandomParameter par)

Definition at line 44 of file TGo4MbsRandom.cxx.

References TGo4Log::Debug(), GO4TRACE, and Open().

◆ ~TGo4MbsRandom()

TGo4MbsRandom::~TGo4MbsRandom ( )
virtual

Definition at line 70 of file TGo4MbsRandom.cxx.

References Close(), and GO4TRACE.

Member Function Documentation

◆ Close()

Int_t TGo4MbsRandom::Close ( )
overridevirtual

Close the file or connection.

Reimplemented from TGo4MbsSource.

Definition at line 137 of file TGo4MbsRandom.cxx.

References TGo4MbsSource::fbIsOpen, TGo4MbsSource::fxEvent, fxEventMem, and GO4TRACE.

Referenced by ~TGo4MbsRandom().

◆ gauss_rnd()

double TGo4MbsRandom::gauss_rnd ( double  mean,
double  sigma 
)
private

Definition at line 163 of file TGo4MbsRandom.cxx.

Referenced by rand_event().

◆ get_int()

double TGo4MbsRandom::get_int ( double  low,
double  high 
)
private

Definition at line 196 of file TGo4MbsRandom.cxx.

Referenced by NextEvent(), and rand_event().

◆ get_rand_seed()

void TGo4MbsRandom::get_rand_seed ( )
private

obtains seed for generator

Definition at line 150 of file TGo4MbsRandom.cxx.

Referenced by Open().

◆ GetBufferHeader()

s_bufhe * TGo4MbsRandom::GetBufferHeader ( )
overridevirtual

User access to current event buffer header. dummy here!

Reimplemented from TGo4MbsSource.

Definition at line 230 of file TGo4MbsRandom.cxx.

◆ NextEvent()

Int_t TGo4MbsRandom::NextEvent ( )
overridevirtual

◆ Open()

Int_t TGo4MbsRandom::Open ( )
overridevirtual

Open the file or connection.

Reimplemented from TGo4MbsSource.

Definition at line 112 of file TGo4MbsRandom.cxx.

References TGo4MbsSource::fbIsOpen, fiDLen, fiNumDat, fiNumSub, TGo4MbsSource::fxEvent, fxEventMem, get_rand_seed(), and GO4TRACE.

Referenced by TGo4MbsRandom().

◆ rand_event()

long TGo4MbsRandom::rand_event ( long  choice)
private

Member Data Documentation

◆ fgdPeak

double TGo4MbsRandom::fgdPeak = { 200., 302., 653., 1024., 2800.}
staticprivate

Definition at line 78 of file TGo4MbsRandom.h.

Referenced by rand_event().

◆ fgdPeak2

double TGo4MbsRandom::fgdPeak2 = { 300., 402., 853., 2000., 3024.}
staticprivate

Definition at line 80 of file TGo4MbsRandom.h.

Referenced by rand_event().

◆ fgdSigma

double TGo4MbsRandom::fgdSigma = { 10., 22., 153., 104., 38.}
staticprivate

Definition at line 79 of file TGo4MbsRandom.h.

Referenced by rand_event().

◆ fgdSigma2

double TGo4MbsRandom::fgdSigma2 = { 22., 153., 104., 100., 20.}
staticprivate

Definition at line 81 of file TGo4MbsRandom.h.

Referenced by rand_event().

◆ fiDLen

Int_t TGo4MbsRandom::fiDLen {0}
private

total length of current random event in words (Short_t)

Definition at line 56 of file TGo4MbsRandom.h.

Referenced by NextEvent(), and Open().

◆ fiNumDat

Int_t TGo4MbsRandom::fiNumDat {0}
private

Number of data longwords per subevent

Definition at line 62 of file TGo4MbsRandom.h.

Referenced by NextEvent(), and Open().

◆ fiNumSub

Int_t TGo4MbsRandom::fiNumSub {0}
private

Number of subevents per event

Definition at line 59 of file TGo4MbsRandom.h.

Referenced by NextEvent(), and Open().

◆ fuSeed

UInt_t TGo4MbsRandom::fuSeed {0}
private

Definition at line 67 of file TGo4MbsRandom.h.

Referenced by rand_event().

◆ fxEventMem

Short_t* TGo4MbsRandom::fxEventMem {nullptr}
private

Memory allocated for the current random event

Definition at line 65 of file TGo4MbsRandom.h.

Referenced by Close(), and Open().


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