Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TGo4MbsRandom Class Reference

Implements a random generator as source for mbs events. More...

#include <TGo4MbsRandom.h>

Inheritance diagram for TGo4MbsRandom:

TGo4MbsSource TGo4EventSource List of all members.

Public Methods

 TGo4MbsRandom (const char *name)
 TGo4MbsRandom ()
 TGo4MbsRandom (TGo4MbsRandomParameter *par)
virtual ~TGo4MbsRandom ()
virtual Int_t Close ()
 Close the file or connection. More...

virtual Int_t Open ()
 Open the file or connection. More...

virtual Int_t NextEvent ()
 Requests the next event from mbs source. More...

virtual s_bufheGetBufferHeader ()
 User access to current event buffer header. More...


Private Methods

void get_rand_seed ()
 obtains seed for generator. More...

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

Private Attributes

Int_t fiDLen
 total length of current random event in words (Short_t). More...

Int_t fiNumSub
 Number of subevents per event. More...

Int_t fiNumDat
 Number of data longwords per subevent. More...

Short_t * fxEventMem
 Memory allocated for the current random event. More...

UInt_t fuSeed

Static Private Attributes

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

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 32 of file TGo4MbsRandom.h.


Constructor & Destructor Documentation

TGo4MbsRandom::TGo4MbsRandom const char *    name
 

Definition at line 53 of file TGo4MbsRandom.cxx.

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

TGo4MbsRandom::TGo4MbsRandom  
 

Definition at line 62 of file TGo4MbsRandom.cxx.

References TRACE.

TGo4MbsRandom::TGo4MbsRandom TGo4MbsRandomParameter   par
 

Definition at line 39 of file TGo4MbsRandom.cxx.

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

TGo4MbsRandom::~TGo4MbsRandom   [virtual]
 

Definition at line 69 of file TGo4MbsRandom.cxx.

References Close(), and TRACE.


Member Function Documentation

Int_t TGo4MbsRandom::Close   [virtual]
 

Close the file or connection.

Reimplemented from TGo4MbsSource.

Definition at line 144 of file TGo4MbsRandom.cxx.

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

Referenced by ~TGo4MbsRandom().

Int_t TGo4MbsRandom::Open   [virtual]
 

Open the file or connection.

Reimplemented from TGo4MbsSource.

Definition at line 121 of file TGo4MbsRandom.cxx.

References fiDLen, fiNumDat, fiNumSub, TGo4MbsSource::fxEvent, fxEventMem, get_rand_seed(), s_ve10_1::i_subtype, s_ve10_1::i_trigger, s_ve10_1::i_type, s_ve10_1::l_count, s_ve10_1::l_dlen, and TRACE.

Referenced by TGo4MbsRandom().

Int_t TGo4MbsRandom::NextEvent   [virtual]
 

Requests the next event from mbs source.

Returns event status value.

Reimplemented from TGo4MbsSource.

Definition at line 77 of file TGo4MbsRandom.cxx.

References fiDLen, fiNumDat, fiNumSub, TGo4MbsSource::fxEvent, get_int(), s_ves10_1::h_control, s_ves10_1::h_subcrate, i, s_ves10_1::i_procid, s_ves10_1::i_subtype, s_ves10_1::i_type, s_ve10_1::l_count, s_ves10_1::l_dlen, s_ve10_1::l_dlen, rand_event(), and TRACE.

s_bufhe * TGo4MbsRandom::GetBufferHeader   [virtual]
 

User access to current event buffer header.

dummy here!

Reimplemented from TGo4MbsSource.

Definition at line 252 of file TGo4MbsRandom.cxx.

void TGo4MbsRandom::get_rand_seed   [private]
 

obtains seed for generator.

Definition at line 156 of file TGo4MbsRandom.cxx.

Referenced by Open().

double TGo4MbsRandom::gauss_rnd double    mean,
double    sigma
[private]
 

Definition at line 168 of file TGo4MbsRandom.cxx.

References log(), sigma, and sqrt().

Referenced by rand_event().

double TGo4MbsRandom::get_int double    low,
double    high
[private]
 

Definition at line 206 of file TGo4MbsRandom.cxx.

Referenced by NextEvent(), and rand_event().

long TGo4MbsRandom::rand_event long    choice [private]
 

Definition at line 212 of file TGo4MbsRandom.cxx.

References fgdPeak, fgdPeak2, fgdSigma, fgdSigma2, fuSeed, gauss_rnd(), get_int(), NUM_PEAK, p_dExponential(), p_dNormal(), and p_dUniform().

Referenced by NextEvent().


Member Data Documentation

Int_t TGo4MbsRandom::fiDLen [private]
 

total length of current random event in words (Short_t).

Definition at line 59 of file TGo4MbsRandom.h.

Referenced by NextEvent(), and Open().

Int_t TGo4MbsRandom::fiNumSub [private]
 

Number of subevents per event.

Definition at line 62 of file TGo4MbsRandom.h.

Referenced by NextEvent(), and Open().

Int_t TGo4MbsRandom::fiNumDat [private]
 

Number of data longwords per subevent.

Definition at line 65 of file TGo4MbsRandom.h.

Referenced by NextEvent(), and Open().

Short_t* TGo4MbsRandom::fxEventMem [private]
 

Memory allocated for the current random event.

Definition at line 68 of file TGo4MbsRandom.h.

Referenced by Close(), and Open().

UInt_t TGo4MbsRandom::fuSeed [private]
 

Definition at line 70 of file TGo4MbsRandom.h.

Referenced by rand_event().

double TGo4MbsRandom::fgdPeak = { 200., 302., 653., 1024., 2800.} [static, private]
 

Definition at line 33 of file TGo4MbsRandom.cxx.

Referenced by rand_event().

double TGo4MbsRandom::fgdSigma = { 10., 22., 153., 104., 38.} [static, private]
 

Definition at line 34 of file TGo4MbsRandom.cxx.

Referenced by rand_event().

double TGo4MbsRandom::fgdPeak2 = { 300., 402., 853., 2000., 3024.} [static, private]
 

Definition at line 35 of file TGo4MbsRandom.cxx.

Referenced by rand_event().

double TGo4MbsRandom::fgdSigma2 = { 22., 153., 104., 100., 20.} [static, private]
 

Definition at line 36 of file TGo4MbsRandom.cxx.

Referenced by rand_event().


The documentation for this class was generated from the following files:
Generated on Tue Nov 8 10:56:47 2005 for Go4-v2.10-5 by doxygen1.2.15