Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // TwoKaonOnePionDefaultCurrent.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_TwoKaonOnePionDefaultCurrent_H
0010 #define HERWIG_TwoKaonOnePionDefaultCurrent_H
0011 //
0012 // This is the declaration of the TwoKaonOnePionDefaultCurrent class.
0013 //
0014 #include "WeakCurrent.h"
0015 #include "Herwig/Utilities/Interpolator.h"
0016 #include "Herwig/Utilities/Kinematics.h"
0017 #include "ThePEG/StandardModel/StandardModelBase.h"
0018 #include "Herwig/Decay/ResonanceHelpers.h"
0019 #include <numeric>
0020 
0021 namespace Herwig {
0022 using namespace ThePEG;
0023 
0024 /** \ingroup Decay
0025  *
0026  * The TwoKaonOnePionDefaultCurrent class implements the currents from Z.Phys.C58:445 (1992),
0027  * this paper uses the form from Z.Phys.C48:445 (1990) for the \f$a_1\f$ width and
0028  * is the default model in TAUOLA.
0029  *
0030  *  The following three meson modes are implemented.
0031  *
0032  * - \f$    K^-   \pi^-    K^+ \f$, (imode=0)
0033  * - \f$    K^0   \pi^-    \bar{K}^0\f$, (imode=1)
0034  * - \f$    K^-   \pi^0    K^0 \f$, (imode=2)
0035  *
0036  *  using the currents from TAUOLA
0037  *
0038  *
0039  * @see WeakCurrent
0040  * @see Defaulta1MatrixElement
0041  * 
0042  */
0043 class TwoKaonOnePionDefaultCurrent: public WeakCurrent {
0044 
0045   /**
0046    * The matrix element for the running \f$a_1\f$ width is a friend to 
0047    * keep some members private.
0048    */
0049   friend class Defaulta1MatrixElement;
0050 
0051 public:
0052 
0053   /**
0054    * Default constructor
0055    */
0056   TwoKaonOnePionDefaultCurrent();
0057 
0058   /**
0059    * Hadronic current. This method is purely virtual and must be implemented in
0060    * all classes inheriting from this one.
0061    * @param resonance If specified only include terms with this particle
0062    * @param flavour Information on the required flavours of the quarks
0063    * @param imode The mode
0064    * @param ichan The phase-space channel the current is needed for.
0065    * @param scale The invariant mass of the particles in the current.
0066    * @param outgoing The particles produced in the decay
0067    * @param momenta  The momenta of the particles produced in the decay
0068    * @param meopt Option for the calculation of the matrix element
0069    * @return The current. 
0070    */
0071   virtual vector<LorentzPolarizationVectorE> 
0072   current(tcPDPtr resonance,
0073       FlavourInfo flavour,
0074       const int imode, const int ichan,Energy & scale,
0075       const tPDVector & outgoing,
0076       const vector<Lorentz5Momentum> & momenta,
0077       DecayIntegrator::MEOption meopt) const;
0078 
0079   /**
0080    * Accept the decay. Checks the mesons against the list.
0081    * @param id The id's of the particles in the current.
0082    * @return Can this current have the external particles specified.
0083    */
0084   virtual bool accept(vector<int> id);
0085 
0086   /**
0087    * Return the decay mode number for a given set of particles in the current. 
0088    * Checks the mesons against the list.
0089    * @param id The id's of the particles in the current.
0090    * @return The number of the mode
0091    */
0092   virtual unsigned int decayMode(vector<int> id);
0093 
0094   /**
0095    * The particles produced by the current. This returns the mesons for the mode.
0096    * @param icharge The total charge of the particles in the current.
0097    * @param imode The mode for which the particles are being requested
0098    * @param iq The PDG code for the quark
0099    * @param ia The PDG code for the antiquark
0100    * @return The external particles for the current.
0101    */
0102   virtual tPDVector particles(int icharge, unsigned int imode, int iq, int ia);
0103 
0104 public:
0105 
0106   /** @name Functions used by the persistent I/O system. */
0107   //@{
0108   /**
0109    * Function used to write out object persistently.
0110    * @param os the persistent output stream written to.
0111    */
0112   void persistentOutput(PersistentOStream & os) const;
0113 
0114   /**
0115    * Function used to read in object persistently.
0116    * @param is the persistent input stream read from.
0117    * @param version the version number of the object when written.
0118    */
0119   void persistentInput(PersistentIStream & is, int version);
0120   //@}
0121 
0122   /**
0123    * Standard Init function used to initialize the interfaces.
0124    */
0125   static void Init();
0126 
0127 public:
0128 
0129   /** @name Methods for the construction of the phase space integrator. */
0130   //@{
0131   /**
0132    * Complete the construction of the decay mode for integration.classes inheriting
0133    * from this one.
0134    * This method is purely virtual and must be implemented in the classes inheriting
0135    * from WeakCurrent.
0136    * @param icharge   The total charge of the outgoing particles in the current.
0137    * @param resonance If specified only include terms with this particle
0138    * @param flavour Information on the required flavours of the quarks
0139    * @param imode     The mode in the current being asked for.
0140    * @param mode      The phase space mode for the integration
0141    * @param iloc      The location of the of the first particle from the current in
0142    *                  the list of outgoing particles.
0143    * @param ires      The location of the first intermediate for the current.
0144    * @param phase     The prototype phase space channel for the integration.
0145    * @param upp       The maximum possible mass the particles in the current are
0146    *                  allowed to have.
0147    * @return Whether the current was sucessfully constructed.
0148    */
0149   virtual bool createMode(int icharge, tcPDPtr resonance,
0150               FlavourInfo flavour,
0151               unsigned int imode,PhaseSpaceModePtr mode,
0152               unsigned int iloc,int ires,
0153               PhaseSpaceChannel phase, Energy upp );
0154   //@}
0155 
0156   /**
0157    * Output the setup information for the particle database
0158    * @param os The stream to output the information to
0159    * @param header Whether or not to output the information for MySQL
0160    * @param create Whether or not to add a statement creating the object
0161    */
0162   virtual void dataBaseOutput(ofstream & os,bool header,bool create) const;
0163   
0164   /**
0165    * the matrix element for the \f$a_1\f$ decay to calculate the running width
0166    * @param imode The mode for which the matrix element is needed.
0167    * @param q2 The mass of the decaying off-shell \f$a_1\f$, \f$q^2\f$.
0168    * @param s3 The invariant mass squared of particles 1 and 2, \f$s_3=m^2_{12}\f$.
0169    * @param s2 The invariant mass squared of particles 1 and 3, \f$s_2=m^2_{13}\f$.
0170    * @param s1 The invariant mass squared of particles 2 and 3, \f$s_1=m^2_{23}\f$.
0171    * @param m1 The mass of the first  outgoing particle.
0172    * @param m2 The mass of the second outgoing particle.
0173    * @param m3 The mass of the third  outgoing particle.
0174    * @return The matrix element squared summed over spins.
0175    */
0176   double threeBodyMatrixElement(const int imode,  const Energy2 q2,
0177                 const Energy2 s3, const Energy2 s2, 
0178                 const Energy2 s1, const Energy  m1, 
0179                 const Energy  m2, const Energy  m3) const;
0180 
0181 protected:
0182 
0183   /** @name Clone Methods. */
0184   //@{
0185   /**
0186    * Make a simple clone of this object.
0187    * @return a pointer to the new object.
0188    */
0189   virtual IBPtr clone() const {return new_ptr(*this);}
0190 
0191   /** Make a clone of this object, possibly modifying the cloned object
0192    * to make it sane.
0193    * @return a pointer to the new object.
0194    */
0195   virtual IBPtr fullclone() const {return new_ptr(*this);}
0196   //@}
0197 
0198 protected:
0199 
0200   /** @name Standard Interfaced functions. */
0201   //@{
0202   /**
0203    * Initialize this object after the setup phase before saving and
0204    * EventGenerator to disk.
0205    * @throws InitException if object could not be initialized properly.
0206    */
0207   virtual void doinit();
0208 
0209   /**
0210    * Initialize this object to the begining of the run phase.
0211    */
0212   virtual void doinitrun();
0213 
0214   /**
0215    * Check sanity of the object during the setup phase.
0216    */
0217   virtual void doupdate();
0218   //@}
0219 
0220 private:
0221 
0222   /**
0223    * Private and non-existent assignment operator.
0224    */
0225   TwoKaonOnePionDefaultCurrent & operator=(const TwoKaonOnePionDefaultCurrent &) = delete;
0226 
0227 private:
0228   
0229   /**
0230    * The \f$\rho\f$ Breit-Wigner for the \f$F_{1,2,3}\f$ form factors.
0231    * @param q2 The scale \f$q^2\f$ for the Breit-Wigner
0232    * @param ires Which \f$\rho\f$ multiplet
0233    * @return The Breit-Wigner 
0234    */
0235   Complex BrhoF123(Energy2 q2,int ires) const {
0236     if(ires>=int(_rhoF123wgts.size())) return 0.;
0237     Complex output(0.);
0238     Complex norm = std::accumulate(_rhoF123wgts.begin(),
0239                    _rhoF123wgts.end(),Complex(0.));
0240     unsigned int imin=0,imax=_rhoF123wgts.size();
0241     if(ires>0) {
0242       imin=ires;
0243       imax=imin+1;
0244     }
0245     for(unsigned int ix=imin;ix<imax;++ix)
0246       output+=_rhoF123wgts[ix]*Resonance::BreitWignerPWave(q2,_rhoF123masses[ix],
0247                                _rhoF123widths[ix],_mpi,_mpi);
0248     return output/norm;
0249   }
0250 
0251   /**
0252    * The \f$\rho\f$ Breit-Wigner for the \f$F_5\f$ form factors.
0253    * @param q2 The scale \f$q^2\f$ for the Breit-Wigner
0254    * @param ires Which \f$\rho\f$ multiplet
0255    * @return The Breit-Wigner 
0256    */
0257   Complex BrhoF5(Energy2 q2,int ires) const {
0258     if(ires>=int(_rhoF5wgts.size())) return 0.;
0259     Complex output(0.);
0260     Complex norm = std::accumulate(_rhoF5wgts.begin(),
0261                    _rhoF5wgts.end(),Complex(0.));
0262     unsigned int imin=0,imax=_rhoF5wgts.size();
0263     if(ires>0) {
0264       imin=ires;
0265       imax=imin+1;
0266     }
0267     for(unsigned int ix=imin;ix<imax;++ix)
0268       output+=_rhoF5wgts[ix]*Resonance::BreitWignerPWave(q2,_rhoF5masses[ix],
0269                                _rhoF5widths[ix],_mpi,_mpi);
0270     return output/norm;
0271   }
0272 
0273   /**
0274    * The \f$K^*\f$ Breit-Wigner for the \f$F_{1,2,3}\f$ form factors.
0275    * @param q2 The scale \f$q^2\f$ for the Breit-Wigner
0276    * @param ires Which \f$\rho\f$ multiplet
0277    * @return The Breit-Wigner 
0278    */
0279   Complex BKstarF123(Energy2 q2,int ires) const {
0280     if(ires>=int(_kstarF123wgts.size())) return 0.;
0281     Complex output(0.);
0282     Complex norm = std::accumulate(_kstarF123wgts.begin(),
0283                    _kstarF123wgts.end(),Complex(0.));
0284     unsigned int imin=0,imax=_kstarF123wgts.size();
0285     if(ires>0) {
0286       imin=ires;
0287       imax=imin+1;
0288     }
0289     assert(imax<=_kstarF123wgts.size());
0290     for(unsigned int ix=imin;ix<imax;++ix)
0291       output+=_kstarF123wgts[ix]*Resonance::BreitWignerPWave(q2,_kstarF123masses[ix],
0292                                  _kstarF123widths[ix],_mpi,_mK);
0293     return output/norm;
0294   }
0295   
0296   /**
0297    * Mixed Breit Wigner for the \f$F_5\f$ form factor
0298    * @param si The scale \f$s_1\f$.
0299    * @param sj The scale \f$s_2\f$.
0300    * @param ires Which resonances to use
0301    * @return The mixed Breit-Wigner
0302    */
0303   Complex FKrho(Energy2 si,Energy2 sj,int ires) const {
0304     Complex output;
0305     if(ires<0)
0306       output = _rhoKstarwgt*BKstarF123(si,-1)+BrhoF123(sj,-1);
0307     else if(ires%2==0)
0308       output= _rhoKstarwgt*BKstarF123(si,ires/2);
0309     else if(ires%2==1)
0310       output=BrhoF123(sj,ires/2);
0311     return output/(1.+_rhoKstarwgt);
0312   }
0313   
0314   /**
0315    * \f$a_1\f$ Breit-Wigner
0316    * @param q2 The scale \f$q^2\f$ for the Breit-Wigner
0317    * @return The Breit-Wigner
0318    */
0319   Complex a1BreitWigner(Energy2 q2) const  {
0320     if(!_a1opt)
0321       return Resonance::BreitWignera1(q2,_a1mass,_a1width);
0322     Complex ii(0.,1.);
0323     Energy2 m2(_a1mass*_a1mass);
0324     Energy  q(sqrt(q2));
0325     Energy width = (*_a1runinter)(q2);
0326     return m2/(m2-q2-ii*q*width);
0327   }
0328 
0329   /**
0330    * Initialize the \f$a_1\f$ running width
0331    * @param iopt Initialization option (-1 full calculation, 0 set up the interpolation)
0332    */
0333   void inita1Width(int iopt);
0334 
0335 private:
0336   
0337   /**
0338    * Parameters for the \f$\rho\f$ Breit-Wigner in the
0339    * \f$F_{1,2,3}\f$ form factors.
0340    */
0341   vector<double> _rhoF123wgts;
0342 
0343   /**
0344    * Parameters for the \f$K^*\f$ Breit-Wigner in the
0345    * \f$F_{1,2,3}\f$ form factors.
0346    */
0347   vector<double> _kstarF123wgts;
0348   
0349   /**
0350    * Parameters for the \f$\rho\f$ Breit-Wigner in the
0351    * \f$F_5\f$ form factors.
0352    */
0353   vector<double> _rhoF5wgts;
0354   
0355   /**
0356    * The relative weight of the \f$\rho\f$ and \f$K^*\f$ where needed.
0357    */
0358   double _rhoKstarwgt;
0359   
0360   /**
0361    * The \f$a_1\f$ width for the running \f$a_1\f$ width calculation.
0362    */
0363   vector<Energy>  _a1runwidth;
0364 
0365   /**
0366    * The \f$q^2\f$ for the running \f$a_1\f$  width calculation.
0367    */
0368   vector<Energy2> _a1runq2;
0369 
0370   /**
0371    * The interpolator for the running \f$a_1\f$ width calculation.
0372    */
0373   Interpolator<Energy,Energy2>::Ptr _a1runinter;
0374 
0375   /**
0376    * Initialize the running \f$a_1\f$ width.
0377    */
0378   bool _initializea1;
0379   
0380   /**
0381    * The mass of the \f$a_1\f$ resonances.
0382    */
0383   Energy _a1mass;
0384 
0385   /**
0386    * The width of the \f$a_1\f$ resonances.
0387    */
0388   Energy _a1width;
0389 
0390   /**
0391    * The pion decay constant, \f$f_\pi\f$.
0392    */
0393   Energy _fpi;
0394 
0395   /**
0396    * The pion mass
0397    */
0398   Energy _mpi;
0399 
0400   /**
0401    * The kaon mass
0402    */
0403   Energy _mK;
0404 
0405   /**
0406    * The \f$\rho\f$ masses for the \f$F_{1,2,3}\f$ form factors.
0407    */
0408   vector<Energy> _rhoF123masses;
0409 
0410   /**
0411    * The \f$\rho\f$ masses for the \f$F_5\f$ form factors.
0412    */
0413   vector<Energy> _rhoF5masses;
0414 
0415   /**
0416    * The \f$\rho\f$ widths for the \f$F_{1,2,3}\f$ form factors.
0417    */
0418   vector<Energy> _rhoF123widths;
0419 
0420   /**
0421    * The \f$\rho\f$ widths for the \f$F_5\f$ form factors.
0422    */
0423   vector<Energy> _rhoF5widths;
0424 
0425   /**
0426    * The \f$K^*\f$ masses for the \f$F_{1,2,3}\f$ form factors.
0427    */
0428   vector<Energy> _kstarF123masses;
0429 
0430   /**
0431    * The \f$K^*\f$ widths for the \f$F_{1,2,3}\f$ form factors.
0432    */
0433   vector<Energy> _kstarF123widths;
0434 
0435   /**
0436    * Option for the \f$a_1\f$ width
0437    */
0438   bool _a1opt;
0439 
0440   /**
0441    *  The maximum mass of the hadronic system
0442    */
0443   Energy _maxmass;
0444 
0445   /**
0446    *  The maximum mass when the running width was calculated
0447    */
0448   Energy _maxcalc;
0449   
0450 };
0451 
0452 }
0453 
0454 #endif /* HERWIG_TwoKaonOnePionDefaultCurrent_H */