Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // WeakCurrent.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_WeakCurrent_H
0010 #define HERWIG_WeakCurrent_H
0011 //
0012 // This is the declaration of the WeakCurrent class.
0013 //
0014 #include "ThePEG/Interface/Interfaced.h"
0015 #include "WeakCurrent.fh"
0016 #include "Herwig/Decay/DecayIntegrator.h"
0017 #include "Herwig/Decay/PhaseSpaceMode.h"
0018 #include "Herwig/Decay/PhaseSpaceChannel.h"
0019 #include "ThePEG/Helicity/LorentzPolarizationVector.h"
0020 #include "Herwig/Decay/IsoSpin.h"
0021 
0022 namespace Herwig {
0023 using namespace ThePEG;
0024 using ThePEG::Helicity::LorentzPolarizationVector;
0025 using ThePEG::Helicity::LorentzPolarizationVectorE;
0026   
0027 /** \ingroup Decay
0028  *
0029  *  The <code>WeakCurrent</code> class is the base class for the hadronic
0030  *  currents produced in weak decays. This is designed so it can be used in
0031  *  any weak decay. In general the currents which are implemented are either
0032  *  simple one meson production or taken from tau decay.
0033  *
0034  *  In classes inheriting from this one a number of member functions must be implemented
0035  *
0036  * - createMode which takes a vector of partially completed PhaseSpaceChannel 
0037  *   and adds the extra information required for the current. This method should
0038  *   assume that the particles from the current are the last ones specified in the
0039  *   PhaseSpaceMode. This method will then construct the PhaseSpaceMode
0040  *   for the decay.
0041  *
0042  * - particles() which returns the external particles produced by the current.
0043  *
0044  * - current() which given the decay products calculates the decay current
0045  *
0046  * - accept() which uses the PDG codes for the particles in the current to 
0047  *   decide if a given mode is allowed.
0048  *
0049  * - decayMode() which uses the PDG codes for the particles in the current to 
0050  *   workout which modes is being performed.
0051  *
0052  * - dataBaseOutput() which should output the information on all the Interfaces so
0053  *   that the WeakCurrent can be reconstructed by the Herwig particle
0054  *   properties database.
0055  *
0056  * @see Interfaced.
0057  * 
0058  */
0059 class WeakCurrent: public Interfaced {
0060 
0061 public:
0062 
0063   /**
0064    * Default constructor
0065    */
0066   WeakCurrent() : numberModes_(0) {}
0067 
0068 public:
0069 
0070   /** @name Methods for the construction of the phase space integrator. */
0071   //@{
0072   /**
0073    * Complete the construction of the decay mode for integration.classes inheriting
0074    * from this one.
0075    * This method is purely virtual and must be implemented in the classes inheriting
0076    * from WeakCurrent.
0077    * @param icharge   The total charge of the outgoing particles in the current.
0078    * @param resonance If specified only include terms with this particle
0079    * @param flavour Information on the required flavours of the quarks
0080    * @param imode     The mode in the current being asked for.
0081    * @param mode      The phase space mode for the integration
0082    * @param iloc      The location of the of the first particle from the current in
0083    *                  the list of outgoing particles.
0084    * @param ires      The location of the first intermediate for the current.
0085    * @param phase     The prototype phase space channel for the integration.
0086    * @param upp       The maximum possible mass the particles in the current are
0087    *                  allowed to have.
0088    * @return Whether the current was sucessfully constructed.
0089    */
0090   virtual bool createMode(int icharge, tcPDPtr resonance,
0091               FlavourInfo flavour,
0092               unsigned int imode,PhaseSpaceModePtr mode,
0093               unsigned int iloc,int ires,
0094               PhaseSpaceChannel phase, Energy upp )=0;
0095 
0096   /**
0097    * The particles produced by the current. This method is purely virtual and
0098    * must be implemented in classes inheriting from this one.
0099    * @param icharge The total charge of the particles in the current.
0100    * @param imode The mode for which the particles are being requested
0101    * @param iq The PDG code for the quark
0102    * @param ia The PDG code for the antiquark
0103    * @return The external particles for the current.
0104    */
0105   virtual tPDVector particles(int icharge, unsigned int imode, int iq, int ia)=0;
0106   //@}
0107 
0108   /**
0109    * Return the number of modes handled by this current
0110    */
0111   unsigned int numberOfModes() const {return quark_.size();}
0112 
0113   /**
0114    * Hadronic current. This method is purely virtual and must be implemented in
0115    * all classes inheriting from this one.
0116    * @param resonance If specified only include terms with this particle
0117    * @param flavour Information on the required flavours of the quarks
0118    * @param imode The mode
0119    * @param ichan The phase-space channel the current is needed for.
0120    * @param scale The invariant mass of the particles in the current.
0121    * @param outgoing The particles produced in the decay
0122    * @param momenta  The momenta of the particles produced in the decay
0123    * @param meopt Option for the calculation of the matrix element
0124    * @return The current. 
0125    */
0126   virtual vector<LorentzPolarizationVectorE> 
0127   current(tcPDPtr resonance,
0128       FlavourInfo flavour,
0129       const int imode, const int ichan,Energy & scale,
0130       const tPDVector & outgoing,
0131       const vector<Lorentz5Momentum> & momenta,
0132       DecayIntegrator::MEOption meopt) const=0;
0133 
0134   /**
0135    *   Construct the SpinInfo for the decay products
0136    */
0137   virtual void constructSpinInfo(ParticleVector decay) const;
0138 
0139   /**
0140    * Accept the decay. This method is purely virtual and must be implemented in any class
0141    * inheriting from this one.
0142    * @param id The id's of the particles in the current.
0143    * @return Can this current have the external particles specified.
0144    */
0145   virtual bool accept(vector<int> id)=0;
0146 
0147   /**
0148    * Return the decay mode number for a given set of particles in the current. 
0149    * This method is purely virtual and must be implemented in any class
0150    * inheriting from this one.
0151    * @param id The id's of the particles in the current.
0152    * @return The number of the mode
0153    */
0154   virtual unsigned int decayMode(vector<int> id)=0;
0155 
0156   /**
0157    *  Information on a decay mode
0158    * @param imode The mode
0159    * @param iq The PDG code of the quark.
0160    * @param ia The PDG code of the antiquark.
0161    */
0162   void decayModeInfo(unsigned int imode, int& iq, int& ia) const {
0163     if(imode<quark_.size()) {
0164       iq=quark_[imode];
0165       ia=antiquark_[imode];
0166     }
0167     else {
0168       iq=0;
0169       ia=0;
0170     }
0171   }
0172 
0173   /**
0174    * Output the setup information for the particle database
0175    * @param os The stream to output the information to
0176    * @param header Whether or not to output the information for MySQL
0177    * @param create Whether or not to add a statement creating the object
0178    */
0179   virtual void dataBaseOutput(ofstream & os,bool header,bool create) const;
0180 
0181 public:
0182 
0183   /** @name Functions used by the persistent I/O system. */
0184   //@{
0185   /**
0186    * Function used to write out object persistently.
0187    * @param os the persistent output stream written to.
0188    */
0189   void persistentOutput(PersistentOStream & os) const;
0190 
0191   /**
0192    * Function used to read in object persistently.
0193    * @param is the persistent input stream read from.
0194    * @param version the version number of the object when written.
0195    */
0196   void persistentInput(PersistentIStream & is, int version);
0197   //@}
0198 
0199   /**
0200    * Standard Init function used to initialize the interfaces.
0201    */
0202   static void Init();
0203 
0204 protected:
0205 
0206   /**
0207    *  Add a decay mode to the list.
0208    * @param iq The PDG code for the quark.
0209    * @param ia The PDG code for the antiquark.
0210    */
0211   void addDecayMode(int iq,int ia) {
0212     quark_.push_back(iq);
0213     antiquark_.push_back(ia);
0214   }
0215 
0216   /**
0217    *  Set initial number of modes
0218    * @param nmodes The number of modes.
0219    */
0220   void setInitialModes(unsigned int nmodes) {numberModes_=nmodes;}
0221 
0222 private:
0223 
0224   /**
0225    * Private and non-existent assignment operator.
0226    */
0227   WeakCurrent & operator=(const WeakCurrent &) = delete;
0228 
0229 private:
0230 
0231   /**
0232    * The PDG codes for the quarks contained in the current.
0233    */
0234   vector<int> quark_;
0235 
0236   /**
0237    * The PDG codes for the antiquarks contained in the current.
0238    */
0239   vector<int> antiquark_;
0240 
0241   /**
0242    * The initial number of modes
0243    */
0244   unsigned int numberModes_;
0245 
0246 };
0247 
0248 }
0249 
0250 
0251 #endif /* HERWIG_WeakCurrent_H */