Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // KPiCurrent.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_KPiCurrent_H
0010 #define HERWIG_KPiCurrent_H
0011 //
0012 // This is the declaration of the KPiCurrent class.
0013 //
0014 
0015 #include "WeakCurrent.h"
0016 #include "Herwig/Utilities/Kinematics.h"
0017 
0018 namespace Herwig {
0019 
0020 using namespace ThePEG;
0021 
0022 /**
0023  * Here is the documentation of the KPiCurrent class.
0024  *
0025  * @see \ref KPiCurrentInterfaces "The interfaces"
0026  * defined for KPiCurrent.
0027  */
0028 class KPiCurrent: public WeakCurrent {
0029 
0030 public:
0031 
0032   /**
0033    * The default constructor.
0034    */
0035   KPiCurrent();
0036 
0037 
0038   /** @name Methods for the construction of the phase space integrator. */
0039   //@{
0040   /**
0041    * Complete the construction of the decay mode for integration.classes inheriting
0042    * from this one.
0043    * This method is purely virtual and must be implemented in the classes inheriting
0044    * from WeakCurrent.
0045    * @param icharge   The total charge of the outgoing particles in the current.
0046    * @param resonance If specified only include terms with this particle
0047    * @param flavour Information on the required flavours of the quarks
0048    * @param imode     The mode in the current being asked for.
0049    * @param mode      The phase space mode for the integration
0050    * @param iloc      The location of the of the first particle from the current in
0051    *                  the list of outgoing particles.
0052    * @param ires      The location of the first intermediate for the current.
0053    * @param phase     The prototype phase space channel for the integration.
0054    * @param upp       The maximum possible mass the particles in the current are
0055    *                  allowed to have.
0056    * @return Whether the current was sucessfully constructed.
0057    */
0058   virtual bool createMode(int icharge, tcPDPtr resonance,
0059               FlavourInfo flavour,
0060               unsigned int imode,PhaseSpaceModePtr mode,
0061               unsigned int iloc,int ires,
0062               PhaseSpaceChannel phase, Energy upp );
0063 
0064   /**
0065    * The particles produced by the current. This just returns the two pseudoscalar
0066    * mesons and the photon.
0067    * @param icharge The total charge of the particles in the current.
0068    * @param imode The mode for which the particles are being requested
0069    * @param iq The PDG code for the quark
0070    * @param ia The PDG code for the antiquark
0071    * @return The external particles for the current.
0072    */
0073   virtual tPDVector particles(int icharge, unsigned int imode, int iq, int ia);
0074   //@}
0075 
0076 
0077   /**
0078    * Hadronic current. This method is purely virtual and must be implemented in
0079    * all classes inheriting from this one.
0080    * @param resonance If specified only include terms with this particle
0081    * @param flavour Information on the required flavours of the quarks
0082    * @param imode The mode
0083    * @param ichan The phase-space channel the current is needed for.
0084    * @param scale The invariant mass of the particles in the current.
0085    * @param outgoing The particles produced in the decay
0086    * @param momenta  The momenta of the particles produced in the decay
0087    * @param meopt Option for the calculation of the matrix element
0088    * @return The current. 
0089    */
0090   virtual vector<LorentzPolarizationVectorE> 
0091   current(tcPDPtr resonance,
0092       FlavourInfo flavour,
0093       const int imode, const int ichan,Energy & scale,
0094       const tPDVector & outgoing,
0095       const vector<Lorentz5Momentum> & momenta,
0096       DecayIntegrator::MEOption meopt) const;
0097 
0098   /**
0099    * Accept the decay. Checks the particles are the allowed mode.
0100    * @param id The id's of the particles in the current.
0101    * @return Can this current have the external particles specified.
0102    */
0103   virtual bool accept(vector<int> id);
0104 
0105   /**
0106    * Return the decay mode number for a given set of particles in the current. 
0107    * @param id The id's of the particles in the current.
0108    * @return The number of the mode
0109    */
0110   virtual unsigned int decayMode(vector<int> id);
0111 
0112   /**
0113    * Output the setup information for the particle database
0114    * @param os The stream to output the information to
0115    * @param header Whether or not to output the information for MySQL
0116    * @param create Whether or not to add a statement creating the object
0117    */
0118   virtual void dataBaseOutput(ofstream & os,bool header,bool create) const;
0119 
0120 public:
0121 
0122   /** @name Functions used by the persistent I/O system. */
0123   //@{
0124   /**
0125    * Function used to write out object persistently.
0126    * @param os the persistent output stream written to.
0127    */
0128   void persistentOutput(PersistentOStream & os) const;
0129 
0130   /**
0131    * Function used to read in object persistently.
0132    * @param is the persistent input stream read from.
0133    * @param version the version number of the object when written.
0134    */
0135   void persistentInput(PersistentIStream & is, int version);
0136   //@}
0137 
0138   /**
0139    * The standard Init function used to initialize the interfaces.
0140    * Called exactly once for each class by the class description system
0141    * before the main function starts or
0142    * when this class is dynamically loaded.
0143    */
0144   static void Init();
0145 
0146 protected:
0147 
0148   /**
0149    * Breit-Wigner distributions
0150    */
0151   //@{
0152   /**
0153    * s-wave Breit-Wigner for the scalar resonances
0154    * @param q2 The scale
0155    * @param ires The resonances
0156    */
0157   Complex sWaveBreitWigner(Energy2 q2,unsigned int ires) const {
0158     Energy q=sqrt(q2),gam(ZERO);
0159     Energy2 m2=sqr(_scamass[ires]);
0160     if(q>_mK+_mpi) {
0161       Energy pX=Kinematics::pstarTwoBodyDecay(_scamass[ires],_mK,_mpi);
0162       Energy p =Kinematics::pstarTwoBodyDecay( q            ,_mK,_mpi);
0163       gam = _scawidth[ires]*m2/q2*p/pX;
0164     }
0165     return m2/(m2-q2-Complex(0.,1.)*q*gam);
0166   }
0167   
0168   /**
0169    *  p-wave Breit-Wigner for the vector resonances
0170    * @param q2 The scale
0171    * @param ires The resonances
0172    */
0173   Complex pWaveBreitWigner(Energy2 q2,unsigned int ires) const {
0174     Energy q=sqrt(q2),gam(ZERO);
0175     Energy2 m2=sqr(_vecmass[ires]);
0176     if(q>_mK+_mpi) {
0177       Energy pX=Kinematics::pstarTwoBodyDecay(_vecmass[ires],_mK,_mpi);
0178       Energy p =Kinematics::pstarTwoBodyDecay( q            ,_mK,_mpi);
0179       double ratio=p/pX;
0180       gam = _vecwidth[ires]*m2/q2*ratio*sqr(ratio);
0181     }
0182     return m2/(m2-q2-Complex(0.,1.)*q*gam);
0183   }
0184   //@}
0185 
0186 protected:
0187 
0188   /** @name Clone Methods. */
0189   //@{
0190   /**
0191    * Make a simple clone of this object.
0192    * @return a pointer to the new object.
0193    */
0194   virtual IBPtr clone() const {return new_ptr(*this);}
0195   
0196   /** Make a clone of this object, possibly modifying the cloned object
0197    * to make it sane.
0198    * @return a pointer to the new object.
0199    */
0200   virtual IBPtr fullclone() const {return new_ptr(*this);}
0201   //@}
0202 
0203 protected:
0204 
0205   /** @name Standard Interfaced functions. */
0206   //@{
0207 
0208   /**
0209    * Initialize this object after the setup phase before saving and
0210    * EventGenerator to disk.
0211    * @throws InitException if object could not be initialized properly.
0212    */
0213   virtual void doinit();
0214   //@}
0215 
0216 private:
0217 
0218   /**
0219    * The assignment operator is private and must never be called.
0220    * In fact, it should not even be implemented.
0221    */
0222   KPiCurrent & operator=(const KPiCurrent &) = delete;
0223 
0224 private:
0225 
0226   /**
0227    *  Use local value of the parameters not those from the ParticleData objects
0228    */
0229   bool _localparameters;
0230 
0231   /**
0232    *  Whether to use \f$m^2\f$ or \f$Q^2\f$ in the projection operator.
0233    */
0234   bool _transverse;
0235 
0236   /**
0237    *  Normalizations of the vector and scalar pieces
0238    */
0239   //@{
0240   /**
0241    * \f$c_V\f$, normalization of the vector piece.
0242    */
0243   double _cV;
0244 
0245   /**
0246    * \f$c_S\f$, normalization of the scalar piece
0247    */
0248   double _cS;
0249   //@}
0250 
0251   /**
0252    * Parameters for the vector resonances
0253    */
0254   //@{
0255   /**
0256    *  Magnitude of the vector weights
0257    */
0258   vector<double> _vecmag;
0259 
0260   /**
0261    *  Phase of the vector weights
0262    */
0263   vector<double> _vecphase;
0264 
0265   /**
0266    *  Weights for the vector resonaces
0267    */
0268   vector<Complex> _vecwgt;
0269 
0270   /**
0271    *  Masses of the vector resonances
0272    */
0273   vector<Energy> _vecmass;
0274 
0275   /**
0276    *  Widths of the vector resonances
0277    */
0278   vector<Energy> _vecwidth;
0279   //@}
0280 
0281   /**
0282    * Parameters for the scalar resonances
0283    */
0284   //@{
0285   /**
0286    *  Magnitude of the scalar weights
0287    */
0288   vector<double> _scamag;
0289 
0290   /**
0291    *  Phase of the scalar weights
0292    */
0293   vector<double> _scaphase;
0294 
0295   /**
0296    *  Weights for the scalar resonances
0297    */
0298   vector<Complex> _scawgt;
0299 
0300   /**
0301    *  Masses of the scalar resonances
0302    */
0303   vector<Energy> _scamass;
0304 
0305   /**
0306    *  Widths of the scalar resonances
0307    */
0308   vector<Energy> _scawidth;
0309   //@}
0310 
0311   /**
0312    *  Masses for calculating the running widths
0313    */
0314   //@{
0315   /**
0316    * The pion mass
0317    */
0318   Energy _mpi;
0319 
0320   /**
0321    * The kaon mass
0322    */
0323   Energy _mK;
0324   //@}
0325 
0326   /**
0327    *  Map for the resonances
0328    */
0329   vector<int> _resmap;
0330 };
0331 
0332 }
0333 
0334 #endif /* HERWIG_KPiCurrent_H */