Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:24:21

0001 // -*- C++ -*-
0002 //
0003 // ThreeBodyAllOn1IntegralCalculator.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef HERWIG_ThreeBodyAllOn1IntegralCalculator_H
0010 #define HERWIG_ThreeBodyAllOn1IntegralCalculator_H
0011 // This is the declaration of the ThreeBodyAllOn1IntegralCalculator class.
0012 
0013 #include "WidthCalculatorBase.h"
0014 #include "Herwig/Utilities/GSLIntegrator.h"
0015 
0016 namespace Herwig {
0017 using namespace ThePEG;
0018 
0019 /** \ingroup PDT
0020  *
0021  * The ThreeBodyAllOn1IntegralCalculator class is designed to integrate
0022  * a function which gives \f$d\Gamma/dm^2_{ij}\f$ to give the partial width.
0023  *
0024  * @see WidthCalculatorBase
0025  * @see ThreeBodyAllOn1IntegralOuter
0026  */
0027 template<class T>
0028 class ThreeBodyAllOn1IntegralCalculator: public WidthCalculatorBase {
0029 
0030 public:
0031 
0032   /**
0033    * Constructor with the \f$d\Gamma/ds\f$ as a function.
0034    * @param intype The types of the different integration channels.
0035    * @param inmass The mass for the Jacobian for the different channels.
0036    * @param inwidth The width for the Jacobian for the different channels.
0037    * @param inpow  The power for the power-law smoothing function
0038    * @param indGamma The pointer to the function which gives \f$d\Gamma/ds\f$.
0039    * @param mode The mode to be calculated
0040    * @param m1 The mass of the first particle.
0041    * @param m2 The mass of the second particle.
0042    * @param m3 The mass of the third  particle.
0043    */
0044   ThreeBodyAllOn1IntegralCalculator(int intype, Energy inmass, Energy inwidth,
0045                     double inpow, T indGamma,int mode,
0046                     Energy m1,Energy m2,Energy m3)
0047     : _variabletype(intype),_intmass(inmass),_intwidth(inwidth),
0048       _intpower(inpow),_mode(mode), _theDgamma(indGamma) {
0049     _m .resize(4);
0050     _m2.resize(4);
0051     _m[1]=m1;_m[2]=m2;_m[3]=m3;
0052     for(int ix=1;ix<4;++ix)_m2[ix]=sqr(_m[ix]);
0053   }
0054   
0055   /**
0056    * calculate the width for a given mass
0057    * @param q2 The mass squared of the decaying particle.
0058    * @return The partial width.
0059    */
0060   Energy partialWidth(Energy2 q2) const;
0061 
0062   /**
0063    * Get the mass of one of the decay products.  This must be 
0064    * implemented in classes inheriting from this one.
0065    * @param imass The mass required.
0066    * @param mass The new value.
0067    * @return The mass required.
0068    */
0069   void resetMass(int imass,Energy mass) {
0070     assert(imass<4);
0071     _m[imass]=mass;
0072     _m2[imass]=mass*mass;
0073   }
0074 
0075   /**
0076    * Get the mass of one of the decay products.  This must be 
0077    * implemented in classes inheriting from this one.
0078    * @param imass The mass required.
0079    * @return The mass required.
0080    */
0081   Energy getMass(const int imass) const {
0082     assert(imass<4);
0083     return _m[imass]; 
0084   }
0085 
0086   /**
0087    * Get the masses of all bar the one specified. Used to get the limits
0088    * for integration.
0089    * @param imass The particle not needed
0090    * @return The sum of the other masses.
0091    */
0092   Energy otherMass(const int imass) const {
0093     assert(imass>0&&imass<4);
0094     if(imass==1)      return _m[2]+_m[3];
0095     else if(imass==2) return _m[1]+_m[3];
0096     else              return _m[1]+_m[2];
0097   }
0098 
0099   /**
0100    * The integrand for the inner integrand.
0101    * @param argument The mass squared for the inner integral
0102    * @return The value of the inner integrand.
0103    */
0104   Energy operator ()(double argument) const;
0105   /** Argument type for the GSLIntegrator */
0106   typedef double ArgType;
0107   /** Return type for the GSLIntegrator */
0108   typedef Energy ValType;
0109 
0110 private:
0111 
0112   /**
0113    * Private and non-existent assignment operator.
0114    */
0115   ThreeBodyAllOn1IntegralCalculator & 
0116   operator=(const ThreeBodyAllOn1IntegralCalculator &) = delete;
0117 
0118 private:
0119 
0120   /**
0121    * which scale we are using
0122    */
0123   int _variabletype;
0124 
0125   /**
0126    * The mass for the jacobian
0127    */
0128   Energy _intmass;
0129 
0130   /**
0131    * The width for the jacobian
0132    */
0133   Energy _intwidth;
0134 
0135   /**
0136    * The power for power-law smoothing
0137    */
0138   double _intpower;
0139 
0140 
0141   /**
0142    *  The mode to be integrated
0143    */
0144   int _mode;
0145 
0146   /**
0147    * masses of the external particles
0148    */
0149   mutable vector<Energy>  _m;
0150 
0151   /**
0152    * mass squareds of the external particles
0153    */
0154   mutable vector<Energy2> _m2;
0155 
0156   /**
0157    * The function for the differential rate
0158    */
0159   T _theDgamma;
0160 
0161   /**
0162    * the integrator
0163    */
0164   GSLIntegrator _integrator;
0165 
0166 };
0167 }
0168 
0169 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
0170  #include "ThreeBodyAllOn1IntegralCalculator.tcc"
0171 #endif
0172 
0173 #endif /* HERWIG_ThreeBodyAllOn1IntegralCalculator_H */