Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // YFSFormFactors.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_YFSFormFactors_H
0010 #define HERWIG_YFSFormFactors_H
0011 //
0012 // This is the declaration of the YFSFormFactors class.
0013 //
0014 
0015 #include "ThePEG/Config/ThePEG.h"
0016 #include "Herwig/Utilities/Maths.h"
0017 
0018 namespace Herwig {
0019 
0020 using namespace ThePEG;
0021 
0022 /**
0023  * The YFSFormFactors class is a pure static class which implements the various YFS
0024  * form factors we need for the decays.
0025  */
0026 class YFSFormFactors {
0027 
0028 public:
0029 
0030   /**
0031    *  The value of \f$\alpha\f$ at \f$q^2=0\f$.
0032    */
0033   static const double _alpha;
0034 
0035 private:
0036   /**
0037    *  The default value of the photon mass
0038    */
0039   static const Energy _mgamma;
0040 
0041   /**
0042    *  The cut-off on the value of \f$t\f$ for the switch to the $t=0$ result
0043    */
0044   static const Energy2 _tcut;
0045 
0046   /**
0047    *  The cut-off on the energy of a particle for it to be considered in its rest frame
0048    */
0049   static const Energy _ecut;
0050 
0051 public:
0052 
0053   /**
0054    *  Exponentials of the YFS form factors
0055    */
0056   //@{
0057   /**
0058    * The exponential of the YFS form factor for the initial-final dipole
0059    * @param beta0 Velocity of the incoming charged particle, \f$\beta_0\f$
0060    * @param beta1 Velocity of the outgoing charged particle, \f$\beta_1\f$.
0061    * @param ombeta0 One minus the velocity of the incoming particle,  \f$1-\beta_0\f$
0062    * @param ombeta1 One minus the velocity of the outgoing particle,  \f$1-\beta_1\f$
0063    * @param en0 The energy of the incoming particle
0064    * @param en1 The energy of the outgoing particle
0065    * @param m0  The mass   of the incoming particle
0066    * @param m1  The mass   of the outgoing particle
0067    * @param t   The invariant mass of the charged particles
0068    * @param charge The product of the charges of the particles in the dipole
0069    * @param emin The minimum photon energy
0070    */
0071   static double exponentialYFSIF(double  beta0,double  ombeta0,
0072                     double  beta1,double  ombeta1,
0073                     Energy  en0  ,Energy  en1    ,
0074                     Energy  m0   ,Energy  m1     , 
0075                     Energy2 t    ,double  charge ,
0076                     Energy  emin) {
0077     return exp(YFSIF(beta0,ombeta0,beta1,ombeta1,en0,en1,m0,m1,t,charge,emin));
0078   }
0079   /**
0080    * The exponential of the YFS form factor for the final-final dipole
0081    * The \f$2\alpha\tilde{B}\f$ function for the final-final dipole
0082    * @param beta1 Velocity of the first  charged particle, \f$\beta_1\f$
0083    * @param beta2 Velocity of the second charged particle, \f$\beta_2\f$.
0084    * @param ombeta1 One minus the velocity of the first  particle,  \f$1-\beta_1\f$
0085    * @param ombeta2 One minus the velocity of the second particle,  \f$1-\beta_2\f$
0086    * @param en1 The energy of the first  particle
0087    * @param en2 The energy of the second particle
0088    * @param m1  The mass   of the first  particle
0089    * @param m2  The mass   of the second particle
0090    * @param s   The invariant mass of the charged particles
0091    * @param charge The product of the charges of the particles in the dipole
0092    * @param emin The minimum photon energy
0093    */
0094   static double exponentialYFSFF(double  beta1, double  ombeta1,
0095                  double  beta2, double  ombeta2,
0096                  Energy  en1  , Energy  en2    ,
0097                  Energy  m1   , Energy  m2     , 
0098                  Energy2 s    , double  charge ,
0099                  Energy  emin) {
0100     return exp(YFSFF(beta1,ombeta1,beta2,ombeta2,en1,en2,m1,m2,s,charge,emin));
0101   }
0102   //@}
0103   /**
0104    *  The YFS form factors for the initial-final and final-final dipoles
0105    */
0106   //@{
0107   /**
0108    *  The YFS form factor for the initial-final dipole
0109    * @param beta0 Velocity of the incoming charged particle, \f$\beta_0\f$
0110    * @param beta1 Velocity of the outgoing charged particle, \f$\beta_1\f$.
0111    * @param ombeta0 One minus the velocity of the incoming particle,  \f$1-\beta_0\f$
0112    * @param ombeta1 One minus the velocity of the outgoing particle,  \f$1-\beta_1\f$
0113    * @param en0 The energy of the incoming particle
0114    * @param en1 The energy of the outgoing particle
0115    * @param m0  The mass   of the incoming particle
0116    * @param m1  The mass   of the outgoing particle
0117    * @param t   The invariant mass of the charged particles
0118    * @param charge The product of the charges of the particles in the dipole
0119    * @param emin The minimum photon energy
0120    */
0121   static double YFSIF(double  beta0   ,double  ombeta0 ,
0122               double  beta1   ,double  ombeta1 ,
0123               Energy  en0     ,Energy  en1     ,
0124               Energy  m0      ,Energy  m1      , 
0125               Energy2 t       ,double  charge  ,
0126               Energy  emin) {
0127     return BtildeIF(beta0,ombeta0,beta1,ombeta1,en0,en1,m0,m1,t,charge,emin,false)
0128       +ReBIF(m0,m1,t,charge,false);
0129   }
0130   /**
0131    *  The YFS form factor for the final-final dipole
0132    * The \f$2\alpha\tilde{B}\f$ function for the final-final dipole
0133    * @param beta1 Velocity of the first  charged particle, \f$\beta_1\f$
0134    * @param beta2 Velocity of the second charged particle, \f$\beta_2\f$.
0135    * @param ombeta1 One minus the velocity of the first  particle,  \f$1-\beta_1\f$
0136    * @param ombeta2 One minus the velocity of the second particle,  \f$1-\beta_2\f$
0137    * @param en1 The energy of the first  particle
0138    * @param en2 The energy of the second particle
0139    * @param m1  The mass   of the first  particle
0140    * @param m2  The mass   of the second particle
0141    * @param s   The invariant mass of the charged particles
0142    * @param charge The product of the charges of the particles in the dipole
0143    * @param emin The minimum photon energy
0144    */
0145   static double YFSFF(double  beta1   ,double  ombeta1 ,
0146               double  beta2   ,double  ombeta2 ,
0147               Energy  en1     ,Energy  en2     ,
0148               Energy  m1      ,Energy  m2      , 
0149               Energy2 s       ,double  charge  ,
0150               Energy  emin) {
0151     return BtildeFF(beta1,ombeta1,beta2,ombeta2,en1,en2,m1,m2,s,charge,emin,false)
0152       +ReBFF(m1,m2,s,charge,false);
0153   }
0154   //@}
0155 
0156   /**
0157    * Crude average multiplicities for initial-final and final-final dipoles
0158    */
0159   //@{
0160   /** Crude multiplicity for the final-final dipole
0161    * @param beta1 Velocity of the first  charged particle, \f$\beta_1\f$
0162    * @param beta2 Velocity of the second charged particle, \f$\beta_2\f$.
0163    * @param ombeta1 One minus the velocity of the first  particle,  \f$1-\beta_1\f$
0164    * @param ombeta2 One minus the velocity of the second particle,  \f$1-\beta_2\f$
0165    * @param charge The product of the charges of the particles in the dipole
0166    * @param Emin The maximum energy for the integral
0167    * @param Emax The minimum energy for the integral
0168    * @param massterms Whether or not to include the mass terms
0169    */
0170   static double nbarFF(double beta1, double ombeta1,
0171                   double beta2, double ombeta2,
0172                   double charge,
0173                   Energy Emax , Energy Emin,
0174                   bool massterms=false) {
0175     if(!massterms)
0176       return -_alpha/Constants::pi*charge*
0177     ((1.+beta1*beta2)/(beta1+beta2)*(+log((1.+beta1)/ombeta1)
0178                      +log((1.+beta2)/ombeta2)))*log(Emax/Emin);
0179     else
0180       return -_alpha/Constants::pi*charge*
0181     ((1.+beta1*beta2)/(beta1+beta2)*(+log((1.+beta1)/ombeta1)
0182                      +log((1.+beta2)/ombeta2))-2.)*log(Emax/Emin);
0183   }
0184 
0185   /**
0186    * Crude multiplicity for the initial-final dipole
0187    * @param beta Velocity of the outgoing charged particle, \f$\beta\f$
0188    * @param ombeta One minus the velocity of the outgoing charged  particle,
0189    *  \f$1-\beta\f$
0190    * @param charge The product of the charges of the particles in the dipole
0191    * @param Emin The maximum energy for the integral
0192    * @param Emax The minimum energy for the integral
0193    * @param massterms Whether or not to include the mass terms
0194    */
0195   //@}
0196   static double nbarIF(double beta, double ombeta,
0197                double charge,
0198                Energy Emax , Energy Emin,
0199                bool massterms=false) {
0200     if(!massterms)
0201       return -_alpha/Constants::pi*charge/beta* log((1.+beta)/ombeta)    *log(Emax/Emin);
0202     else
0203       return -_alpha/Constants::pi*charge/beta*(log((1.+beta)/ombeta)-2.)*log(Emax/Emin);
0204   }
0205 
0206   /**
0207    *  The virtual piece for the initial-final and final-final dipoles
0208    */
0209   //@{
0210   /**
0211    * The \f$2\alpha\mathcal{R}B\f$ function for the initial-final dipole
0212    * @param m0  The mass   of the incoming particle
0213    * @param m1  The mass   of the outgoing particle
0214    * @param t   The invariant mass of the charged particles
0215    * @param charge The product of the charges of the particles in the dipole
0216    * @param includegamma Include the photon mass terms
0217    * @param mgamma The photon mass,
0218    */
0219   static double ReBIF(Energy  m0      ,Energy  m1      , Energy2 t       ,
0220               double  charge  ,bool    includegamma=true,
0221               Energy  mgamma=_mgamma);
0222   
0223   /**
0224    *  The \f$2\alpha\mathcal{R}B\f$ function for the final-final dipole
0225    * @param m1  The mass   of the incoming particle
0226    * @param m2  The mass   of the outgoing particle
0227    * @param s   The invariant mass of the charged particles
0228    * @param charge The product of the charges of the particles in the dipole
0229    * @param includegamma Include the photon mass terms
0230    * @param mgamma The photon mass,
0231    */
0232   static double ReBFF(Energy m1,Energy m2,Energy2 s,double  charge,
0233               bool    includegamma=true,Energy  mgamma=_mgamma);
0234   //@}
0235 
0236   /**
0237    *   The real emission terms for initial-final and final-final dipoles
0238    */
0239   //@{
0240   /**
0241    *  The \f$2\alpha\tilde{B}\f$ function for the initial-final dipole
0242    * @param beta0 Velocity of the incoming charged particle, \f$\beta_0\f$
0243    * @param beta1 Velocity of the outgoing charged particle, \f$\beta_1\f$.
0244    * @param ombeta0 One minus the velocity of the incoming particle,  \f$1-\beta_0\f$
0245    * @param ombeta1 One minus the velocity of the outgoing particle,  \f$1-\beta_1\f$
0246    * @param en0 The energy of the incoming particle
0247    * @param en1 The energy of the outgoing particle
0248    * @param m0  The mass   of the incoming particle
0249    * @param m1  The mass   of the outgoing particle
0250    * @param t   The invariant mass of the charged particles
0251    * @param charge The product of the charges of the particles in the dipole
0252    * @param emin The minimum photon energy
0253    * @param includegamma Include the photon mass terms
0254    * @param mgamma The photon mass,
0255    */
0256   static double BtildeIF(double  beta0   ,double  ombeta0 ,
0257              double  beta1   ,double  ombeta1 ,
0258              Energy  en0     ,Energy  en1     ,
0259              Energy  m0      ,Energy  m1      , 
0260              Energy2 t       ,double  charge  ,
0261              Energy  emin    ,bool    includegamma=true,
0262              Energy  mgamma=_mgamma);
0263 
0264   /**
0265    * The \f$2\alpha\tilde{B}\f$ function for the final-final dipole
0266    * @param beta1 Velocity of the first  charged particle, \f$\beta_1\f$
0267    * @param beta2 Velocity of the second charged particle, \f$\beta_2\f$.
0268    * @param ombeta1 One minus the velocity of the first  particle,  \f$1-\beta_1\f$
0269    * @param ombeta2 One minus the velocity of the second particle,  \f$1-\beta_2\f$
0270    * @param en1 The energy of the first  particle
0271    * @param en2 The energy of the second particle
0272    * @param m1  The mass   of the first  particle
0273    * @param m2  The mass   of the second particle
0274    * @param s   The invariant mass of the charged particles
0275    * @param charge The product of the charges of the particles in the dipole
0276    * @param emin The minimum photon energy
0277    * @param includegamma Include the photon mass terms
0278    * @param mgamma The photon mass,
0279    */
0280   static double BtildeFF(double  beta1   ,double  ombeta1 ,
0281              double  beta2   ,double  ombeta2 ,
0282              Energy  en1     ,Energy  en2     ,
0283              Energy  m1      ,Energy  m2      , 
0284              Energy2 s       ,double  charge  ,
0285              Energy  emin    ,bool    includegamma=true,
0286              Energy  mgamma=_mgamma);
0287   //@}
0288   
0289   /**
0290    * Access to the photon mass
0291    */
0292   static Energy photonMass() {return _mgamma;}
0293 
0294 private:
0295 
0296   /**
0297    *  Various special cases of the \f$A_4\f$ functions of hep-ph/0302065 for
0298    *  the initial-final dipole
0299    */
0300   //@{
0301   /**
0302    * The \f$A_4\f$ function for the full final-final dipole
0303    * @param inen1 The energy of the first  particle
0304    * @param inen2 The energy of the second particle
0305    * @param beta1 Velocity of the first  particle, \f$\beta_1\f$
0306    * @param beta2 Velocity of the second particle, \f$\beta_2\f$.
0307    * @param inm1 The mass of the first particle
0308    * @param inm2 The mass of the second particle
0309    * @param s   The invariant mass of the charged particles
0310    */
0311   static InvEnergy2 A4FFFull(Energy  inen1  ,Energy inen2,
0312                  double  beta1,double beta2,
0313                  Energy   inm1  ,Energy inm2,Energy2 s    );
0314   
0315   /**
0316    *  The \f$A_4\f$ function of hep-ph0302065 using the special cases where
0317    *  necessary for numerical stability
0318    * @param beta0 Velocity of the incoming charged particle, \f$\beta_0\f$
0319    * @param beta1 Velocity of the outgoing charged particle, \f$\beta_1\f$.
0320    * @param ombeta0 One minus the velocity of the incoming particle,  \f$1-\beta_0\f$
0321    * @param ombeta1 One minus the velocity of the outgoing particle,  \f$1-\beta_1\f$
0322    * @param en0 The energy of the incoming particle
0323    * @param en1 The energy of the outgoing particle
0324    * @param m0 The mass of the incoming particle
0325    * @param m1 The mass of the outgoing particle
0326    * @param t  The invariant mass of the charged particles
0327    */
0328   static InvEnergy2 A4IF(double  beta0   ,double  ombeta0 ,
0329              double  beta1   ,double  ombeta1 ,
0330              Energy  en0  ,Energy en1  , Energy  m0   ,Energy m1   ,
0331              Energy2 t);
0332   
0333   /**
0334    * The \f$A_4\f$ function of hep-ph/0302065 for a single particle, without the \f$1/p^2\f$
0335    * pre-factor
0336    */
0337   static double A4single(double beta,double ombeta) {
0338     if(beta>0.01) return log(ombeta/(1.+beta))/beta;
0339     else          return -2.-2./3.*sqr(beta)*(1+0.6*sqr(beta));
0340   }
0341 
0342   /**
0343    * The \f$A_4\f$ function of hep-ph/0302065 for the initial-final dipole with \f$t=0\f$ in the
0344    * rest frame.
0345    * @param m0 The mass of the incoming particle
0346    * @param m1 The mass of the outgoing particle
0347    */
0348   static InvEnergy2 A4IFRestZero(Energy  m0, Energy m1) {
0349     Energy2 mdiff(m0*m0-m1*m1);
0350     return -2./mdiff*(sqr(log(m0/m1))+Math::ReLi2(mdiff/sqr(m0)));
0351   }
0352 
0353   /**
0354    * The \f$A_4\f$ function for the initial-final dipole with \f$t=0\f$.
0355    * @param beta0 Velocity of the incoming charged particle, \f$\beta_0\f$
0356    * @param beta1 Velocity of the outgoing charged particle, \f$\beta_1\f$.
0357    * @param ombeta1 \f$1-\beta_1\f$ for the outgoing charged particle.
0358    * @param en0 The energy of the incoming particle
0359    * @param en1 The energy of the outgoing particle
0360    * @param m0 The mass of the incoming particle
0361    * @param m1 The mass of the outgoing particle
0362    */
0363   static InvEnergy2 A4IFZero(double  beta0, double beta1, 
0364                  double ombeta1, Energy  en0,
0365                  Energy en1  , Energy  m0   , Energy m1);
0366   
0367   /**
0368    * The \f$A_4\f$ function for the initial-final dipole in the rest frame of 
0369    * the decaying particle
0370    * @param m0 The mass of the incoming particle
0371    * @param m1 The mass of the outgoing particle
0372    * @param beta1 The velocity of the decay product
0373    * @param ombeta1 \f$1-\beta\f$ for the decay product
0374    * @param E1 The energy of the outgoing particle
0375    */
0376   static InvEnergy2 A4IFRest(Energy m0   ,Energy m1, double beta1,
0377                  double ombeta1, Energy E1);
0378   
0379   /**
0380    * The \f$A_4\f$ function for the full initial-final dipole
0381    * @param beta0 Velocity of the incoming charged particle, \f$\beta_0\f$
0382    * @param beta1 Velocity of the outgoing charged particle, \f$\beta_1\f$.
0383    * @param en0 The energy of the incoming particle
0384    * @param en1 The energy of the outgoing particle
0385    * @param m0 The mass of the incoming particle
0386    * @param m1 The mass of the outgoing particle
0387    * @param t  The invariant mass of the charged particles
0388    */
0389   static InvEnergy2 A4IFFull(Velocity beta0,Velocity beta1,
0390                  Energy  en0  ,Energy en1  ,
0391                  Energy  m0   ,Energy m1   , Energy2 t);
0392   //@}
0393 
0394   /**
0395    *  Functions from hep-ph/9606429 for the calculation of the \f$A_4\f$ functions
0396    */
0397   //@{
0398   /**
0399    * The function \f$Z_{ij}(\eta)\f$ from hep-ph/9606429 for the evaluation of the \f$A_4\f$ 
0400    * function.
0401    * @param eta The value of \f$\eta\f$
0402    * @param yi The value of \f$y_i\f$ 
0403    * @param yj The value of \f$y_j\f$ 
0404    */
0405   template <typename T> 
0406   static double Zij(T eta, T yi, T yj) {
0407     return 2.*Math::ReLi2((yj-yi)/(eta-yi))+0.5*sqr(log(abs((eta-yi)/(eta-yj))));
0408   }
0409   
0410   /**
0411    * The function \f$X^{ij}_{kl}(\eta)\f$  from hep-ph/9606429 for the evaluation of the \f$A_4\f$ 
0412    * function.
0413    * @param eta The value of \f$\eta\f$
0414    * @param yi The value of \f$y_i\f$ 
0415    * @param yj The value of \f$y_j\f$ 
0416    * @param yk The value of \f$y_k\f$ 
0417    * @param yl The value of \f$y_l\f$ 
0418    */
0419   template <typename T> 
0420   static double Xijkl(T eta,T yi, T yj, T yk, T yl) {
0421     return log(abs((eta-yi)*(eta-yj)/(eta-yk)/(eta-yl)));
0422   }
0423   //@}
0424 
0425 };
0426 
0427 }
0428 
0429 #endif /* HERWIG_YFSFormFactors_H */