Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:23:59

0001 // -*- C++ -*-
0002 //
0003 // EvtGenRandom.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef HERWIG_EvtGenRandom_H
0010 #define HERWIG_EvtGenRandom_H
0011 //
0012 // This is the declaration of the EvtGenRandom class.
0013 //
0014 #include <EvtGenBase/EvtRandomEngine.hh>
0015 #include <ThePEG/Repository/RandomGenerator.h>
0016 
0017 namespace Herwig {
0018 
0019 using namespace ThePEG;
0020 
0021 /**
0022  * The EvtGenRamdom class is a wrapper around the RandomGenerator class of ThePEG
0023  * so that when running Herwig with EvtGen the same random number generator is used
0024  * for both.
0025  */
0026 class EvtGenRandom : public EvtRandomEngine {
0027 
0028 public:
0029 
0030   /**
0031    * The Constructor.
0032    * @param rand Pointer to the random number generator
0033    */
0034   inline EvtGenRandom(Ptr<RandomGenerator>::pointer rand){_rand=rand;}
0035 
0036   /**
0037    *  Member to return the random number
0038    */
0039   inline double random(){return _rand->rnd();}
0040 
0041   /**
0042    *  Destructor
0043    */
0044   inline virtual ~EvtGenRandom(){;}
0045 
0046 private:
0047 
0048   /**
0049    *  The pointer to the random number generator
0050    */
0051   Ptr<RandomGenerator>::pointer _rand;
0052 };
0053 }
0054 #endif /* HERWIG_EvtGenRandom_H */