Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 #ifndef Herwig_WeakBaryonCurrent_H
0003 #define Herwig_WeakBaryonCurrent_H
0004 //
0005 // This is the declaration of the WeakBaryonCurrent class.
0006 //
0007 
0008 #include "WeakCurrent.h"
0009 #include "Herwig/Decay/FormFactors/BaryonFormFactor.h"
0010 #include "ThePEG/Helicity/LorentzSpinorBar.h"
0011 
0012 namespace Herwig {
0013 
0014 using namespace ThePEG;
0015 
0016 /**
0017  * The WeakBaryonCurrent class is a wrapper around the BaryonFormFactor so that
0018  * they can be used as a current.
0019  *
0020  * @see \ref WeakBaryonCurrentInterfaces "The interfaces"
0021  * defined for WeakBaryonCurrent.
0022  */
0023 class WeakBaryonCurrent: public WeakCurrent {
0024 
0025 public:
0026 
0027   /**
0028    * The default constructor.
0029    */
0030   WeakBaryonCurrent();
0031 
0032 public:
0033 
0034   /** @name Methods for the construction of the phase space integrator. */
0035   //@{
0036   /**
0037    * Complete the construction of the decay mode for integration.classes inheriting
0038    * from this one.
0039    * This method is purely virtual and must be implemented in the classes inheriting
0040    * from WeakCurrent.
0041    * @param icharge   The total charge of the outgoing particles in the current.
0042    * @param resonance If specified only include terms with this particle
0043    * @param flavour Information on the required flavours of the quarks
0044    * @param imode     The mode in the current being asked for.
0045    * @param mode      The phase space mode for the integration
0046    * @param iloc      The location of the of the first particle from the current in
0047    *                  the list of outgoing particles.
0048    * @param ires      The location of the first intermediate for the current.
0049    * @param phase     The prototype phase space channel for the integration.
0050    * @param upp       The maximum possible mass the particles in the current are
0051    *                  allowed to have.
0052    * @return Whether the current was sucessfully constructed.
0053    */
0054   virtual bool createMode(int icharge, tcPDPtr resonance,
0055               FlavourInfo flavour,
0056               unsigned int imode,PhaseSpaceModePtr mode,
0057               unsigned int iloc,int ires,
0058               PhaseSpaceChannel phase, Energy upp );
0059 
0060   /**
0061    * The particles produced by the current. This just returns the leptons.
0062    * @param icharge The total charge of the particles in the current.
0063    * @param imode The mode for which the particles are being requested
0064    * @param iq The PDG code for the quark
0065    * @param ia The PDG code for the antiquark
0066    * @return The external particles for the current.
0067    */
0068   virtual tPDVector particles(int icharge, unsigned int imode, int iq, int ia);
0069   //@}
0070 
0071   /**
0072    * Hadronic current. This method is purely virtual and must be implemented in
0073    * all classes inheriting from this one.
0074    * @param resonance If specified only include terms with this particle
0075    * @param flavour Information on the required flavours of the quarks
0076    * @param imode The mode
0077    * @param ichan The phase-space channel the current is needed for.
0078    * @param scale The invariant mass of the particles in the current.
0079    * @param outgoing The particles produced in the decay
0080    * @param momenta  The momenta of the particles produced in the decay
0081    * @param meopt Option for the calculation of the matrix element
0082    * @return The current. 
0083    */
0084   virtual vector<LorentzPolarizationVectorE> 
0085   current(tcPDPtr resonance,
0086       FlavourInfo flavour,
0087       const int imode, const int ichan,Energy & scale,
0088       const tPDVector & outgoing,
0089       const vector<Lorentz5Momentum> & momenta,
0090       DecayIntegrator::MEOption meopt) const;
0091 
0092   /**
0093    *   Construct the SpinInfo for the decay products
0094    */
0095   void constructSpinInfo(ParticleVector decay) const;
0096 
0097   /**
0098    * Accept the decay. Checks that this is one of the allowed modes.
0099    * @param id The id's of the particles in the current.
0100    * @return Can this current have the external particles specified.
0101    */
0102   virtual bool accept(vector<int> id);
0103 
0104   /**
0105    * Returns the decay mode number for a given set of particles in the current. 
0106    * @param id The id's of the particles in the current.
0107    * @return The number of the mode
0108    */
0109   virtual unsigned int decayMode(vector<int> id);
0110 
0111   /**
0112    * Output the setup information for the particle database
0113    * @param os The stream to output the information to
0114    * @param header Whether or not to output the information for MySQL
0115    * @param create Whether or not to add a statement creating the object
0116    */
0117   virtual void dataBaseOutput(ofstream & os,bool header,bool create) const;
0118 
0119 public:
0120 
0121   /** @name Functions used by the persistent I/O system. */
0122   //@{
0123   /**
0124    * Function used to write out object persistently.
0125    * @param os the persistent output stream written to.
0126    */
0127   void persistentOutput(PersistentOStream & os) const;
0128 
0129   /**
0130    * Function used to read in object persistently.
0131    * @param is the persistent input stream read from.
0132    * @param version the version number of the object when written.
0133    */
0134   void persistentInput(PersistentIStream & is, int version);
0135   //@}
0136 
0137   /**
0138    * The standard Init function used to initialize the interfaces.
0139    * Called exactly once for each class by the class description system
0140    * before the main function starts or
0141    * when this class is dynamically loaded.
0142    */
0143   static void Init();
0144 
0145 protected:
0146 
0147   /** @name Clone Methods. */
0148   //@{
0149   /**
0150    * Make a simple clone of this object.
0151    * @return a pointer to the new object.
0152    */
0153   virtual IBPtr clone() const;
0154 
0155   /** Make a clone of this object, possibly modifying the cloned object
0156    * to make it sane.
0157    * @return a pointer to the new object.
0158    */
0159   virtual IBPtr fullclone() const;
0160   //@}
0161 
0162 protected:
0163 
0164   /** @name Standard Interfaced functions. */
0165   //@{
0166   /**
0167    * Initialize this object after the setup phase before saving an
0168    * EventGenerator to disk.
0169    * @throws InitException if object could not be initialized properly.
0170    */
0171   virtual void doinit();
0172   //@}
0173 
0174 private:
0175 
0176   /**
0177    * The assignment operator is private and must never be called.
0178    * In fact, it should not even be implemented.
0179    */
0180   WeakBaryonCurrent & operator=(const WeakBaryonCurrent &) = delete;
0181 
0182 private:
0183   
0184   /**
0185    * The baryon form factor
0186    */
0187   BaryonFormFactorPtr formFactor_;
0188 
0189 private:
0190   
0191   /**
0192    *  Spinors for the decay products
0193    */
0194   mutable vector<Helicity::LorentzSpinor   <SqrtEnergy> > wave_;
0195 
0196   /**
0197    *  barred spinors for the decay products
0198    */
0199   mutable vector<Helicity::LorentzSpinorBar<SqrtEnergy> > wavebar_;
0200   
0201 };
0202 
0203 }
0204 
0205 #endif /* Herwig_WeakBaryonCurrent_H */