00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_HandlerBase_H
00010 #define ThePEG_HandlerBase_H
00011
00012
00013 #include "ThePEG/Interface/Interfaced.h"
00014 #include "ThePEG/Repository/UseRandom.fh"
00015 #include <stdexcept>
00016
00017 namespace ThePEG {
00018
00019 template <typename T = UseRandom>
00038 class HandlerBaseT: public Interfaced {
00039 public:
00040
00042 friend class HandlerBase;
00043
00044 private:
00045
00052 HandlerBaseT() {}
00053
00054 public:
00058 virtual ~HandlerBaseT() {}
00060
00061 public:
00062
00066 double rnd() const { return T::rnd(); }
00067
00071 double rnd(double xu) const { return T::rnd(xu); }
00072
00076 double rnd(double xl, double xu) const { return T::rnd(xl, xu); }
00077
00081 bool rndbool() const { return T::rndbool(); }
00082
00086 bool rndbool(double p) const { return T::rndbool(p); }
00087
00091 bool rndbool(double p1, double p2) const { return T::rndbool(p1, p2); }
00092
00096 int rndsign(double p1, double p2, double p3) const { return T::rndsign(p1, p2, p3); }
00097
00101 int rnd2(double p0, double p1) const { return T::rnd2(p0, p1); }
00102
00107 int rnd3(double p0, double p1, double p2) const { return T::rnd3(p0, p1, p2); }
00108
00113 int rnd4(double p0, double p1, double p2, double p3) const { return T::rnd4(p0, p1, p2, p3); }
00114
00118 long irnd(long xu = 2) const { return T::irnd(xu); }
00119
00123 long irnd(long xl, long xu) const { return T::irnd(xl, xu); }
00124
00129 const StandardModelBase & SM() const { return *standardModel(); }
00130
00135 tSMPtr standardModel() const { return generator()->standardModel(); }
00136 };
00137
00150 class HandlerBase: public HandlerBaseT<UseRandom> {
00151
00152 public:
00153
00157 static void Init();
00158
00159 private:
00160
00164 static AbstractNoPIOClassDescription<HandlerBase> initHandlerBase;
00165
00169 HandlerBase & operator=(const HandlerBase &);
00170
00171 };
00172
00179 template <>
00180 struct BaseClassTrait<HandlerBase,1>: public ClassTraitsType {
00183 typedef Interfaced NthBase;
00184 };
00185
00190 template <>
00191 struct ClassTraits<HandlerBase>: public ClassTraitsBase<HandlerBase> {
00193 static string className() { return "ThePEG::HandlerBase"; }
00194 };
00195
00198 }
00199
00200 #endif