herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
OneOffShellCalculator.h
1 // -*- C++ -*-
2 //
3 // OneOffShellCalculator.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_OneOffShellCalculator_H
10 #define HERWIG_OneOffShellCalculator_H
11 //
12 // This is the declaration of the OneOffShellCalculator class.
13 //
14 #include "GenericMassGenerator.h"
15 #include "WidthCalculatorBase.h"
16 #include "OneOffShellCalculator.fh"
17 #include "Herwig/Utilities/GSLIntegrator.h"
18 
19 
20 namespace Herwig {
21 using namespace ThePEG;
22 
23 struct OneOffShellIntegrand;
24 
36 
37 public:
38 
43  friend struct OneOffShellIntegrand;
44 
45 public:
46 
55  OneOffShellCalculator(int inloc,WidthCalculatorBasePtr inwidth,
56  GenericMassGeneratorPtr inmass,
57  Energy inmin)
58  : _themass(inloc), _minmass(inmin),_onshellwidth(inwidth),_massptr(inmass)
59  {}
60 
66  Energy partialWidth(Energy2 scale) const;
67 
75  void resetMass(int imass,Energy mass) {
76  _onshellwidth->resetMass(imass,mass);
77  }
78 
85  Energy getMass(const int imass) const {
86  return _onshellwidth->getMass(imass);
87  }
88 
95  Energy otherMass(const int imass) const {
96  return _onshellwidth->otherMass(imass);
97  }
98 
99 protected:
100 
106  Energy dGamma(Energy min) const {
107  _onshellwidth->resetMass(_themass,min);
108  Energy wgt = (_onshellwidth->partialWidth(_scale));
109  wgt*=(_massptr->weight(min));
110  return wgt;
111  }
112 
113 private:
114 
118  OneOffShellCalculator & operator=(const OneOffShellCalculator &) = delete;
119 
120 private:
121 
125  int _themass;
126 
130  Energy _minmass;
131 
135  WidthCalculatorBasePtr _onshellwidth;
136 
140  GenericMassGeneratorPtr _massptr;
141 
146 
150  mutable Energy2 _scale;
151 
152 };
153 
154 
163 
173  OneOffShellIntegrand(tcOneOffShellCalculatorPtr in,Energy2 m2,Energy2 mw)
174  : _integrand(in),_mass2(m2),_mwidth(mw)
175  {}
176 
180  Energy operator ()(double x) const {
181  return _integrand->dGamma(sqrt(_mass2+_mwidth*tan(x)));
182  }
184  typedef double ArgType;
186  typedef Energy ValType;
187 
191  tcOneOffShellCalculatorPtr _integrand;
192 
196  Energy2 _mass2;
197 
201  Energy2 _mwidth;
202 };
203 }
204 
205 #endif /* HERWIG_OneOffShellCalculator_H */
int _themass
which mass is offshell.
double sqrt(int x)
The WidthCalculatorBase class is a base class to be used by classes which calculate partial widths fo...
Energy2 _mass2
The mass squared for the off-shell particle for the Jacobian transform.
Energy getMass(const int imass) const
Get the mass of one of the decay products.
WidthCalculatorBasePtr _onshellwidth
pointer to object calculating the on-shell width.
Energy _minmass
the minimum allowed mass.
OneOffShellIntegrand(tcOneOffShellCalculatorPtr in, Energy2 m2, Energy2 mw)
Constructor.
GSLIntegrator _integrator
integrator
OneOffShellCalculator(int inloc, WidthCalculatorBasePtr inwidth, GenericMassGeneratorPtr inmass, Energy inmin)
Constructor which should be used setting all the required members.
Class for the integrand of a matrix element where one of the outgoing particles is off-shell...
GenericMassGeneratorPtr _massptr
pointer to object calculating the mass of the particle.
Energy ValType
Return type for the GSLIntegrator.
Use another WidthCalculatorBase object to integrate over the mass of on of the external particles whi...
void resetMass(int imass, Energy mass)
Get the mass of one of the decay products.
tcOneOffShellCalculatorPtr _integrand
pointer to the decay integrator
Energy2 _scale
the mass squared of the decaying particle
double ArgType
Argument type for the GSLIntegrator.
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 min) const
The integrand.
Energy otherMass(const int imass) const
Get the masses of all bar the one specified.