00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef ST_TRS_RANDOM_HH
00022 #define ST_TRS_RANDOM_HH
00023 #include "TRandom.h"
00024 class StTrsRandom : public TRandom
00025 {
00026 public:
00027 StTrsRandom(){};
00028 ~StTrsRandom(){if (this==fgInst) fgInst=0;}
00029 static StTrsRandom &inst() {if (!fgInst) fgInst= new StTrsRandom(); return *fgInst;}
00030 int operator()(int limit) {return (int)Rndm()*limit;}
00031
00032 static StTrsRandom *fgInst;
00033 };
00034 #ifdef ST_TRS_RANDOM_SRC
00035 StTrsRandom *StTrsRandom::fgInst = 0;
00036 #undef ST_TRS_RANDOM_SRC
00037 #endif //ST_TRS_RANDOM_SRC
00038
00039 #endif