00001 // $Id: TGo4MbsRandom.h 478 2009-10-29 12:26:09Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #ifndef TGO4MBSRANDOM_H 00015 #define TGO4MBSRANDOM_H 00016 00017 #include "TGo4MbsSource.h" 00018 00019 #define NUM_PEAK 5 00020 00021 class TGo4MbsRandomParameter; 00022 00029 class TGo4MbsRandom : public TGo4MbsSource { 00030 public: 00031 00032 TGo4MbsRandom(const char* name); 00033 00034 TGo4MbsRandom(); 00035 00036 TGo4MbsRandom(TGo4MbsRandomParameter* par); 00037 00038 virtual ~TGo4MbsRandom(); 00039 00041 virtual Int_t Close(); 00042 00044 virtual Int_t Open(); 00045 00048 virtual Int_t NextEvent(); 00049 00051 virtual s_bufhe * GetBufferHeader(); 00052 00053 private: 00054 00056 Int_t fiDLen; 00057 00059 Int_t fiNumSub; 00060 00062 Int_t fiNumDat; 00063 00065 Short_t* fxEventMem; 00066 00067 UInt_t fuSeed; 00068 00070 void get_rand_seed(); 00071 00072 double gauss_rnd(double mean, double sigma); 00073 00074 double get_int(double low, double high); 00075 00076 long rand_event(long choice); 00077 00078 static double fgdPeak[]; 00079 static double fgdSigma[]; 00080 static double fgdPeak2[]; 00081 static double fgdSigma2[]; 00082 00083 ClassDef(TGo4MbsRandom,1) 00084 }; 00085 00086 #endif //TGO4MBSRANDOM_H