BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtStdlibRandomEngine.hh
Go to the documentation of this file.
1/*******************************************************************************
2 * Project: BaBar detector at the SLAC PEP-II B-factory
3 * Package: EvtGenBase
4 * File: $Id: EvtStdlibRandomEngine.hh,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $
5 * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
6 *
7 * Copyright (C) 2002 Caltech
8 *******************************************************************************/
9
10/*
11 * Interface to stdlib's random number generator
12 */
13
14#ifndef EVT_STDLIB_RANDOM_ENGINE_HH
15#define EVT_STDLIB_RANDOM_ENGINE_HH
16
17#include "EvtRandomEngine.hh"
18#include <stdlib.h>
19
21public:
22 void setSeed( unsigned int seed ) { srand( seed ); }
23
24 virtual double random() {
25 double x = rand();
26 double y = RAND_MAX;
27 return x / y;
28 }
29};
30
31#endif
void setSeed(unsigned int seed)