Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // VectorCurrentDecayer.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_VectorCurrentDecayer_H
0010 #define HERWIG_VectorCurrentDecayer_H
0011 //
0012 // This is the declaration of the VectorCurrentDecayer class.
0013 //
0014 
0015 #include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
0016 #include "Herwig/Decay/DecayIntegrator.h"
0017 #include "Herwig/Decay/WeakCurrents/WeakCurrent.h"
0018 #include "Herwig/Decay/PhaseSpaceMode.h"
0019 #include "VectorCurrentDecayer.fh"
0020 
0021 namespace Herwig {
0022 using namespace ThePEG;
0023 using ThePEG::Helicity::VectorWaveFunction;
0024 
0025 /**
0026  * Here is the documentation of the VectorCurrentDecayer class.
0027  *
0028  * @see \ref VectorCurrentDecayerInterfaces "The interfaces"
0029  * defined for VectorCurrentDecayer.
0030  */
0031 class VectorCurrentDecayer: public DecayIntegrator {
0032 
0033 public:
0034 
0035   /**
0036    * The default constructor.
0037    */
0038   VectorCurrentDecayer() : cSMmed_({0.,0.,0.}), wgtmax_(0.)
0039   {}
0040 
0041   /** @name Virtual functions required by the Decayer class. */
0042   //@{
0043   /**
0044    * Which of the possible decays is required
0045    * @param cc Is this mode the charge conjugate
0046    * @param parent The decaying particle
0047    * @param children The decay products
0048    */
0049   virtual int modeNumber(bool & cc, tcPDPtr parent,const tPDVector & children) const;
0050   //@}
0051   
0052   /** @name Virtual functions required by the Decayer class. */
0053   //@{
0054 
0055   /**
0056    * Return the matrix element squared for a given mode and phase-space channel.
0057    * @param ichan The channel we are calculating the matrix element for. 
0058    * @param part The decaying Particle.
0059    * @param outgoing The particles produced in the decay
0060    * @param momenta  The momenta of the particles produced in the decay
0061    * @param meopt Option for the calculation of the matrix element
0062    * @return The matrix element squared for the phase-space configuration.
0063    */
0064   double me2(const int ichan,const Particle & part,
0065          const tPDVector & outgoing,
0066          const vector<Lorentz5Momentum> & momenta,
0067          MEOption meopt) const;
0068 
0069   /**
0070    *   Construct the SpinInfos for the particles produced in the decay
0071    */
0072   virtual void constructSpinInfo(const Particle & part,
0073                  ParticleVector outgoing) const;
0074   
0075   /**
0076    * Function to return partial Width
0077    * @param inpart Pointer to incoming particle data object
0078    * @param out The outgoing particles from the current
0079    */
0080   virtual Energy partialWidth(tPDPtr inpart, vector<tPDPtr> out);
0081   //@}
0082 
0083   /**
0084    *  set up the decay
0085    */
0086   void setDecayInfo(PDPtr in, const vector<tPDPtr> & outCurrent,
0087             WeakCurrentPtr current);
0088 
0089 public:
0090 
0091   /** @name Functions used by the persistent I/O system. */
0092   //@{
0093   /**
0094    * Function used to write out object persistently.
0095    * @param os the persistent output stream written to.
0096    */
0097   void persistentOutput(PersistentOStream & os) const;
0098 
0099   /**
0100    * Function used to read in object persistently.
0101    * @param is the persistent input stream read from.
0102    * @param version the version number of the object when written.
0103    */
0104   void persistentInput(PersistentIStream & is, int version);
0105   //@}
0106 
0107   /**
0108    * The standard Init function used to initialize the interfaces.
0109    * Called exactly once for each class by the class description system
0110    * before the main function starts or
0111    * when this class is dynamically loaded.
0112    */
0113   static void Init();
0114 
0115 protected:
0116 
0117   /** @name Clone Methods. */
0118   //@{
0119   /**
0120    * Make a simple clone of this object.
0121    * @return a pointer to the new object.
0122    */
0123   virtual IBPtr clone() const;
0124 
0125   /** Make a clone of this object, possibly modifying the cloned object
0126    * to make it sane.
0127    * @return a pointer to the new object.
0128    */
0129   virtual IBPtr fullclone() const;
0130   //@}
0131 
0132 protected:
0133 
0134   /** @name Standard Interfaced functions. */
0135   //@{
0136   /**
0137    * Initialize this object after the setup phase before saving an
0138    * EventGenerator to disk.
0139    * @throws InitException if object could not be initialized properly.
0140    */
0141   virtual void doinit();
0142 
0143   /**
0144    * Initialize this object. Called in the run phase just before
0145    * a run begins.
0146    */
0147   virtual void doinitrun();
0148   //@}
0149 
0150 protected:
0151 
0152   /**
0153    *  The number of the mode
0154    * @param cc Whether of not this is the charge conjugate of the defined mode
0155    * @param id The PDG codes of the particles
0156    */
0157   int modeNumber(bool & cc, vector<long> id) const;
0158 
0159   /**
0160    *  Access to the map between the number of the mode and the modes in
0161    *  the current
0162    */
0163   unsigned int mode() const { return mode_; }
0164 
0165   /**
0166    *  Access to the weak current
0167    */
0168   WeakCurrentPtr weakCurrent() const { return current_; }
0169 
0170 private:
0171 
0172   /**
0173    * The assignment operator is private and must never be called.
0174    * In fact, it should not even be implemented.
0175    */
0176   VectorCurrentDecayer & operator=(const VectorCurrentDecayer &) = delete;
0177 
0178 private:
0179   
0180   /**
0181    * Incoming particle
0182    **/
0183   PDPtr inpart_;
0184 
0185   /**
0186    *  Outgoing particles from the current
0187    */
0188   vector<tPDPtr> currentOut_;
0189   
0190   /**
0191    * DM coupling to the dark mediator
0192    */
0193   Complex cDMmed_;
0194 
0195   /**                                                                                                                                                       
0196    * SM couplings to the dark mediator
0197    */
0198   vector<Complex> cSMmed_;
0199 
0200   /**
0201    * Pointer to the current
0202    */
0203   WeakCurrentPtr current_;
0204 
0205   /**
0206    * mapping of the modes to the currents
0207    */
0208   unsigned int mode_;
0209 
0210   /**
0211    * location of the weights
0212    */
0213   int wgtloc_;
0214 
0215   /**
0216    * the maximum weight
0217    */
0218   double wgtmax_;
0219 
0220   /**
0221    *  The weights for the different channels
0222    */
0223   vector<double> weights_;
0224 
0225   /**
0226    *  Spin density matrix 
0227    */
0228   mutable RhoDMatrix rho_;
0229 
0230   /**
0231    *  Polarization vectors for the decaying particle
0232    */
0233   mutable vector<VectorWaveFunction> vectors_;
0234 };
0235 
0236 }
0237 
0238 #endif /* HERWIG_VectorCurrentDecayer_H */