MINT2
TGenPhaseSpaceWithRnd.h
Go to the documentation of this file.
1 #ifndef TGENPHASESPACE_WITH_RND_HH
2 #define TGENPHASESPACE_WITH_RND_HH
3 
4 #include "TGenPhaseSpace.h"
5 #include "TRandom.h"
6 
7 class TGenPhaseSpaceWithRnd : public TGenPhaseSpace{
8  TRandom* _rnd;
9  public:
10  TGenPhaseSpaceWithRnd(TRandom* rnd=gRandom) : _rnd(rnd){}
11  void setRandom(TRandom* rnd=gRandom){_rnd = rnd;}
12  Double_t Generate(){
13  TRandom* oldGRandom = gRandom;
14  gRandom = _rnd;
15  Double_t returnVal = TGenPhaseSpace::Generate();
16  gRandom = oldGRandom;
17  return returnVal;
18  }
19 };
20 
21 #endif
22 //
void setRandom(TRandom *rnd=gRandom)
TGenPhaseSpaceWithRnd(TRandom *rnd=gRandom)