Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // SudakovFormFactor.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_SudakovFormFactor_H
0010 #define HERWIG_SudakovFormFactor_H
0011 //
0012 // This is the declaration of the SudakovFormFactor class.
0013 //
0014 
0015 #include "ThePEG/Interface/Interfaced.h"
0016 #include "Herwig/Shower/QTilde/SplittingFunctions/SplittingFunction.h"
0017 #include "Herwig/Shower/ShowerAlpha.h"
0018 #include "Herwig/Shower/QTilde/SplittingFunctions/SplittingGenerator.fh"
0019 #include "ThePEG/Repository/UseRandom.h"
0020 #include "ThePEG/PDF/BeamParticleData.h"
0021 #include "ThePEG/EventRecord/RhoDMatrix.h"
0022 #include "ThePEG/EventRecord/SpinInfo.h"
0023 #include "Herwig/Shower/QTilde/Kinematics/ShowerKinematics.fh"
0024 #include "SudakovFormFactor.fh"
0025 #include "SudakovCutOff.h"
0026 
0027 namespace Herwig {
0028 
0029 using namespace ThePEG;
0030 
0031 /**
0032  *  A typedef for the BeamParticleData
0033  */
0034 typedef Ptr<BeamParticleData>::transient_const_pointer tcBeamPtr;
0035 
0036 /**  \ingroup Shower
0037  *
0038  *  This is the definition of the Sudakov form factor class. In general this
0039  *  is the base class for the implementation of Sudakov form factors in Herwig.
0040  *  The methods generateNextTimeBranching(), generateNextDecayBranching() and
0041  *  generateNextSpaceBranching need to be implemented in classes inheriting from this
0042  *  one.
0043  *
0044  *  In addition a number of methods are implemented to assist with the calculation
0045  *  of the form factor using the veto algorithm in classes inheriting from this one.
0046  *  
0047  *  In general the Sudakov form-factor, for final-state radiation, is given
0048  *  by
0049  *  \f[\Delta_{ba}(\tilde{q}_{i+1},\tilde{q}_i)=
0050  *  \exp\left\{
0051  *     -\int^{\tilde{q}^2_i}_{\tilde{q}^2_{i+1}}
0052  *     \frac{{\rm d}\tilde{q}^2}{\tilde{q}^2} 
0053  *      \int\frac{\alpha_S(z,\tilde{q})}{2\pi}
0054  *      P_{ba}(z,\tilde{q})\Theta(p_T)
0055  *      \right\}.
0056  *  \f]
0057  *  We can solve this to obtain the next value of the scale \f$\tilde{q}_{i+1}\f$
0058  *  given the previous value \f$\tilde{q}_i\f$
0059  *  in the following way. First we obtain a simplified form of the integrand
0060  *  which is greater than or equal to the true integrand for all values of
0061  *  \f$\tilde{q}\f$.
0062  *
0063  *  In practice it is easiest to obtain this over estimate in pieces. The ShowerAlpha
0064  *  object contains an over estimate for \f$\alpha_S\f$, the splitting function
0065  *  contains both an over estimate of the spltting function and its integral
0066  *  which is needed to compute the over estimate of the \f$\tilde{q}\f$ integrand,
0067  *  together with an over estimate of the limit of the \f$z\f$ integral.
0068  *
0069  *  This gives an overestimate of the integrand
0070  *  \f[g(\tilde{q}^2) = \frac{c}{\tilde{q}^2}, \f]
0071  *  where because the over estimates are chosen to be independent of \f$\tilde{q}\f$ the 
0072  *  parameter 
0073  *  \f[c = \frac{\alpha_{\rm over}}{2\pi}\int^{z_1}_{z_0}P_{\rm over}(z),\f]
0074  * is a constant independent of \f$\tilde{q}\f$.
0075  *
0076  *  The guesstz() member can then be used to generate generate the value of 
0077  *  \f$\tilde{q}^2\f$ according to this result. This is done by solving the Sudakov
0078  *  form factor, with the over estimates, is equal to a random number 
0079  *  \f$r\f$ in the interval \f$[0,1]\f$. This gives
0080  *  \f[\tilde{q}^2_{i+1}=G^{-1}\left[G(\tilde{q}^2_i)+\ln r\right],\f]
0081  *  where \f$G(\tilde{q}^2)=c\ln(\tilde{q}^2)\f$ is the infinite integral 
0082  *  of \f$g(\tilde{q}^2)\f$ and \f$G^{-1}(x)=\exp\left(\frac{x}c\right)\f$
0083  *  is its inverse.
0084  *  It this case we therefore obtain
0085  *  \f[\tilde{q}^2_{i+1}=\tilde{q}^2_ir^{\frac1c}.\f]
0086  *  The value of \f$z\f$ can then be calculated in a similar way
0087  *  \f[z = I^{-1}\left[I(z_0)+r\left(I(z_1)-I(z_0)\right)\right],\f]
0088  *  using the guesstz() member,
0089  *  where \f$I=\int P(z){\rm d}z\f$ and \f$I^{-1}\f$ is its inverse.
0090  *  
0091  *  The veto algorithm then uses rejection using the ratio of the 
0092  *  true value to the overestimated one to obtain the original distribution.
0093  *  This is accomplished using the 
0094  *  - alphaSVeto()      member for the \f$\alpha_S\f$ veto
0095  *  - SplittingFnVeto() member for the veto on the value of the splitting function.
0096  *  in general there must also be a chech that the emission is in the allowed
0097  *  phase space but this is left to the inheriting classes as it will depend
0098  *  on the ordering variable.
0099  *
0100  *  The Sudakov form factor for the initial-scale shower is different because
0101  *  it must include the PDF which guides the backward evolution.
0102  *  It is given by
0103  *  \f[\Delta_{ba}(\tilde{q}_{i+1},\tilde{q}_i)=
0104  *  \exp\left\{
0105  *     -\int^{\tilde{q}^2_i}_{\tilde{q}^2_{i+1}}
0106  *     \frac{{\rm d}\tilde{q}^2}{\tilde{q}^2} 
0107  *      \int\frac{\alpha_S(z,\tilde{q})}{2\pi}
0108  *      P_{ba}(z,\tilde{q})\frac{x'f_a(\frac{x}z,\tilde{q}^2)}{xf_b(x,\tilde{q^2})}
0109  *      \right\},
0110  *  \f]
0111  *  where \f$x\f$ is the fraction of the beam momentum the parton \f$b\f$ had before
0112  *  the backward evolution.
0113  *  This can be solve in the same way as for the final-state branching but the constant
0114  *  becomes
0115  *  \f[c = \frac{\alpha_{\rm over}}{2\pi}\int^{z_1}_{z_0}P_{\rm over}(z)PDF_{\rm max},\f]
0116  *  where 
0117  * \f[PDF_{\rm max}=\max\frac{x'f_a(\frac{x}z,\tilde{q}^2)}{xf_b(x,\tilde{q^2})},\f]
0118  *  which can be set using an interface.
0119  *  In addition the PDFVeto() member then is needed to implement the relevant veto.
0120  *
0121  *  @see SplittingGenerator
0122  *  @see SplittingFunction
0123  *  @see ShowerAlpha
0124  *  @see \ref SudakovFormFactorInterfaces "The interfaces"
0125  *  defined for SudakovFormFactor.
0126  */
0127 class SudakovFormFactor: public Interfaced {
0128 
0129   /**
0130    *  The SplittingGenerator is a friend to insert the particles in the 
0131    *  branchings at initialisation
0132    */
0133   friend class SplittingGenerator;
0134 
0135 public:
0136 
0137   /**
0138    * The default constructor.
0139    */
0140   SudakovFormFactor() : pdfmax_(35.0), pdffactor_(0),
0141             z_( 0.0 ),phi_(0.0), pT_(){}
0142 
0143   /**
0144    *  Members to generate the scale of the next branching
0145    */
0146   //@{
0147   /**
0148    * Return the scale of the next time-like branching. If there is no 
0149    * branching then it returns ZERO.
0150    * @param startingScale starting scale for the evolution
0151    * @param ids The PDG codes of the particles in the splitting
0152    * @param enhance The radiation enhancement factor
0153    * defined.
0154    */
0155   virtual ShoKinPtr generateNextTimeBranching(const Energy startingScale,
0156                           const IdList &ids,
0157                           const RhoDMatrix & rho,
0158                           double enhance, double detuning);
0159 
0160   /**
0161    * Return the scale of the next space-like decay branching. If there is no 
0162    * branching then it returns ZERO.
0163    * @param startingScale starting scale for the evolution
0164    * @param stoppingScale stopping scale for the evolution
0165    * @param minmass The minimum mass allowed for the spake-like particle.
0166    * @param ids The PDG codes of the particles in the splitting
0167    * defined.
0168    * @param enhance The radiation enhancement factor
0169    */
0170   virtual ShoKinPtr generateNextDecayBranching(const Energy startingScale,
0171                            const Energy stoppingScale,
0172                            const Energy minmass,
0173                            const IdList &ids,
0174                            const RhoDMatrix & rho,
0175                            double enhance,
0176                            double detuning);
0177 
0178   /**
0179    * Return the scale of the next space-like branching. If there is no 
0180    * branching then it returns ZERO.
0181    * @param startingScale starting scale for the evolution
0182    * @param ids The PDG codes of the particles in the splitting
0183    * @param x The fraction of the beam momentum
0184    * defined.
0185    * @param beam The beam particle
0186    * @param enhance The radiation enhancement factor
0187    */
0188   virtual ShoKinPtr generateNextSpaceBranching(const Energy startingScale,
0189                            const IdList &ids,double x,
0190                            const RhoDMatrix & rho,
0191                            double enhance,
0192                            tcBeamPtr beam,
0193                            double detuning);
0194   //@}
0195 
0196   /**
0197    * Generate the azimuthal angle of the branching for forward evolution
0198    * @param particle The branching particle
0199    * @param ids The PDG codes of the particles in the branchings
0200    * @param The Shower kinematics
0201    */
0202   virtual double generatePhiForward(ShowerParticle & particle,const IdList & ids,
0203                     ShoKinPtr kinematics,
0204                     const RhoDMatrix & rho);
0205 
0206   /**
0207    *  Generate the azimuthal angle of the branching for backward evolution
0208    * @param particle The branching particle
0209    * @param ids The PDG codes of the particles in the branchings
0210    * @param The Shower kinematics
0211    */
0212   virtual double generatePhiBackward(ShowerParticle & particle,const IdList & ids,
0213                      ShoKinPtr kinematics,
0214                      const RhoDMatrix & rho);
0215 
0216   /**
0217    *  Generate the azimuthal angle of the branching for ISR in decays
0218    * @param particle The branching particle
0219    * @param ids The PDG codes of the particles in the branchings
0220    * @param The Shower kinematics
0221    */
0222   virtual double generatePhiDecay(ShowerParticle & particle,const IdList & ids,
0223                   ShoKinPtr kinematics,
0224                   const RhoDMatrix & rho);
0225 
0226   /**
0227    *  Methods to provide public access to the private member variables
0228    */
0229   //@{
0230   /** 
0231    * Return the pointer to the SplittingFunction object.
0232    */
0233   tSplittingFnPtr splittingFn() const { return splittingFn_; }
0234 
0235   /**
0236    * Return the pointer to the ShowerAlpha object.
0237    */
0238   tShowerAlphaPtr alpha() const { return alpha_; }
0239 
0240   /**
0241    *  The type of interaction
0242    */
0243   inline ShowerInteraction interactionType() const 
0244   {return splittingFn_->interactionType();}
0245   //@}
0246 
0247 public:
0248 
0249   /**
0250    *  Methods to access the kinematic variables for the branching
0251    */
0252   //@{
0253   /**
0254    *  The energy fraction
0255    */
0256   double z() const { return z_; }
0257 
0258   /**
0259    *  The azimuthal angle
0260    */
0261   double phi() const { return phi_; }
0262 
0263   /**
0264    *  The transverse momentum
0265    */
0266   Energy pT() const { return pT_; }
0267   //@}
0268 
0269   /**
0270    *  Access the maximum weight for the PDF veto
0271    */
0272   double pdfMax() const { return pdfmax_;}
0273 
0274   /**
0275    *  Method to return the evolution scale given the
0276    *  transverse momentum, \f$p_T\f$ and \f$z\f$.
0277    */
0278   virtual Energy calculateScale(double z, Energy pt, IdList ids,unsigned int iopt);
0279 
0280 public:
0281 
0282   /** @name Functions used by the persistent I/O system. */
0283   //@{
0284   /**
0285    * Function used to write out object persistently.
0286    * @param os the persistent output stream written to.
0287    */
0288   void persistentOutput(PersistentOStream & os) const;
0289 
0290   /**
0291    * Function used to read in object persistently.
0292    * @param is the persistent input stream read from.
0293    * @param version the version number of the object when written.
0294    */
0295   void persistentInput(PersistentIStream & is, int version);
0296   //@}
0297 
0298   /**
0299    * The standard Init function used to initialize the interfaces.
0300    * Called exactly once for each class by the class description system
0301    * before the main function starts or
0302    * when this class is dynamically loaded.
0303    */
0304   static void Init();
0305 
0306 protected:
0307   /**
0308    *  Methods to provide the next value of the scale before the vetos
0309    *  are applied.
0310    */
0311   //@{
0312   /**
0313    *  Value of the energy fraction and scale for time-like branching
0314    * @param t  The scale
0315    * @param tmin The minimum scale
0316    * @param enhance The radiation enhancement factor
0317    * @return False if scale less than minimum, true otherwise
0318    */
0319   bool guessTimeLike(Energy2 &t, Energy2 tmin, double enhance, double detune);
0320 
0321   /**
0322    * Value of the energy fraction and scale for time-like branching
0323    * @param t  The scale
0324    * @param tmax The maximum scale
0325    * @param minmass The minimum mass of the particle after the branching
0326    * @param enhance The radiation enhancement factor
0327    */
0328   bool guessDecay(Energy2 &t, Energy2 tmax,Energy minmass,
0329           double enhance, double detune);
0330 
0331   /**
0332    * Value of the energy fraction and scale for space-like branching
0333    * @param t  The scale
0334    * @param tmin The minimum scale
0335    * @param x Fraction of the beam momentum.
0336    * @param enhance The radiation enhancement factor
0337    */
0338   bool guessSpaceLike(Energy2 &t, Energy2 tmin, const double x,
0339               double enhance, double detune);
0340   //@}
0341 
0342   /**
0343    *  Initialize the values of the cut-offs and scales
0344    * @param tmin The minimum scale
0345    * @param ids  The ids of the partics in the branching
0346    */
0347   void initialize(const IdList & ids,Energy2 &tmin);
0348 
0349   /**
0350    *  Phase Space veto member to implement the \f$\Theta\f$ function as a veto
0351    *  so that the emission is within the allowed phase space.
0352    * @param t  The scale
0353    * @param maxQ2 The maximum virtuality
0354    * @return true if vetoed
0355    */
0356   bool PSVeto(const Energy2 t);
0357 
0358   /**
0359    * Compute the limits on \f$z\f$ for time-like branching
0360    * @param scale The scale of the particle
0361    * @return True if lower limit less than upper, otherwise false
0362    */
0363   bool computeTimeLikeLimits(Energy2 & scale);
0364 
0365   /**
0366    * Compute the limits on \f$z\f$ for space-like branching
0367    * @param scale The scale of the particle
0368    * @param x The energy fraction of the parton
0369    * @return True if lower limit less than upper, otherwise false
0370    */
0371   bool computeSpaceLikeLimits(Energy2 & scale, double x);
0372 
0373 protected:
0374 
0375   /**
0376    *  Methods to implement the veto algorithm to generate the scale of 
0377    *  the next branching
0378    */
0379   //@{
0380   /**
0381    * Value of the energy fraction and value of the scale for the veto algorithm
0382    * @param iopt The option for calculating z
0383    * @param ids The PDG codes of the particles in the splitting
0384    * - 0 is final-state
0385    * - 1 is initial-state for the hard process
0386    * - 2 is initial-state for particle decays
0387    * @param t1 The starting valoe of the scale
0388    * @param enhance The radiation enhancement factor
0389    * @param identical Whether or not the outgoing particles are identical
0390    * @param t_main rerurns the value of the energy fraction for the veto algorithm
0391    * @param z_main returns the value of the scale for the veto algorithm
0392    */
0393   void guesstz(Energy2 t1,unsigned int iopt, const IdList &ids,
0394           double enhance,bool ident,
0395           double detune, Energy2 &t_main, double &z_main);
0396 
0397   /**
0398    * Veto on the PDF for the initial-state shower
0399    * @param t The scale
0400    * @param x The fraction of the beam momentum
0401    * @param parton0 Pointer to the particleData for the 
0402    *                new parent (this is the particle we evolved back to)
0403    * @param parton1 Pointer to the particleData for the 
0404    *                original particle
0405    * @param beam The BeamParticleData object
0406    */
0407   bool PDFVeto(const Energy2 t, const double x,
0408            const tcPDPtr parton0, const tcPDPtr parton1,
0409            tcBeamPtr beam) const;
0410   /**
0411    * The PDF veto ratio
0412    */
0413   double PDFVetoRatio(const Energy2 t, const double x,
0414                const tcPDPtr parton0, const tcPDPtr parton1,
0415                tcBeamPtr beam,double factor) const;
0416 
0417   /**
0418    *  The veto on the splitting function.
0419    * @param t The scale
0420    * @param ids The PDG codes of the particles in the splitting
0421    * @param mass Whether or not to use the massive splitting functions 
0422    * @return true if vetoed
0423    */
0424   bool SplittingFnVeto(const Energy2 t, 
0425                const IdList &ids, 
0426                const bool mass,
0427                const RhoDMatrix & rho,
0428                const double & detune) const {
0429     return UseRandom::rnd()>SplittingFnVetoRatio(t,ids,mass,rho,detune);
0430   }
0431   
0432   /**
0433    * The Splitting function veto ratio
0434    */
0435   
0436   double SplittingFnVetoRatio(const Energy2 t,
0437                   const IdList &ids,
0438                   const bool mass,
0439                   const RhoDMatrix & rho,
0440                   const double & detune) const {
0441     return splittingFn_->ratioP(z_, t, ids,mass,rho)/detune;
0442   }
0443 
0444   /**
0445    *  The veto on the coupling constant
0446    * @param pt2 The value of ther transverse momentum squared, \f$p_T^2\f$.
0447    * @return true if vetoed
0448    */
0449   bool alphaSVeto(Energy2 pt2) const;
0450 
0451   /**
0452    * The alpha S veto ratio
0453    */
0454    
0455   double alphaSVetoRatio(Energy2 pt2,double factor) const;
0456 
0457 
0458   //@}
0459 
0460   /**
0461    *  Set the particles in the splittings
0462    */
0463   void addSplitting(const IdList &);
0464 
0465   /**
0466    *  Delete the particles in the splittings
0467    */
0468   void removeSplitting(const IdList &);
0469 
0470   /**
0471    *  Access the potential branchings
0472    */
0473   const vector<IdList> & particles() const { return particles_; }
0474 
0475 public:
0476 
0477   /**
0478    *   Set the PDF
0479    */
0480   void setPDF(tcPDFPtr pdf, Energy scale) {
0481     pdf_ = pdf;
0482     freeze_ = scale;
0483   }
0484 
0485 public:
0486 
0487   /**
0488    *  Calculate the virtual masses for a branchings
0489    */
0490   const vector<Energy> & virtualMasses(const IdList & ids) {
0491     return cutoff_->virtualMasses(ids);
0492   }
0493 
0494   /**
0495    *  The minimum pT2
0496    */
0497   Energy2 pT2min() { return cutoff_->pT2min(); }
0498 
0499 protected:
0500 
0501   /** @name Clone Methods. */
0502   //@{
0503   /**
0504    * Make a simple clone of this object.
0505    * @return a pointer to the new object.
0506    */
0507   virtual IBPtr clone() const {return new_ptr(*this);}
0508 
0509   /** Make a clone of this object, possibly modifying the cloned object
0510    * to make it sane.
0511    * @return a pointer to the new object.
0512    */
0513   virtual IBPtr fullclone() const {return new_ptr(*this);}
0514   //@}
0515 
0516 private:
0517 
0518   /**
0519    * The assignment operator is private and must never be called.
0520    * In fact, it should not even be implemented.
0521    */
0522   SudakovFormFactor & operator=(const SudakovFormFactor &) = delete;
0523 
0524 private:
0525 
0526   /**
0527    *  Pointer to the splitting function for this Sudakov form factor
0528    */
0529   SplittingFnPtr splittingFn_;
0530 
0531   /**
0532    *  Pointer to the coupling for this Sudakov form factor
0533    */
0534   ShowerAlphaPtr alpha_;
0535 
0536   /**
0537    *  Pointer to the coupling for this Sudakov form factor
0538    */
0539   SudakovCutOffPtr cutoff_;
0540 
0541   /**
0542    * Maximum value of the PDF weight
0543    */
0544   double pdfmax_;
0545 
0546   /**
0547    * List of the particles this Sudakov is used for to aid in setting up
0548    * interpolation tables if needed
0549    */
0550   vector<IdList> particles_;
0551 
0552   /**
0553    *  Option for the inclusion of a factor \f$1/(1-z)\f$ in the PDF estimate
0554    */
0555   unsigned pdffactor_;
0556 
0557 private:
0558 
0559   /**
0560    * Member variables to keep the shower kinematics information
0561    * generated by a call to generateNextTimeBranching or generateNextSpaceBranching
0562    */
0563   //@{
0564   /**
0565    *  The energy fraction
0566    */
0567   double z_;
0568 
0569   /**
0570    *  The azimuthal angle
0571    */
0572   double phi_;
0573 
0574   /**
0575    *  The transverse momentum
0576    */
0577   Energy pT_;
0578   //@}
0579 
0580   /**
0581    *  The limits of \f$z\f$ in the splitting
0582    */
0583   pair<double,double> zlimits_;
0584 
0585   /**
0586    *  Stuff for the PDFs
0587    */
0588   //@{
0589   /**
0590    *  PDf
0591    */
0592   tcPDFPtr pdf_;
0593 
0594   /**
0595    *  Freezing scale
0596    */
0597   Energy freeze_;
0598   //@}
0599 
0600 private:
0601   
0602   /**
0603    *  The evolution scale, \f$\tilde{q}\f$.
0604    */
0605   Energy q_;
0606 
0607   /**
0608    *  The Ids of the particles in the current branching
0609    */
0610   IdList ids_;
0611 
0612   /**
0613    *  The masses of the particles in the current branching
0614    */
0615   vector<Energy> masses_;
0616 
0617   /**
0618    *  The mass squared of the particles in the current branching
0619    */
0620   vector<Energy2> masssquared_;
0621 
0622 };
0623 
0624 }
0625 
0626 #endif /* HERWIG_SudakovFormFactor_H */