Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // SMZDecayer.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_SMZDecayer_H
0010 #define HERWIG_SMZDecayer_H
0011 //
0012 // This is the declaration of the SMZDecayer class.
0013 //
0014 #include "Herwig/Decay/PerturbativeDecayer.h"
0015 #include "ThePEG/Helicity/Vertex/Vector/FFVVertex.h"
0016 #include "Herwig/Decay/PhaseSpaceMode.h"
0017 
0018 namespace Herwig {
0019 using namespace ThePEG;
0020 using namespace ThePEG::Helicity;
0021 
0022 /** \ingroup Decay
0023  *
0024  *  The <code>SMZDecayer</code> is designed to perform the decay of the 
0025  *  Z boson to the Standard Model fermions. In principle it can also
0026  *  be used for these decays in any model.
0027  *
0028  * @see PerturbativeDecayer
0029  * 
0030  */
0031 class SMZDecayer: public PerturbativeDecayer {
0032 
0033 public:
0034 
0035   /**
0036    * Default constructor.
0037    */
0038   SMZDecayer();
0039 
0040   /**
0041    *  Virtual members to be overridden by inheriting classes
0042    *  which implement hard corrections 
0043    */
0044   //@{
0045   /**
0046    *  Has an old fashioned ME correction
0047    */
0048   virtual bool hasMECorrection() {return true;}
0049 
0050   /**
0051    *  Initialize the ME correction
0052    */
0053   virtual void initializeMECorrection(RealEmissionProcessPtr , double & ,
0054                       double & );
0055 
0056   /**
0057    * Apply the soft matrix element correction
0058    * @param parent The initial particle in the current branching
0059    * @param progenitor The progenitor particle of the jet
0060    * @param fs Whether the emission is initial or final-state
0061    * @param highestpT The highest pT so far in the shower
0062    * @param ids ids of the particles produced in the branching
0063    * @param z The momentum fraction of the branching
0064    * @param scale the evolution scale of the branching
0065    * @param pT The transverse momentum of the branching
0066    * @return If true the emission should be vetoed
0067    */
0068   virtual bool softMatrixElementVeto(PPtr parent,
0069                      PPtr progenitor,
0070                      const bool & fs,
0071                      const Energy & highestpT,
0072                      const tcPDVector & ids,
0073                      const double & z,
0074                      const Energy & scale,
0075                      const Energy & pT);
0076     
0077   /**
0078    *  Has a POWHEG style correction
0079    */
0080   virtual POWHEGType hasPOWHEGCorrection() {return FSR;}
0081   //@}
0082 
0083 public:
0084 
0085   /**
0086    * Which of the possible decays is required
0087    * @param cc Is this mode the charge conjugate
0088    * @param parent The decaying particle
0089    * @param children The decay products
0090    */
0091   virtual int modeNumber(bool & cc, tcPDPtr parent, 
0092              const tPDVector & children) const;
0093 
0094   /**
0095    * For a given decay mode and a given particle instance, perform the
0096    * decay and return the decay products. As this is the base class this
0097    * is not implemented.
0098    * @return The vector of particles produced in the decay.
0099    */
0100   virtual ParticleVector decay(const Particle & parent,const tPDVector & children) const;
0101 
0102   /**
0103    * Return the matrix element squared for a given mode and phase-space channel.
0104    * @param ichan The channel we are calculating the matrix element for. 
0105    * @param part The decaying Particle.
0106    * @param outgoing The particles produced in the decay
0107    * @param momenta  The momenta of the particles produced in the decay
0108    * @param meopt Option for the calculation of the matrix element
0109    * @return The matrix element squared for the phase-space configuration.
0110    */
0111   double me2(const int ichan,const Particle & part,
0112          const tPDVector & outgoing,
0113          const vector<Lorentz5Momentum> & momenta,
0114          MEOption meopt) const;
0115 
0116   /**
0117    *   Construct the SpinInfos for the particles produced in the decay
0118    */
0119   virtual void constructSpinInfo(const Particle & part,
0120                  ParticleVector outgoing) const;
0121 
0122   /**
0123    * Output the setup information for the particle database
0124    * @param os The stream to output the information to
0125    * @param header Whether or not to output the information for MySQL
0126    */
0127   virtual void dataBaseOutput(ofstream & os,bool header) const;
0128 
0129   /**
0130    *  Members for the generation of QED radiation in the decays
0131    */
0132   //@{
0133   /**
0134    *  The one-loop virtual correction.
0135    * @param imode The mode required.
0136    * @param part  The decaying particle.
0137    * @param products The decay products including the radiated photon.
0138    * @return Whether the correction is implemented
0139    */
0140   virtual double oneLoopVirtualME(unsigned int imode,
0141                   const Particle & part, 
0142                   const ParticleVector & products);
0143   
0144   /**
0145    *  The real emission matrix element
0146    * @param imode The mode required
0147    * @param part  The decaying particle
0148    * @param products The decay products including the radiated photon
0149    * @param iemitter The particle which emitted the photon
0150    * @param ctheta   The cosine of the polar angle between the photon and the
0151    *                 emitter
0152    * @param stheta   The sine of the polar angle between the photon and the
0153    *                 emitter 
0154    * @param rot1 Rotation from rest frame to frame for real emission
0155    * @param rot2 Rotation to place emitting particle along z
0156    */
0157   virtual InvEnergy2 realEmissionME(unsigned int imode,
0158                     const Particle & part, 
0159                     ParticleVector & products,
0160                     unsigned int iemitter,
0161                     double ctheta, double stheta,
0162                     const LorentzRotation & rot1,
0163                     const LorentzRotation & rot2);
0164   //@}
0165 
0166 public:
0167 
0168   /** @name Functions used by the persistent I/O system. */
0169   //@{
0170   /**
0171    * Function used to write out object persistently.
0172    * @param os the persistent output stream written to.
0173    */
0174   void persistentOutput(PersistentOStream & os) const;
0175 
0176   /**
0177    * Function used to read in object persistently.
0178    * @param is the persistent input stream read from.
0179    * @param version the version number of the object when written.
0180    */
0181   void persistentInput(PersistentIStream & is, int version);
0182   //@}
0183   
0184   /**
0185    * Standard Init function used to initialize the interfaces.
0186    */
0187   static void Init();
0188 
0189 protected:
0190   
0191   /** @name Clone Methods. */
0192   //@{
0193   /**
0194    * Make a simple clone of this object.
0195    * @return a pointer to the new object.
0196    */
0197   virtual IBPtr clone() const {return new_ptr(*this);}
0198 
0199   /** Make a clone of this object, possibly modifying the cloned object
0200    * to make it sane.
0201    * @return a pointer to the new object.
0202    */
0203   virtual IBPtr fullclone() const {return new_ptr(*this);}
0204   //@}
0205   
0206 protected:
0207   
0208   /** @name Standard Interfaced functions. */
0209   //@{
0210   /**
0211    * Initialize this object after the setup phase before saving and
0212    * EventGenerator to disk.
0213    * @throws InitException if object could not be initialized properly.
0214    */
0215   virtual void doinit();
0216 
0217   /**
0218    * Initialize this object. Called in the run phase just before
0219    * a run begins.
0220    */
0221   virtual void doinitrun();
0222   //@}
0223 
0224 protected:
0225 
0226   /**
0227    *  Set the \f$\rho\f$ parameter
0228    */
0229   void setRho(double);
0230 
0231   /**
0232    *  Set the \f$\tilde{\kappa}\f$ parameters symmetrically 
0233    */
0234   void setKtildeSymm();
0235 
0236   /**
0237    * Set second \f$\tilde{\kappa}\f$, given the first.
0238    */
0239   void setKtilde2();
0240 
0241   /**
0242    *  Translate the variables from \f$x_q,x_{\bar{q}}\f$ to \f$\tilde{\kappa},z\f$
0243    */
0244   //@{
0245   /**
0246    *  Calculate \f$z\f$.
0247    */
0248   double getZfromX(double, double);
0249 
0250   /**
0251    *  Calculate \f$\tilde{\kappa}\f$.
0252    */
0253   double getKfromX(double, double);
0254   //@}
0255 
0256   /**
0257    * Calculate \f$x_{q},x_{\bar{q}}\f$ from \f$\tilde{\kappa},z\f$.
0258    * @param kt \f$\tilde{\kappa}\f$
0259    * @param z \f$z\f$
0260    * @param x \f$x_{q}\f$
0261    * @param xbar \f$x_{\bar{q}}\f$
0262    */
0263   void getXXbar(double kt, double z, double & x, double & xbar);
0264 
0265   /**
0266    *  Soft weight
0267    */
0268   //@{
0269   /**
0270    *  Soft quark weight calculated from \f$x_{q},x_{\bar{q}}\f$
0271    * @param x \f$x_{q}\f$
0272    * @param xbar \f$x_{\bar{q}}\f$
0273    */
0274   double qWeight(double x, double xbar); 
0275 
0276   /**
0277    *  Soft antiquark weight calculated from \f$x_{q},x_{\bar{q}}\f$
0278    * @param x \f$x_{q}\f$
0279    * @param xbar \f$x_{\bar{q}}\f$
0280    */
0281   double qbarWeight(double x, double xbar);
0282 
0283   /**
0284    * Soft quark weight calculated from \f$\tilde{q},z\f$
0285    * @param qtilde  \f$\tilde{q}\f$
0286    * @param z \f$z\f$
0287    */
0288   double qWeightX(Energy qtilde, double z);
0289 
0290   /**
0291    * Soft antiquark weight calculated from \f$\tilde{q},z\f$
0292    * @param qtilde  \f$\tilde{q}\f$
0293    * @param z \f$z\f$
0294    */
0295   double qbarWeightX(Energy qtilde, double z);
0296   //@}
0297   /**
0298    * ????
0299    */
0300   double u(double);
0301 
0302   /**
0303    *  Vector and axial vector parts of the matrix element
0304    */
0305   //@{
0306   /**
0307    *  Vector part of the matrix element
0308    */
0309   double MEV(double, double);
0310 
0311   /**
0312    *  Axial vector part of the matrix element
0313    */
0314   double MEA(double, double);
0315 
0316   /**
0317    * The matrix element, given \f$x_1\f$, \f$x_2\f$.
0318    * @param x1 \f$x_1\f$
0319    * @param x2 \f$x_2\f$
0320    */
0321   double PS(double x1, double x2);
0322   //@}
0323   
0324 protected:
0325 
0326   /**
0327    *  Real emission term, for use in generating the hardest emission
0328    */
0329   double calculateRealEmission(double x1, double x2, 
0330                    tcPDVector outgoing,
0331                    vector<Lorentz5Momentum> momenta,
0332                    double phi,
0333                    bool subtract,
0334                    int emitter) const;
0335 
0336   /**
0337    *  Real emission term, for use in generating the hardest emission
0338    */
0339   double calculateRealEmission(double x1, double x2, 
0340                    vector<PPtr> hardProcess,
0341                    double phi,
0342                    bool subtract) const;
0343 
0344   /**
0345    *  Check the sign of the momentum in the \f$z\f$-direction is correct.
0346    */
0347   bool checkZMomenta(double x1, double x2, double x3, double y, Energy pT) const;
0348 
0349   /**
0350    *  Calculate the Jacobian
0351    */
0352   InvEnergy calculateJacobian(double x1, double x2, Energy pT) const;
0353 
0354   /**
0355    *  Calculate the ratio between NLO & LO ME
0356    */
0357   double meRatio(tcPDVector partons, 
0358          vector<Lorentz5Momentum> momenta,
0359          unsigned int iemitter,bool subtract) const;
0360 
0361   /**
0362    *  Calculate matrix element ratio R/B
0363    */
0364   virtual double matrixElementRatio(const Particle & inpart, const ParticleVector & decay2,
0365                     const ParticleVector & decay3, MEOption meopt,
0366                     ShowerInteraction inter);
0367   
0368   /**
0369    *  Calculate the LO ME
0370    */
0371   double loME(const tcPDVector & partons, 
0372           const vector<Lorentz5Momentum> & momenta) const;
0373 
0374   /**
0375    *  Calculate the NLO real emission piece of ME
0376    */
0377   InvEnergy2 realME(const tcPDVector & partons, 
0378             const vector<Lorentz5Momentum> & momenta,
0379             ShowerInteraction inter) const;
0380 
0381   /**
0382    *  Generate a real emission event
0383    */
0384   bool getEvent(vector<PPtr> hardProcess);
0385 
0386 private:
0387 
0388   /**
0389    * Private and non-existent assignment operator.
0390    */
0391   SMZDecayer & operator=(const SMZDecayer &) = delete;
0392 
0393 private:
0394 
0395 
0396 
0397   /**
0398    *  Pointer to the fermion-antifermion Z vertex
0399    */
0400   FFVVertexPtr FFZVertex_;
0401   
0402   /**
0403    * Pointer to the photon vertex
0404    */
0405   AbstractFFVVertexPtr FFPVertex_;
0406 
0407   /**
0408    *  Pointer to the fermion-antifermion G vertex
0409    */
0410   AbstractFFVVertexPtr FFGVertex_;
0411 
0412   /**
0413    * maximum weights for the different integrations
0414    */
0415   //@{
0416   /**
0417    *  Weights for the Z to quarks decays.
0418    */
0419   vector<double> quarkWeight_;
0420 
0421   /**
0422    *  Weights for the Z to leptons decays.
0423    */
0424   vector<double> leptonWeight_;
0425   //@}
0426 
0427   /**
0428    *  Spin density matrix for the decay
0429    */
0430   mutable RhoDMatrix _rho;
0431 
0432   /**
0433    *  Polarization vectors for the decay
0434    */
0435   mutable vector<VectorWaveFunction> _vectors;
0436 
0437   /**
0438    *  Spinors for the decay
0439    */
0440   mutable vector<SpinorWaveFunction> _wave;
0441 
0442   /**
0443    *  Barred spinors for the decay
0444    */
0445   mutable vector<SpinorBarWaveFunction> _wavebar;
0446 
0447 private:
0448 
0449   /**
0450    * CM energy 
0451    */
0452   Energy d_Q_;
0453 
0454   /**
0455    *  Quark mass
0456    */
0457   Energy d_m_;
0458 
0459   /**
0460    * The rho parameter 
0461    */
0462   double d_rho_;
0463 
0464   /**
0465    * The v parameter
0466    */
0467   double d_v_;
0468 
0469   /**
0470    * The initial kappa-tilde values for radiation from the quark
0471    */
0472   double d_kt1_;
0473 
0474   /**
0475    * The initial kappa-tilde values for radiation from the antiquark
0476    */
0477   double d_kt2_;
0478 
0479   /**
0480    *  Cut-off parameter
0481    */
0482   static const double EPS_;
0483 
0484 private:
0485 
0486   /**
0487    *  The colour factor 
0488    */
0489   double CF_;
0490 
0491   /**
0492    *  The Z mass
0493    */
0494   mutable Energy mZ_;
0495 
0496   /**
0497    *  The reduced mass
0498    */
0499   mutable double mu_;
0500 
0501   /**
0502    *  The square of the reduced mass
0503    */
0504   mutable double mu2_;
0505 
0506   /**
0507    *  The strong coupling
0508    */
0509   mutable double aS_;
0510 
0511   /**
0512    * The scale
0513    */
0514   mutable Energy2 scale_;
0515 
0516   /**
0517    *  Stuff for the POWHEG correction
0518    */
0519   //@{
0520   /**
0521    *  ParticleData object for the gluon
0522    */
0523   tcPDPtr gluon_;
0524 
0525   /**
0526    *  The ParticleData objects for the fermions
0527    */
0528   tcPDVector partons_;
0529 
0530   /**
0531    * The fermion momenta
0532    */
0533   vector<Lorentz5Momentum> quark_;
0534 
0535   /**
0536    *  The momentum of the radiated gauge boson
0537    */
0538   Lorentz5Momentum gauge_;
0539 
0540   /**
0541    *  The Z boson
0542    */
0543   PPtr zboson_;
0544 
0545   /**
0546    *  Higgs mass squared
0547    */
0548   Energy2 mz2_;
0549   //@}
0550 
0551   /**
0552    *  Whether or not to give an LO or NLO normalisation
0553    */
0554   bool NLO_;
0555 };
0556 
0557 }
0558 
0559 
0560 #endif /* HERWIG_SMZDecayer_H */