thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Handlers
HandlerBase.h
1
// -*- C++ -*-
2
//
3
// HandlerBase.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2019 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ThePEG_HandlerBase_H
10
#define ThePEG_HandlerBase_H
11
// This is the declaration of the HandlerBase class.
12
13
#include "ThePEG/Interface/Interfaced.h"
14
#include "ThePEG/Repository/UseRandom.fh"
15
#include "ThePEG/Repository/EventGenerator.h"
16
#include <stdexcept>
17
18
namespace
ThePEG
{
19
20
template
<
typename
T = UseRandom>
39
class
HandlerBaseT
:
public
Interfaced
{
40
public
:
41
43
friend
class
HandlerBase
;
44
45
private
:
46
53
HandlerBaseT
() {}
54
55
public
:
59
virtual
~HandlerBaseT
() {}
61
62
public
:
63
67
double
rnd
()
const
{
return
T::rnd(); }
68
72
double
rnd
(
double
xu)
const
{
return
T::rnd(xu); }
73
77
double
rnd
(
double
xl,
double
xu)
const
{
return
T::rnd(xl, xu); }
78
82
bool
rndbool
()
const
{
return
T::rndbool(); }
83
87
bool
rndbool
(
double
p)
const
{
return
T::rndbool(p); }
88
92
bool
rndbool
(
double
p1,
double
p2)
const
{
return
T::rndbool(p1, p2); }
93
97
int
rndsign
(
double
p1,
double
p2,
double
p3)
const
{
return
T::rndsign(p1, p2, p3); }
98
102
int
rnd2
(
double
p0,
double
p1)
const
{
return
T::rnd2(p0, p1); }
103
108
int
rnd3
(
double
p0,
double
p1,
double
p2)
const
{
return
T::rnd3(p0, p1, p2); }
109
114
int
rnd4
(
double
p0,
double
p1,
double
p2,
double
p3)
const
{
return
T::rnd4(p0, p1, p2, p3); }
115
119
long
irnd
(
long
xu = 2)
const
{
return
T::irnd(xu); }
120
124
long
irnd
(
long
xl,
long
xu)
const
{
return
T::irnd(xl, xu); }
125
130
const
StandardModelBase
&
SM
()
const
{
return
*
standardModel
(); }
131
136
tSMPtr
standardModel
()
const
{
return
generator
()->standardModel(); }
137
};
138
151
class
HandlerBase
:
public
HandlerBaseT
<UseRandom> {
152
153
public
:
154
158
static
void
Init
();
159
160
private
:
161
165
static
AbstractNoPIOClassDescription<HandlerBase>
initHandlerBase
;
166
170
HandlerBase
&
operator=
(
const
HandlerBase
&) =
delete
;
171
172
};
173
180
template
<>
181
struct
BaseClassTrait
<
HandlerBase
,1>:
public
ClassTraitsType
{
184
typedef
Interfaced
NthBase
;
185
};
186
191
template
<>
192
struct
ClassTraits<HandlerBase>:
public
ClassTraitsBase<HandlerBase> {
194
static
string
className
() {
return
"ThePEG::HandlerBase"
; }
195
};
196
199
}
200
201
#endif
/* ThePEG_HandlerBase_H */
ThePEG::AbstractNoPIOClassDescription
A concreate implementation of ClassDescriptionBase describing an abstract class without persistent da...
Definition:
ClassDescription.h:417
ThePEG::HandlerBaseT
HandlerBaseT is a dummy abstract templated class used as base class to HandlerBase.
Definition:
HandlerBase.h:39
ThePEG::HandlerBaseT::rnd
double rnd(double xl, double xu) const
Return a simple flat random number in the range ]xl,xu[.
Definition:
HandlerBase.h:77
ThePEG::HandlerBaseT::irnd
long irnd(long xu=2) const
Return a simple flat random integrer number in the range [0,xu[.
Definition:
HandlerBase.h:119
ThePEG::HandlerBaseT::~HandlerBaseT
virtual ~HandlerBaseT()
Destructor.
Definition:
HandlerBase.h:59
ThePEG::HandlerBaseT::rnd
double rnd() const
Return a simple flat random number in the range ]0,1[.
Definition:
HandlerBase.h:67
ThePEG::HandlerBaseT::rnd
double rnd(double xu) const
Return a simple flat random number in the range ]0,xu[.
Definition:
HandlerBase.h:72
ThePEG::HandlerBaseT::rndbool
bool rndbool(double p1, double p2) const
Return a true with probability p1/(p1+p2).
Definition:
HandlerBase.h:92
ThePEG::HandlerBaseT::rndbool
bool rndbool(double p) const
Return a true with probability p.
Definition:
HandlerBase.h:87
ThePEG::HandlerBaseT::rndsign
int rndsign(double p1, double p2, double p3) const
Return -1, 0, or 1 with relative probabilities p1, p2, p3.
Definition:
HandlerBase.h:97
ThePEG::HandlerBaseT::rndbool
bool rndbool() const
Return true with 50% probability.
Definition:
HandlerBase.h:82
ThePEG::HandlerBaseT::HandlerBaseT
HandlerBaseT()
Default constructor.
Definition:
HandlerBase.h:53
ThePEG::HandlerBaseT::rnd2
int rnd2(double p0, double p1) const
Return an integer with probability p /(p0+p1).
Definition:
HandlerBase.h:102
ThePEG::HandlerBaseT::rnd3
int rnd3(double p0, double p1, double p2) const
Return an integer with probability p /(p0+p1+p2).
Definition:
HandlerBase.h:108
ThePEG::HandlerBaseT::SM
const StandardModelBase & SM() const
Return a reference to the object containing the standard model parameters for this run.
Definition:
HandlerBase.h:130
ThePEG::HandlerBaseT::standardModel
tSMPtr standardModel() const
Return a pointer to the object containing the standard model parameters for this run.
Definition:
HandlerBase.h:136
ThePEG::HandlerBaseT::rnd4
int rnd4(double p0, double p1, double p2, double p3) const
Return an integer/ with probability p (p0+p1+p2+p3).
Definition:
HandlerBase.h:114
ThePEG::HandlerBaseT::irnd
long irnd(long xl, long xu) const
Return a simple flat random integrer number in the range [xl,xu[.
Definition:
HandlerBase.h:124
ThePEG::HandlerBase
HandlerBase is an abstract base class derived from the Interfaced class via the HandlerBaseT class ad...
Definition:
HandlerBase.h:151
ThePEG::HandlerBase::initHandlerBase
static AbstractNoPIOClassDescription< HandlerBase > initHandlerBase
Describe an abstract class without persistent data.
Definition:
HandlerBase.h:165
ThePEG::HandlerBase::Init
static void Init()
Standard Init function used to initialize the interface.
ThePEG::HandlerBase::operator=
HandlerBase & operator=(const HandlerBase &)=delete
Private and non-existent assignment operator.
ThePEG::Interfaced
The Interfaced class is derived from the InterfacedBase class adding a couple of things particular to...
Definition:
Interfaced.h:38
ThePEG::Interfaced::generator
tEGPtr generator() const
Return a pointer to the EventGenerator controlling the run.
Definition:
Interfaced.h:99
ThePEG::Pointer::TransientRCPtr
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition:
RCPtr.h:519
ThePEG::StandardModelBase
StandardModelBase is used to handle standard model parameters in an EventGenerator.
Definition:
StandardModelBase.h:38
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::BaseClassTrait
BaseClassTraits describes the base classes of the templated class.
Definition:
ClassTraits.h:156
ThePEG::BaseClassTrait::NthBase
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition:
ClassTraits.h:161
ThePEG::ClassTraitsBase::className
static string className()
Return the name of class T.
Definition:
ClassTraits.h:66
ThePEG::ClassTraitsType
ClassTraitsType is an empty, non-polymorphic, base class.
Definition:
ClassTraits.h:30
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6