herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
ThreeBodyAllOn1IntegralCalculator.h
1 // -*- C++ -*-
2 //
3 // ThreeBodyAllOn1IntegralCalculator.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_ThreeBodyAllOn1IntegralCalculator_H
10 #define HERWIG_ThreeBodyAllOn1IntegralCalculator_H
11 // This is the declaration of the ThreeBodyAllOn1IntegralCalculator class.
12 
13 #include "WidthCalculatorBase.h"
14 #include "Herwig/Decay/DecayIntegrator.h"
15 #include "Herwig/Decay/DecayPhaseSpaceMode.h"
16 #include "Herwig/Utilities/GSLIntegrator.h"
17 
18 namespace Herwig {
19 using namespace ThePEG;
20 
29 template<class T>
31 
32 public:
33 
46  ThreeBodyAllOn1IntegralCalculator(int intype, Energy inmass, Energy inwidth,
47  double inpow, T indGamma,int mode,
48  Energy m1,Energy m2,Energy m3)
49  : _variabletype(intype),_intmass(inmass),_intwidth(inwidth),
50  _intpower(inpow),_mode(mode), _theDgamma(indGamma) {
51  _m .resize(4);
52  _m2.resize(4);
53  _m[1]=m1;_m[2]=m2;_m[3]=m3;
54  for(int ix=1;ix<4;++ix)_m2[ix]=sqr(_m[ix]);
55  }
56 
62  Energy partialWidth(Energy2 q2) const;
63 
71  void resetMass(int imass,Energy mass) {
72  assert(imass<4);
73  _m[imass]=mass;
74  _m2[imass]=mass*mass;
75  }
76 
83  Energy getMass(const int imass) const {
84  assert(imass<4);
85  return _m[imass];
86  }
87 
94  Energy otherMass(const int imass) const {
95  assert(imass>0&&imass<4);
96  if(imass==1) return _m[2]+_m[3];
97  else if(imass==2) return _m[1]+_m[3];
98  else return _m[1]+_m[2];
99  }
100 
106  Energy operator ()(double argument) const;
108  typedef double ArgType;
110  typedef Energy ValType;
111 
112 private:
113 
118  operator=(const ThreeBodyAllOn1IntegralCalculator &) = delete;
119 
120 private:
121 
126 
130  Energy _intmass;
131 
135  Energy _intwidth;
136 
140  double _intpower;
141 
142 
146  int _mode;
147 
151  mutable vector<Energy> _m;
152 
156  mutable vector<Energy2> _m2;
157 
162 
167 
168 };
169 }
170 
171 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
172  #include "ThreeBodyAllOn1IntegralCalculator.tcc"
173 #endif
174 
175 #endif /* HERWIG_ThreeBodyAllOn1IntegralCalculator_H */
vector< Energy > _m
masses of the external particles
T _theDgamma
The function for the differential rate.
double ArgType
Argument type for the GSLIntegrator.
The WidthCalculatorBase class is a base class to be used by classes which calculate partial widths fo...
Energy ValType
Return type for the GSLIntegrator.
The ThreeBodyAllOn1IntegralCalculator class is designed to integrate a function which gives to give ...
constexpr auto sqr(const T &x) -> decltype(x *x)
void resetMass(int imass, Energy mass)
Get the mass of one of the decay products.
double _intpower
The power for power-law smoothing.
vector< Energy2 > _m2
mass squareds of the external particles
Energy getMass(const int imass) const
Get the mass of one of the decay products.
Energy otherMass(const int imass) const
Get the masses of all bar the one specified.
-*- C++ -*-
This class is designed to integrate a given function between 2 limits using the gsl QAGS integration ...
Definition: GSLIntegrator.h:40
ThreeBodyAllOn1IntegralCalculator(int intype, Energy inmass, Energy inwidth, double inpow, T indGamma, int mode, Energy m1, Energy m2, Energy m3)
Constructor with the as a function.