g4tools  5.4.0
rtausmed
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_rtausmed
5 #define tools_rtausmed
6 
7 // G.Barrand : not so clear if 0 and 1 are included.
8 // With a simple program, we saw no hits with "if(r.shoot()==0)" or "if(r.shoot()==1)".
9 // (See inlib/tests/rand.cpp).
10 
11 #include "rtausmeui"
12 #include "S_STRING"
13 
14 #include <cmath>
15 
16 namespace tools {
17 
18 class rtausmed : public rtausmeui {
19  typedef rtausmeui parent;
20 public:
22 public:
23  rtausmed(unsigned int a_seed = 4357):parent(a_seed){}
24  virtual ~rtausmed(){}
25 public:
26  rtausmed(const rtausmed& a_from):parent(a_from){}
27  rtausmed& operator=(const rtausmed& a_from) {parent::operator=(a_from);return *this;}
28 protected:
29  static double two_to_minus_32() {
30  static const double s_v = std::ldexp(1.0,-32);
31  return s_v;
32  }
33 public:
34  double shoot() {return double(parent::shoot()) * two_to_minus_32();}
35 };
36 
37 }
38 
39 #endif
tools::rtausmed::rtausmed
rtausmed(unsigned int a_seed=4357)
Definition: rtausmed:23
tools::rtausmed::~rtausmed
virtual ~rtausmed()
Definition: rtausmed:24
tools::rtausmed
Definition: rtausmed:18
tools::rtausmeui
Definition: rtausmeui:36
TOOLS_SCLASS
#define TOOLS_SCLASS(a_name)
Definition: S_STRING:41
tools::rtausmed::rtausmed
rtausmed(const rtausmed &a_from)
Definition: rtausmed:26
tools::rtausmed::operator=
rtausmed & operator=(const rtausmed &a_from)
Definition: rtausmed:27
tools::rtausmed::shoot
double shoot()
Definition: rtausmed:34
rtausmeui
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::rtausmeui::shoot
unsigned int shoot()
Definition: rtausmeui:85
S_STRING
tools::rtausmeui::operator=
rtausmeui & operator=(const rtausmeui &a_from)
Definition: rtausmeui:58
tools::rtausmed::two_to_minus_32
static double two_to_minus_32()
Definition: rtausmed:29