]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STARLIGHT/starlight/include/randomgenerator.h
STARLIGHT code and interface
[u/mrichter/AliRoot.git] / STARLIGHT / starlight / include / randomgenerator.h
diff --git a/STARLIGHT/starlight/include/randomgenerator.h b/STARLIGHT/starlight/include/randomgenerator.h
new file mode 100644 (file)
index 0000000..7c06da4
--- /dev/null
@@ -0,0 +1,61 @@
+///////////////////////////////////////////////////////////////////////////
+//
+//    Copyright 2010
+//
+//    This file is part of starlight.
+//
+//    starlight is free software: you can redistribute it and/or modify
+//    it under the terms of the GNU General Public License as published by
+//    the Free Software Foundation, either version 3 of the License, or
+//    (at your option) any later version.
+//
+//    starlight is distributed in the hope that it will be useful,
+//    but WITHOUT ANY WARRANTY; without even the implied warranty of
+//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//    GNU General Public License for more details.
+//
+//    You should have received a copy of the GNU General Public License
+//    along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: 156                         $: revision of last commit
+// $Author:: odjuvsla                 $: author of last commit
+// $Date:: 2013-10-06 16:17:52 +0200 #$: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef RANDOMGENERATOR_H
+#define RANDOMGENERATOR_H
+#include "singleton.h"
+#include "slmutex.h"
+
+
+class randomGenerator
+{
+       public:
+       void SetSeed(unsigned int seed);
+       double Rndom(int i=0);
+       
+       private:
+       friend class Singleton<randomGenerator>;
+       unsigned int _Mt[624];
+       int _count624;
+       
+       MutexPosix _mutex;
+       
+       randomGenerator(){}
+       randomGenerator(const randomGenerator &);
+       
+};
+
+#define randyInstance Singleton<randomGenerator>::instance()
+
+#endif  // RANDOMGENERATOR_H
+