StRoot
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
StTrsMaker
include
StTrsRandom.hh
1
/***************************************************************************
2
*
3
* $Id: StTrsRandom.hh,v 1.1 2005/12/12 21:00:12 perev Exp $
4
*
5
* Author: Victor Perev Dec 2005
6
***************************************************************************
7
*
8
* Description: Random generator based on ROOT TRandom
9
* allows to use stl random_shuffle
10
*
11
***************************************************************************
12
*
13
* $Log: StTrsRandom.hh,v $
14
* Revision 1.1 2005/12/12 21:00:12 perev
15
* 3 random generators ==> 1
16
*
17
* Revision 1.0 2005/10/11 21:42:23 perev
18
* Initial Revision
19
*
20
**************************************************************************/
21
#ifndef ST_TRS_RANDOM_HH
22
#define ST_TRS_RANDOM_HH
23
#include "TRandom.h"
24
class
StTrsRandom
:
public
TRandom
25
{
26
public
:
27
StTrsRandom
(){};
28
~
StTrsRandom
(){
if
(
this
==fgInst) fgInst=0;}
29
static
StTrsRandom
&inst() {
if
(!fgInst) fgInst=
new
StTrsRandom
();
return
*fgInst;}
30
int
operator()(
int
limit) {
return
(
int
)Rndm()*limit;}
31
32
static
StTrsRandom
*fgInst;
33
};
34
#ifdef ST_TRS_RANDOM_SRC
35
StTrsRandom
*StTrsRandom::fgInst = 0;
36
#undef ST_TRS_RANDOM_SRC
37
#endif //ST_TRS_RANDOM_SRC
38
39
#endif
StTrsRandom
Definition:
StTrsRandom.hh:24
Generated by
1.8.5