PandaRoot
3.52/src/utilities/PhotosRandom.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //****************************************************************************
14 //* This file is part of PandaRoot. *
15 //* *
16 //* PandaRoot is distributed under the terms of the *
17 //* GNU General Public License (GPL) version 3, *
18 //* copied verbatim in the file "LICENSE". *
19 //* *
20 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
21 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
22 //* The authors are listed in the file "AUTHORS". *
23 //****************************************************************************
24 
25 #ifndef _PhotosRandom_included_
26 #define _PhotosRandom_included_
27 
41 namespace Photospp {
42 
43 class PhotosRandom {
44  public:
45  /* Change the seed. Default is s1=1802 and s2=9373
46  These values must be in range [0,31327] and [0,30080] respectively */
47  static void setSeed(int s1, int s2);
48 
49  /* Initialization routine. Must be called at least once before
50  the generator can be used. */
51  static void initialize();
52 
53  /* Uniform distribution between 0 and 1 */
54  static double randomReal();
55 
56  protected:
57  static bool init;
58  static int iseed[2];
59  static int i97;
60  static int j97;
61  static double uran[97];
62  static double cran;
63  static const double cdran;
64  static const double cmran;
65 };
66 
67 } // namespace Photospp
68 #endif
Photos random number generator rewritten from PHOTOS FORTRAN.
static const double cmran
Definition: PhotosRandom.h:64
Definition: Log.h:54
static void initialize()
static int iseed[2]
Definition: PhotosRandom.h:58
static const double cdran
Definition: PhotosRandom.h:63
static double cran
Definition: PhotosRandom.h:62
static void setSeed(int s1, int s2)
static double randomReal()
static double uran[97]
Definition: PhotosRandom.h:61