GSI Object Oriented Online Offline (Go4) GO4-6.4.0
|
Implements a random generator as source for mbs events. More...
#include <TGo4MbsRandom.h>
Public Member Functions | |
TGo4MbsRandom () | |
TGo4MbsRandom (const char *name) | |
TGo4MbsRandom (TGo4MbsRandomParameter *par) | |
virtual | ~TGo4MbsRandom () |
Int_t | Close () override |
Close the file or connection. | |
s_bufhe * | GetBufferHeader () override |
User access to current event buffer header. | |
Int_t | NextEvent () override |
Requests the next event from mbs source. | |
Int_t | Open () override |
Open the file or connection. | |
![]() | |
TGo4MbsSource () | |
default for streamer | |
TGo4MbsSource (const char *name, Int_t mode) | |
TGo4MbsSource (TGo4MbsSourceParameter *par, Int_t mode) | |
virtual | ~TGo4MbsSource () |
Bool_t | BuildEvent (TGo4EventElement *dest) override |
Fill the destination event. | |
void | BuildMbsEvent (TGo4MbsEvent *target) |
This methods actually fills the target event class which is passed as pointer. | |
TGo4MbsSubEvent * | BuildMbsSubEvent (TGo4MbsEvent *target, Int_t fullID, Short_t *source, Int_t datalength) |
Auxiliary function to fill datalength words (Short_t) from source into the next subevent of target with matching header fullID longword. | |
Bool_t | CheckEventClass (TClass *cl) override |
Check that filled event is a proper class. | |
s_filhe * | GetInfoHeader () const |
User access to info header. | |
void | SetDataCopyMode (Bool_t on) |
void | SetEventInterval (UInt_t skipinterval) |
void | SetPort (Int_t port) |
void | SetPrintEvent (Int_t num=1, Int_t sid=-1, Int_t longw=1, Int_t hexw=1, Int_t dataw=0) |
Set mbs source into printout (verbose) mode for the next num events. | |
void | SetStartEvent (UInt_t firstindex) |
Define the Start index for the NextEvent. | |
void | SetStopEvent (UInt_t lastindex) |
void | SetTimeout (Int_t time) |
![]() | |
TGo4EventSource () | |
TGo4EventSource (const char *name) | |
virtual | ~TGo4EventSource () |
void | Clear (Option_t *opt="") override |
virtual const char * | GetActiveName () const |
Access to the name of the currently active source. | |
Int_t | GetCreateStatus () const |
Status value of server/file open. | |
const char * | GetErrMess () const |
Status/ error message of the last event. | |
Int_t | GetEventStatus () const |
Status of the last event. | |
Private Member Functions | |
double | gauss_rnd (double mean, double sigma) |
double | get_int (double low, double high) |
void | get_rand_seed () |
obtains seed for generator | |
long | rand_event (long choice) |
Private Attributes | |
Int_t | fiDLen {0} |
total length of current random event in words (Short_t) | |
Int_t | fiNumDat {0} |
Number of data longwords per subevent. | |
Int_t | fiNumSub {0} |
Number of subevents per event. | |
UInt_t | fuSeed {0} |
Short_t * | fxEventMem {nullptr} |
Memory allocated for the current random event. | |
Additional Inherited Members | |
![]() | |
static void | SetPollingMode (Bool_t on=kTRUE) |
![]() | |
static const UInt_t | fguEVHEBYCHAR = sizeof(s_evhe) / sizeof(Char_t) |
ratio sizeof(s_evhe) by sizeof(char). | |
static const UInt_t | fguLONGBYCHAR = sizeof(Int_t) / sizeof(Char_t) |
ratio sizeof(long) by sizeof(char). | |
static const UInt_t | fguLONGBYSHORT = sizeof(Int_t) / sizeof(Short_t) |
ratio sizeof(long) by sizeof(short). | |
static const UInt_t | fguSHORTBYCHAR = sizeof(Short_t) / sizeof(Char_t) |
ratio sizeof(short) by sizeof(char). | |
![]() | |
static const Int_t | fgiTIMEOUTDEFAULT =1 |
Default timeout in seconds for event input. | |
![]() | |
enum | { fguTXTLEN = 256 } |
text length More... | |
![]() | |
void | SetCreateStatus (Int_t status) |
Status value of event source init (file/server open). | |
void | SetErrMess (const char *txt) |
To be used for modification of the message by the event source implementation. | |
void | SetEventStatus (Int_t status) |
Status of the last event. | |
void | ThrowEOF (Int_t creastat, Int_t errstat, const char *message,...) |
EOF thrower. | |
void | ThrowError (Int_t creastat, Int_t errstat, const char *message,...) |
Exception thrower. | |
![]() | |
Bool_t | fbDataCopyMode {kFALSE} |
switches buildmbs event mode: if true, data buffer is copied to own buffer of subevent. | |
Bool_t | fbFirstEvent {kFALSE} |
Indicates if first event should be extracted. | |
Bool_t | fbIsOpen {kFALSE} |
Bool_t | fbPollingMode {kFALSE} |
Int_t | fiPort {0} |
if true, use short timeout to keep gSystem->ProcessEvents() running | |
Int_t | fiTimeout {0} |
Timeout in seconds for mbs getevent. | |
ULong_t | fuEventCounter {0} |
Current event index counter. | |
ULong_t | fuEventInterval {0} |
Number of events to skip from file in between two read events. | |
ULong_t | fuStartEvent {0} |
Index of first event to process. | |
ULong_t | fuStopEvent {0} |
Index of last event to process. | |
s_bufhe * | fxBuffer {nullptr} |
Points to the current gsi buffer structure filled by the event source. | |
s_ve10_1 * | fxEvent {nullptr} |
s_filhe * | fxInfoHeader {nullptr} |
Reference to header info delivered by source. | |
s_evt_channel * | fxInputChannel {nullptr} |
Event channel structure used by event source. | |
TGo4MbsSourcePrintPar | fxPrEventPar |
This structure keeps parameters for printevent mode. | |
![]() | |
static Bool_t | gbPollingMode = kFALSE |
Implements a random generator as source for mbs events.
Produces events with 2 subevents containing gaussian spectra
Definition at line 30 of file TGo4MbsRandom.h.
TGo4MbsRandom::TGo4MbsRandom | ( | const char * | name | ) |
Definition at line 52 of file TGo4MbsRandom.cxx.
References TGo4MbsSource::TGo4MbsSource(), TGo4Log::Debug(), fiDLen, fiNumDat, fiNumSub, GO4TRACE, and Open().
TGo4MbsRandom::TGo4MbsRandom | ( | ) |
Definition at line 29 of file TGo4MbsRandom.cxx.
References TGo4MbsSource::TGo4MbsSource(), fiDLen, fiNumDat, fiNumSub, and GO4TRACE.
TGo4MbsRandom::TGo4MbsRandom | ( | TGo4MbsRandomParameter * | par | ) |
Definition at line 39 of file TGo4MbsRandom.cxx.
References TGo4MbsSource::TGo4MbsSource(), TGo4Log::Debug(), fiDLen, fiNumDat, fiNumSub, GO4TRACE, and Open().
|
virtual |
Definition at line 65 of file TGo4MbsRandom.cxx.
|
overridevirtual |
Close the file or connection.
Reimplemented from TGo4MbsSource.
Definition at line 132 of file TGo4MbsRandom.cxx.
References TGo4MbsSource::fbIsOpen, TGo4MbsSource::fxEvent, fxEventMem, and GO4TRACE.
Referenced by ~TGo4MbsRandom().
|
private |
Definition at line 158 of file TGo4MbsRandom.cxx.
Referenced by rand_event().
|
private |
Definition at line 191 of file TGo4MbsRandom.cxx.
Referenced by NextEvent(), and rand_event().
|
private |
|
overridevirtual |
User access to current event buffer header.
dummy here!
Reimplemented from TGo4MbsSource.
Definition at line 230 of file TGo4MbsRandom.cxx.
|
overridevirtual |
Requests the next event from mbs source.
Returns event status value.
Reimplemented from TGo4MbsSource.
Definition at line 71 of file TGo4MbsRandom.cxx.
References fiDLen, fiNumDat, fiNumSub, TGo4MbsSource::fxEvent, get_int(), GO4TRACE, s_ves10_1::h_control, s_ves10_1::h_subcrate, s_ves10_1::i_procid, s_ves10_1::i_subtype, s_ves10_1::i_type, s_ves10_1::l_dlen, and rand_event().
|
overridevirtual |
Open the file or connection.
Reimplemented from TGo4MbsSource.
Definition at line 107 of file TGo4MbsRandom.cxx.
References TGo4MbsSource::fbIsOpen, fiDLen, fiNumDat, fiNumSub, TGo4MbsSource::fxEvent, fxEventMem, get_rand_seed(), and GO4TRACE.
Referenced by TGo4MbsRandom(), and TGo4MbsRandom().
|
private |
Definition at line 198 of file TGo4MbsRandom.cxx.
References fuSeed, gauss_rnd(), get_int(), NUM_PEAK, p_dExponential(), p_dNormal(), and p_dUniform().
Referenced by NextEvent().
|
private |
total length of current random event in words (Short_t)
Definition at line 57 of file TGo4MbsRandom.h.
Referenced by TGo4MbsRandom(), TGo4MbsRandom(), TGo4MbsRandom(), NextEvent(), and Open().
|
private |
Number of data longwords per subevent.
Definition at line 63 of file TGo4MbsRandom.h.
Referenced by TGo4MbsRandom(), TGo4MbsRandom(), TGo4MbsRandom(), NextEvent(), and Open().
|
private |
Number of subevents per event.
Definition at line 60 of file TGo4MbsRandom.h.
Referenced by TGo4MbsRandom(), TGo4MbsRandom(), TGo4MbsRandom(), NextEvent(), and Open().
|
private |
Definition at line 68 of file TGo4MbsRandom.h.
Referenced by rand_event().
|
private |
Memory allocated for the current random event.
Definition at line 66 of file TGo4MbsRandom.h.