herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
PDT
ThreeBodyAllOnCalculator.h
1
// -*- C++ -*-
2
//
3
// ThreeBodyAllOnCalculator.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4
// Copyright (C) 2002-2019 The Herwig Collaboration
5
//
6
// Herwig 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 HERWIG_ThreeBodyAllOnCalculator_H
10
#define HERWIG_ThreeBodyAllOnCalculator_H
11
// This is the declaration of the ThreeBodyAllOnCalculator class.
12
13
#include "WidthCalculatorBase.h"
14
#include "Herwig/Utilities/GSLIntegrator.h"
15
16
namespace
Herwig
{
17
using namespace
ThePEG
;
18
19
template
<
class
T>
20
class
ThreeBodyAllOnCalculator;
21
22
35
template
<
class
T>
36
class
ThreeBodyAllOnCalculator
:
public
WidthCalculatorBase
{
37
38
struct
Outer
{
47
51
Outer
(
typename
Ptr<
Herwig::ThreeBodyAllOnCalculator<T>
>::const_pointer in,
52
double
relerr)
53
:
_integrand
(in),
_integrator
(1e-35,relerr,1000)
54
{}
55
59
Energy4
operator ()
(
double
x)
const
{
60
Energy2 low, upp;
61
_integrand
->outerVariables(x,low,upp);
62
return
_integrator
.
value
(*
_integrand
,low,upp);
63
}
65
typedef
double
ArgType
;
67
typedef
Energy4
ValType
;
68
72
typename
Ptr<Herwig::ThreeBodyAllOnCalculator<T> >::const_pointer
_integrand
;
73
77
GSLIntegrator
_integrator
;
78
};
79
80
public
:
81
86
friend
struct
ThreeBodyAllOnOuter
;
87
88
public
:
89
103
ThreeBodyAllOnCalculator
(vector<double> inweights,
104
vector<int> intype,
105
vector<Energy> inmass,
106
vector<Energy> inwidth,
107
vector<double> inpow,
108
T inme,
int
mode,
109
Energy m1,Energy m2,Energy m3,
110
double
relerr=1e-3)
111
:
_channelweights
(inweights),
_channeltype
(intype),
_channelmass
(inmass),
112
_channelwidth
(inwidth),
_channelpower
(inpow),
_theME
(inme),
_mode
(mode),
113
_thechannel
(0),
_mapping
(inweights.size(),0),
_souter
(
ZERO
),
114
_integrator
(1e-35,relerr,1000),
_relerr
(relerr) {
115
_m
.resize(4);
116
_m
[1]=m1;
_m
[2]=m2;
_m
[3]=m3;
117
_m2
.resize(4);
118
for
(
int
ix=1;ix<4;++ix) {
119
_m2
[ix]=
sqr
(
_m
[ix]);
120
}
121
}
122
128
Energy
partialWidth
(Energy2 q2)
const
;
129
137
void
resetMass
(
int
imass,Energy mass) {
138
assert(imass<4);
139
_m
[imass]=mass;
140
_m2
[imass]=mass*mass;
141
}
142
149
Energy
getMass
(
const
int
imass)
const
{
150
assert(imass>=0&&imass<4);
151
return
_m
[imass];
152
}
153
160
Energy
otherMass
(
const
int
imass)
const
{
161
assert(imass>0&&imass<4);
162
if
(imass==1)
return
_m
[2]+
_m
[3];
163
else
if
(imass==2)
return
_m
[1]+
_m
[3];
164
else
return
_m
[1]+
_m
[2];
165
}
166
172
Energy2
operator ()
(Energy2 argument)
const
;
174
typedef
Energy2
ArgType
;
176
typedef
Energy2
ValType
;
177
178
179
protected
:
180
190
void
outerVariables
(
double
x, Energy2 & low, Energy2 & upp)
const
;
191
192
private
:
193
197
ThreeBodyAllOnCalculator
&
operator=
(
const
ThreeBodyAllOnCalculator
&) =
delete
;
198
199
private
:
200
204
vector<double>
_channelweights
;
205
209
vector<int>
_channeltype
;
210
214
vector<Energy>
_channelmass
;
215
219
vector<Energy>
_channelwidth
;
220
224
vector<double>
_channelpower
;
225
229
T
_theME
;
230
234
int
_mode
;
235
239
mutable
int
_thechannel
;
240
244
mutable
vector<int>
_mapping
;
245
249
mutable
Energy2
_souter
;
250
254
mutable
vector<Energy>
_m
;
255
259
mutable
vector<Energy2>
_m2
;
260
264
GSLIntegrator
_integrator
;
265
269
double
_relerr
;
270
};
271
}
272
273
#ifndef ThePEG_TEMPLATES_IN_CC_FILE
274
#include "ThreeBodyAllOnCalculator.tcc"
275
#endif
276
277
#endif
/* HERWIG_ThreeBodyAllOnCalculator_H */
Herwig::GSLIntegrator
This class is designed to integrate a given function between 2 limits using the gsl QAGS integration ...
Definition:
GSLIntegrator.h:40
Herwig::GSLIntegrator::value
ValT< T > value(const T &function, const typename T::ArgType lower, const typename T::ArgType upper) const
The value of the integral.
Herwig::ThreeBodyAllOnCalculator
The ThreeBodyAllOnCalculator class is designed to integrate a three-body matrix element in which all ...
Definition:
ThreeBodyAllOnCalculator.h:36
Herwig::ThreeBodyAllOnCalculator::operator=
ThreeBodyAllOnCalculator & operator=(const ThreeBodyAllOnCalculator &)=delete
Private and non-existent assignment operator.
Herwig::ThreeBodyAllOnCalculator::_mapping
vector< int > _mapping
The mapping currently in used.
Definition:
ThreeBodyAllOnCalculator.h:244
Herwig::ThreeBodyAllOnCalculator::ThreeBodyAllOnCalculator
ThreeBodyAllOnCalculator(vector< double > inweights, vector< int > intype, vector< Energy > inmass, vector< Energy > inwidth, vector< double > inpow, T inme, int mode, Energy m1, Energy m2, Energy m3, double relerr=1e-3)
Constructor with all the parameters.
Definition:
ThreeBodyAllOnCalculator.h:103
Herwig::ThreeBodyAllOnCalculator::partialWidth
Energy partialWidth(Energy2 q2) const
calculate the width for a given mass
Herwig::ThreeBodyAllOnCalculator::resetMass
void resetMass(int imass, Energy mass)
Get the mass of one of the decay products.
Definition:
ThreeBodyAllOnCalculator.h:137
Herwig::ThreeBodyAllOnCalculator::_m
vector< Energy > _m
masses of the external particles
Definition:
ThreeBodyAllOnCalculator.h:254
Herwig::ThreeBodyAllOnCalculator::_channelweights
vector< double > _channelweights
weights for the different channels
Definition:
ThreeBodyAllOnCalculator.h:204
Herwig::ThreeBodyAllOnCalculator::_channelwidth
vector< Energy > _channelwidth
the width of the resonance for a given channel
Definition:
ThreeBodyAllOnCalculator.h:219
Herwig::ThreeBodyAllOnCalculator::_channelpower
vector< double > _channelpower
the power for power-law smoothing for a given channel
Definition:
ThreeBodyAllOnCalculator.h:224
Herwig::ThreeBodyAllOnCalculator::_m2
vector< Energy2 > _m2
mass squareds of the external particles
Definition:
ThreeBodyAllOnCalculator.h:259
Herwig::ThreeBodyAllOnCalculator::_relerr
double _relerr
Relative error for the integration.
Definition:
ThreeBodyAllOnCalculator.h:269
Herwig::ThreeBodyAllOnCalculator::_mode
int _mode
The mode.
Definition:
ThreeBodyAllOnCalculator.h:234
Herwig::ThreeBodyAllOnCalculator::getMass
Energy getMass(const int imass) const
Get the mass of one of the decay products.
Definition:
ThreeBodyAllOnCalculator.h:149
Herwig::ThreeBodyAllOnCalculator::outerVariables
void outerVariables(double x, Energy2 &low, Energy2 &upp) const
shift the variables for the outer integrand and give limits for the inner one.
Herwig::ThreeBodyAllOnCalculator::_channeltype
vector< int > _channeltype
the types for the different channels
Definition:
ThreeBodyAllOnCalculator.h:209
Herwig::ThreeBodyAllOnCalculator::ValType
Energy2 ValType
Return type for the GSLIntegrator.
Definition:
ThreeBodyAllOnCalculator.h:176
Herwig::ThreeBodyAllOnCalculator::operator()
Energy2 operator()(Energy2 argument) const
The integrand for the inner integrand.
Herwig::ThreeBodyAllOnCalculator::_thechannel
int _thechannel
the channel currently being integrated
Definition:
ThreeBodyAllOnCalculator.h:239
Herwig::ThreeBodyAllOnCalculator::_souter
Energy2 _souter
the value of s for the outer integral
Definition:
ThreeBodyAllOnCalculator.h:249
Herwig::ThreeBodyAllOnCalculator::ArgType
Energy2 ArgType
Argument type for the GSLIntegrator.
Definition:
ThreeBodyAllOnCalculator.h:174
Herwig::ThreeBodyAllOnCalculator::otherMass
Energy otherMass(const int imass) const
Get the masses of all bar the one specified.
Definition:
ThreeBodyAllOnCalculator.h:160
Herwig::ThreeBodyAllOnCalculator::_theME
T _theME
Function giving the matrix element as a function of s12,s13,s23.
Definition:
ThreeBodyAllOnCalculator.h:229
Herwig::ThreeBodyAllOnCalculator::ThreeBodyAllOnOuter
friend struct ThreeBodyAllOnOuter
The ThreeBodyAllOnOuter class is a friend so it can access the private members and perform the integr...
Definition:
ThreeBodyAllOnCalculator.h:86
Herwig::ThreeBodyAllOnCalculator::_integrator
GSLIntegrator _integrator
member to do the integration
Definition:
ThreeBodyAllOnCalculator.h:264
Herwig::ThreeBodyAllOnCalculator::_channelmass
vector< Energy > _channelmass
the mass of the resonance for a given channel
Definition:
ThreeBodyAllOnCalculator.h:214
Herwig::WidthCalculatorBase
The WidthCalculatorBase class is a base class to be used by classes which calculate partial widths fo...
Definition:
WidthCalculatorBase.h:29
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
ThePEG
ThePEG::ZERO
constexpr ZeroUnit ZERO
ThePEG::sqr
constexpr auto sqr(const T &x) -> decltype(x *x)
Herwig::ThreeBodyAllOnCalculator::Outer
The class for the outer integrand of the integral of a three body decay matrix element.
Definition:
ThreeBodyAllOnCalculator.h:46
Herwig::ThreeBodyAllOnCalculator::Outer::ValType
Energy4 ValType
Return type for the GSLIntegrator.
Definition:
ThreeBodyAllOnCalculator.h:67
Herwig::ThreeBodyAllOnCalculator::Outer::Outer
Outer(typename Ptr< Herwig::ThreeBodyAllOnCalculator< T > >::const_pointer in, double relerr)
Constructor with a pointer to the ThreeBodyAllOnCalculator.
Definition:
ThreeBodyAllOnCalculator.h:51
Herwig::ThreeBodyAllOnCalculator::Outer::_integrand
Ptr< Herwig::ThreeBodyAllOnCalculator< T > >::const_pointer _integrand
pointer to the decay integrator
Definition:
ThreeBodyAllOnCalculator.h:72
Herwig::ThreeBodyAllOnCalculator::Outer::ArgType
double ArgType
Argument type for the GSLIntegrator.
Definition:
ThreeBodyAllOnCalculator.h:65
Herwig::ThreeBodyAllOnCalculator::Outer::operator()
Energy4 operator()(double x) const
Retreive function value.
Definition:
ThreeBodyAllOnCalculator.h:59
Herwig::ThreeBodyAllOnCalculator::Outer::_integrator
GSLIntegrator _integrator
GSL integration class.
Definition:
ThreeBodyAllOnCalculator.h:77
Generated on Thu Jun 20 2024 17:50:53 for Herwig by
1.9.6