herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
TwoOffShellCalculator.h
1 // -*- C++ -*-
2 //
3 // TwoOffShellCalculator.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_TwoOffShellCalculator_H
10 #define HERWIG_TwoOffShellCalculator_H
11 //
12 // This is the declaration of the TwoOffShellCalculator class.
13 //
14 #include "WidthCalculatorBase.h"
15 #include "GenericMassGenerator.h"
16 #include "TwoOffShellCalculator.fh"
17 #include "OneOffShellCalculator.fh"
18 #include "Herwig/Utilities/GSLIntegrator.h"
19 
20 namespace Herwig {
21 using namespace ThePEG;
22 
23 struct TwoOffShellIntegrand;
24 
34 
39 friend struct TwoOffShellIntegrand;
40 
41 public:
42 
53  TwoOffShellCalculator(int inloc, WidthCalculatorBasePtr inwidth,
54  GenericMassGeneratorPtr inmass,
55  Energy inmin2,Energy inmin1)
56  : _themass(inloc),_minmass(inmin2),_mother(inmin1),_oneoffwidth(inwidth),
57  _massptr(inmass)
58  {}
59 
65  Energy partialWidth(Energy2 scale) const;
66 
74  void resetMass(int imass,Energy mass) {
75  _oneoffwidth->resetMass(imass,mass);
76  }
77 
84  Energy getMass(const int imass) const {
85  return _oneoffwidth->getMass(imass);
86  }
87 
94  Energy otherMass(const int imass) const {
95  return _oneoffwidth->otherMass(imass);
96  }
97 
98 protected:
99 
105  Energy dGamma(Energy mass) const {
106  _oneoffwidth->resetMass(_themass,mass);
107  Energy wgt = (_oneoffwidth->partialWidth(_scale));
108  wgt*=(_massptr->weight(mass));
109  return wgt;
110  }
111 
112 private:
113 
117  TwoOffShellCalculator & operator=(const TwoOffShellCalculator &) = delete;
118 
119 private:
120 
125  int _themass;
129  Energy _minmass;
130 
134  Energy _mother;
135 
139  WidthCalculatorBasePtr _oneoffwidth;
140 
144  GenericMassGeneratorPtr _massptr;
145 
150 
154  mutable Energy2 _scale;
155 
156 };
157 
158 
174  TwoOffShellIntegrand(tcTwoOffShellCalculatorPtr in,Energy2 m2,Energy2 mw)
175  : _integrand(in),_mass2(m2),_mwidth(mw)
176  {}
177 
181  Energy operator ()(double x) const {
182  return _integrand->dGamma(sqrt(_mass2+_mwidth*tan(x)));
183  }
185  typedef double ArgType;
187  typedef Energy ValType;
188 
189 private:
190 
194  cTwoOffShellCalculatorPtr _integrand;
195 
199  Energy2 _mass2;
200 
204  Energy2 _mwidth;
205 };
206 }
207 
208 #endif /* HERWIG_TwoOffShellCalculator_H */
Energy ValType
Return type for the GSLIntegrator.
double sqrt(int x)
cTwoOffShellCalculatorPtr _integrand
pointer to the decay integrator
The WidthCalculatorBase class is a base class to be used by classes which calculate partial widths fo...
WidthCalculatorBasePtr _oneoffwidth
pointer to object calculating the width for one-off shell particle.
GSLIntegrator _integrator
integrator
void resetMass(int imass, Energy mass)
Get the mass of one of the decay products.
Energy2 _mass2
The mass squared for the off-shell particle for the Jacobian transform.
Energy _mother
sum of the masses of the other decay products
Energy2 _scale
the mass squared of the decaying particle
TwoOffShellIntegrand(tcTwoOffShellCalculatorPtr in, Energy2 m2, Energy2 mw)
Constructor.
TwoOffShellCalculator(int inloc, WidthCalculatorBasePtr inwidth, GenericMassGeneratorPtr inmass, Energy inmin2, Energy inmin1)
Constructor which should be used setting all the required members.
GenericMassGeneratorPtr _massptr
pointer to object calculating the mass of the particle
Use WidthCalculatorBase objects to integrate over the mass of two external particles which can be off...
Energy getMass(const int imass) const
Get the mass of one of the decay products.
int _themass
The second mass which is offshell.
Class for the integrand of a matrix element where two of the outgoing particles is off-shell...
Energy2 _mwidth
The mass times width for the off-shell particle for the Jacobian transform.
-*- C++ -*-
This class is designed to integrate a given function between 2 limits using the gsl QAGS integration ...
Definition: GSLIntegrator.h:40
Energy dGamma(Energy mass) const
The integrand.
double ArgType
Argument type for the GSLIntegrator.
Energy otherMass(const int imass) const
Get the masses of all bar the one specified.
Energy _minmass
the minimum allowed mass