Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // BtoSGammaKagan.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_BtoSGammaKagan_H
0010 #define HERWIG_BtoSGammaKagan_H
0011 //
0012 // This is the declaration of the BtoSGammaKagan class.
0013 //
0014 
0015 #include "Herwig/Utilities/Interpolator.h"
0016 #include "BtoSGammaHadronicMass.h"
0017 #include "ThePEG/Config/Complex.h"
0018 #include "ThePEG/Config/Constants.h"
0019 
0020 namespace Herwig {
0021 
0022 using namespace ThePEG;
0023 using namespace ThePEG::Constants;
0024 
0025 /** \ingroup Decay
0026  *
0027  * The BtoSGammaKagan class implements the model of hep-ph/9805303 for the 
0028  * hadronic mass spectrum in \f$b\to s \gamma\f$ decays.
0029  */
0030 class BtoSGammaKagan: public BtoSGammaHadronicMass {
0031 
0032   /**
0033    * Class for the integration is a friend to access private members
0034    */
0035   friend struct KaganIntegrand;
0036 
0037 public:
0038 
0039   /**
0040    * The default constructor.
0041    */
0042   BtoSGammaKagan();
0043 
0044   /**
0045    * Returns the hadronic mass.
0046    * @param mb The mass of the decaying B meson
0047    * @param mquark The minimum mass of the hadronic system based on the consistuent quark
0048    * masses.
0049    * @return The hadronic mass
0050    */
0051   virtual Energy hadronicMass(Energy mb,Energy mquark);
0052 
0053   /**
0054    * Output the setup information for the particle database
0055    * @param os The stream to output the information to
0056    * @param header Whether or not to output the information for MySQL
0057    * @param create Whether or not to add a statement creating the object
0058    */
0059   virtual void dataBaseOutput(ofstream & os,bool header,bool create) const;
0060 
0061 public:
0062 
0063   /** @name Functions used by the persistent I/O system. */
0064   //@{
0065   /**
0066    * Function used to write out object persistently.
0067    * @param os the persistent output stream written to.
0068    */
0069   void persistentOutput(PersistentOStream & os) const;
0070 
0071   /**
0072    * Function used to read in object persistently.
0073    * @param is the persistent input stream read from.
0074    * @param version the version number of the object when written.
0075    */
0076   void persistentInput(PersistentIStream & is, int version);
0077   //@}
0078 
0079   /**
0080    * The standard Init function used to initialize the interfaces.
0081    * Called exactly once for each class by the class description system
0082    * before the main function starts or
0083    * when this class is dynamically loaded.
0084    */
0085   static void Init();
0086 
0087 public:
0088 
0089   /**
0090    *  Members which return integrands
0091    */
0092   //@{
0093   /**
0094    *  Operator to return the integrand for the \f$s_{22}(y)\f$ function
0095    *  or \f$s_{27}(y)\f$ functions of hep-ph/9805303
0096    *  depending on the value of _iopt to be integrated
0097    */
0098   double operator ()(double x) const {
0099     if(_iopt==0) {
0100       double reg(realG(x/_zratio)),img(imagG(x/_zratio));
0101       return 16./27.*(1.-x)*(_zratio*_zratio/x/x*(sqr(reg)+sqr(img))+_zratio/x*reg+0.25);
0102     }
0103     else {
0104       return -8./9.*_zratio*(realG(x/_zratio)+0.5*x/_zratio);
0105     }
0106   }
0107   typedef double ValType;
0108   typedef double ArgType;
0109 
0110   /**
0111    *  Operator to return the integrand of the smeared function or
0112    *  Fermi function depending on the value of _iopt to be integrated
0113    */
0114   InvEnergy smeared(Energy kp) const {
0115     InvEnergy fermi = exponentialFermiFunction(kp,_fermilambda,_fermia,
0116                            _ferminorm,_fermilambda1);
0117     if(_iopt==1) fermi *=KNLO(_MB*_y/(_mb+kp))*_MB/(_mb+kp);
0118     return fermi;
0119   }
0120   //@}
0121 
0122 protected:
0123 
0124   /** @name Clone Methods. */
0125   //@{
0126   /**
0127    * Make a simple clone of this object.
0128    * @return a pointer to the new object.
0129    */
0130   virtual IBPtr clone() const {return new_ptr(*this);}
0131 
0132   /** Make a clone of this object, possibly modifying the cloned object
0133    * to make it sane.
0134    * @return a pointer to the new object.
0135    */
0136   virtual IBPtr fullclone() const {return new_ptr(*this);}
0137   //@}
0138 
0139 protected:
0140 
0141   /** @name Standard Interfaced functions. */
0142   //@{
0143   /**
0144    * Initialize this object after the setup phase before saving an
0145    * EventGenerator to disk.
0146    * @throws InitException if object could not be initialized properly.
0147    */
0148   virtual void doinit();
0149 
0150   /**
0151    * Initialize this object. Called in the run phase just before
0152    * a run begins.
0153    */
0154   virtual void doinitrun();
0155   //@}
0156 
0157 private:
0158 
0159   /**
0160    * The assignment operator is private and must never be called.
0161    * In fact, it should not even be implemented.
0162    */
0163   BtoSGammaKagan & operator=(const BtoSGammaKagan &) = delete;
0164 
0165 private:
0166 
0167   /** @name Functions to calculate the mass spectrum */
0168   //@{
0169   /**
0170    * The derivative of the Sudakov form-factor from hep-ph/9805303
0171    * @param y Ratio \f$E_\gamma/E^{\rm max}_\gamma\f$.
0172    * @param alphaS The strong coupling, \f$\alpha_S\f$.
0173    */
0174   double Delta(double y, double alphaS) const {
0175     if(y>_ycut) return 0.;
0176     double ln(log(1.-y));
0177     return -4./3./pi/(1.-y)*alphaS*(ln+1.75)*exp(-2.*alphaS/3./pi*ln*(ln+3.5));
0178   }
0179 
0180   /**
0181    * Kinematic function from semi-leptonic decay for normaalisation
0182    */
0183   double semiLeptonicf() const  {
0184     double z2=sqr(_zratio);
0185     return 1.-8.*_zratio*(1.-z2)-sqr(z2)-12.*z2*log(_zratio);
0186   }
0187 
0188   /**
0189    *  \f$s_{22}(y)\f$ function from hep-ph/9805303. Due to the integration
0190    * required this function is computed by interpolation.
0191    * @param y Ratio \f$E_\gamma/E^{\rm max}_\gamma\f$.
0192    */
0193   double s22(double y) const {return (*_s22inter)(y);}
0194 
0195   /**
0196    *  \f$s_{27}(y)\f$ function from hep-ph/9805303. Due to the integration
0197    * required this function is computed by interpolation.
0198    * @param y Ratio \f$E_\gamma/E^{\rm max}_\gamma\f$.
0199    */
0200   double s27(double y) const {return (*_s27inter)(y);}
0201 
0202   /**
0203    *  \f$s_{77}(y)\f$ function from hep-ph/9805303
0204    * @param y Ratio \f$E_\gamma/E^{\rm max}_\gamma\f$.
0205    */
0206   double s77(double y) const  {
0207     if(y>_ycut) y=_ycut; 
0208     return 1./3.*(7.+y*(1.-2.*y)-2.*(1.+y)*log(1.-y));
0209   }
0210 
0211   /**
0212    *  \f$s_{78}(y)\f$ function from hep-ph/9805303
0213    * @param y Ratio \f$E_\gamma/E^{\rm max}_\gamma\f$.
0214    */
0215   double s78(double y) const  {
0216     if(y>_ycut) y=_ycut;
0217     return 8./9.*((1.-y)/y*log(1.-y)+1.+0.25*y*y);
0218   }
0219 
0220   /**
0221    *  \f$s_{88}(y)\f$ function from hep-ph/9805303
0222    * @param y Ratio \f$E_\gamma/E^{\rm max}_\gamma\f$.
0223    */
0224   double s88(double y) const  {
0225     double ratio(_mb/_ms),y2(sqr(y));
0226     if(y>_ycut) y=_ycut;
0227     return 1./27.*(2.*(2.-2.*y+y2)/y*(log(1.-y)+2.*log(ratio))-2.*y2-y-8.*(1.-y)/y);
0228   }
0229 
0230   /**
0231    *  The real part of the \f$G(t)\f$ function from hep-ph/9805303
0232    */
0233   double realG(double t) const  {
0234     if(t<4.) {
0235       double at(atan(sqrt(t/(4.-t))));
0236       return -2.*sqr(at);
0237     }
0238     else {
0239       double ln(log(0.5*(sqrt(t)+sqrt(t-4.))));
0240       return 2.*(sqr(ln)-0.25*sqr(pi));
0241     }
0242   }
0243 
0244   /**
0245    *  The imaginary part of the \f$G(t)\f$ function from hep-ph/9805303
0246    */
0247   double imagG(double t) const {
0248     if(t<4.) return 0.;
0249     else     return -2.*pi*log(0.5*(sqrt(t)+sqrt(t-4.)));
0250   }
0251 
0252   /**
0253    *  Strong coupling \f$\alpha_S\f$ at the scale \f$Q\f$
0254    * @param Q The scale.
0255    */
0256   double alphaS(Energy Q)  {
0257     double lo(1.-0.5*_beta0*_alphaSZ/pi*log(_mz/Q));
0258     return _alphaSZ/lo*(1.-0.25*_beta1/_beta0*_alphaSZ/pi*log(lo)/lo);
0259   }
0260 
0261   /**
0262    *   Calculate the wilson coefficients we need
0263    */
0264   void calculateWilsonCoefficients();
0265 
0266   /**
0267    * The \f$K'_{NLO}(1-y)\f$ function at parton level from hep-ph/9805303
0268    */
0269   double KNLO(double y) const {
0270     return _delta*Delta(y,_alphaSM)
0271       +_alphaSM/pi*(s22(y)*sqr(_c20)+s77(y)*sqr(_c70)
0272             +s88(y)*sqr(_c80)+s78(y)*_c70*_c80
0273             +s27(y)*_c20*(_c70-_c80/3.));
0274   }
0275   //@}
0276 
0277 private:
0278 
0279 
0280   /**
0281    *  Initialisation of mass spectrum
0282    */
0283   bool _initialize;
0284 
0285   /**
0286    *  Quark masses and related parameters
0287    */
0288   //@{
0289   /**
0290    *  The top quark mass
0291    */
0292   Energy _mt;
0293 
0294   /**
0295    * bottom quark mass
0296    */
0297   Energy _mb;
0298 
0299   /**
0300    * charm quark mass
0301    */
0302   Energy _mc;
0303 
0304   /**
0305    * strange quark mass
0306    */
0307   Energy _ms;
0308 
0309   /**
0310    *  Ratio of the strange quark mass to the bottom quark mass
0311    */
0312   double _msovermb;
0313 
0314   /**
0315    * The ratio of the charm to bottom quark masses squared, \f$(m_c/m_b)^2\f$
0316    */
0317   double _zratio;
0318   //@}
0319 
0320   /**
0321    * The hadronic \f$\lambda_2\f$ parameter from hep-ph/9805303.
0322    */
0323   Energy2 _lambda2;
0324 
0325   /**
0326    *  Masses of other particles
0327    */
0328   //@{
0329   /**
0330    *  The W mass
0331    */
0332   Energy _mw;
0333 
0334   /**
0335    *  the Z mass
0336    */
0337   Energy _mz;
0338 
0339   /**
0340    *  Mass of the decaying B meson.
0341    */
0342   Energy _MB;
0343   //@}
0344 
0345   /** @name Wilson coefficients, couplings and \f$\beta\f$-function coefficients*/
0346   //@{
0347   /**
0348    * The leading order \f$c_2\f$ coefficient.
0349    */
0350   double _c20;
0351 
0352   /**
0353    * The leading order \f$c_7\f$ coefficient.
0354    */
0355   double _c70;
0356 
0357   /**
0358    * The leading order \f$c_8\f$ coefficient.
0359    */
0360   double _c80;
0361 
0362   /**
0363    *  First \f$\beta\f$-function coefficient
0364    */
0365   double _beta0;
0366 
0367   /**
0368    *  Second \f$\beta\f$-function coefficient
0369    */
0370   double _beta1;
0371 
0372   /**
0373    *  The electromagentic coupling
0374    */
0375   double _alpha;
0376 
0377   /**
0378    *  The strong coupling at the Z mass
0379    */
0380   double _alphaSZ;
0381 
0382   /**
0383    *  The renormalisation scale
0384    */
0385   Energy _mub;
0386 
0387   /**
0388    *  the strong coupling at the renormalisation scale \f$\mu_b\f$.
0389    */
0390   double _alphaSM;
0391 
0392   /**
0393    *   The CKM perfactor for the decay
0394    */
0395   double _ckm;
0396   /**
0397    *  Pre-factor for the correction term involving \f$\Delta(y)\f$.
0398    */
0399   double _delta;
0400   //@}
0401 
0402   /**
0403    *  Interpolators for the integrate functions and related parameters
0404    */
0405   //@{
0406   /**
0407    *  Interpolator for the \f$s_{22}\f$ function
0408    */
0409   Interpolator<double,double>::Ptr _s22inter;
0410 
0411   /**
0412    *  Interpolator for the \f$s_{27}\f$ function
0413    */
0414   Interpolator<double,double>::Ptr _s27inter;
0415 
0416   /**
0417    *  Interpolator for the spectrum
0418    */
0419   Interpolator<InvEnergy,Energy>::Ptr _pmHinter;
0420 
0421   /**
0422    *  Values of \f$m_H\f$ for the interpolation of the spectrum
0423    */
0424   vector<Energy> _mHinter;
0425 
0426   /**
0427    *  Values of the differential rate for the interpolation of the spectrum
0428    */
0429   vector<InvEnergy> _spectrum;
0430 
0431   /**
0432    *  Maximum value of the spectrum for unweighting
0433    */
0434   InvEnergy _spectmax;
0435 
0436   /**
0437    *  Maximum number of tries for unweighting
0438    */
0439   unsigned int _maxtry;
0440   //@}
0441 
0442   /**
0443    *  Parameters for the Fermi function
0444    */
0445   //@{
0446   /**
0447    *  The \f$\bar{\Lambda}\f$ parameter from hep-ph/9805303.
0448    */
0449   Energy _fermilambda;
0450 
0451   /**
0452    *  The power from  from hep-ph/9805303.
0453    */
0454   double _fermia;
0455 
0456   /**
0457    * The normalisation from hep-ph/9805303.
0458    */
0459   InvEnergy _ferminorm;
0460 
0461   /**
0462    * \f$\lambda_1\f$ scale related to the kinetic energy of the b quark.
0463    */
0464   Energy2 _fermilambda1;
0465   //@}
0466 
0467   /**
0468    *   Techincal parameters for the integration of the spectrum
0469    */
0470   //@{
0471   /**
0472    * Cut-off parameter to avoid the singularity at y=1
0473    */
0474   double _ycut;
0475 
0476   /**
0477    * Value of the energy fraction for which the integral is being performed
0478    */
0479   double _y;
0480 
0481   /**
0482    *  Cut-off on the photon energies
0483    */
0484   double _deltacut;
0485 
0486   /**
0487    * Number of points for the interpolation of the s functions
0488    */
0489   unsigned int _nsfunct;
0490 
0491   /**
0492    * Number of points for the interpolation of the spectrum
0493    */
0494   unsigned int _nspect;
0495 
0496   /**
0497    *  The function currently being integrated
0498    */
0499   unsigned int _iopt;
0500   //@}
0501 
0502 };
0503 
0504 /**
0505  *  A struct for the integrand which can access the dimensional value
0506  *  member of the BtoSGammaKagan class
0507  */
0508 struct KaganIntegrand {
0509 
0510   /**
0511    *  The constructor
0512    */
0513   KaganIntegrand(Ptr<BtoSGammaKagan>::pointer in) : _kagan(in) {};
0514 
0515   /**
0516    * Get the function value
0517    */
0518   InvEnergy operator ()(Energy arg) const {return _kagan->smeared(arg);}
0519   /** Return type for GaussianIntegrator */
0520   typedef InvEnergy ValType;
0521   /** Argument type for GaussianIntegrator */
0522   typedef Energy    ArgType;
0523 
0524   /**
0525    *  A pointer to the form factor to supply the integrand.
0526    */
0527   Ptr<BtoSGammaKagan>::pointer _kagan;
0528 };
0529 }
0530 
0531 #endif /* HERWIG_BtoSGammaKagan_H */