Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Dipole.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_Dipole_H
0010 #define HERWIG_Dipole_H
0011 //
0012 // This is the declaration of the Dipole class.
0013 //
0014 
0015 #include "Herwig/Shower/Dipole/Kinematics/DipoleSplittingKinematics.h"
0016 #include "Herwig/Shower/Dipole/Base/DipoleSplittingInfo.h"
0017 
0018 namespace Herwig {
0019 
0020 using namespace ThePEG;
0021 
0022 /**
0023  * \ingroup DipoleShower
0024  * \author Simon Platzer, Stephen Webster, Johannes Bellm
0025  *
0026  * \brief The Dipole class is used by the dipole shower to
0027  * represent a dipole of two coloured partons.
0028  *
0029  */
0030 class Dipole {
0031 
0032 public:
0033 
0034   /**
0035    * The default constructor
0036    */
0037   Dipole();
0038   
0039   /**
0040    * The standard constructor
0041    */
0042   Dipole(const pair<PPtr,PPtr>& newParticles,
0043      const pair<PDF,PDF>& newPDFs,
0044      pair<double,double> newFractions,
0045      pair<Energy,Energy> newScales);
0046 
0047   /**
0048    * The standard constructor
0049    */
0050   Dipole(const pair<PPtr,PPtr>& newParticles,
0051      const pair<PDF,PDF>& newPDFs,
0052      pair<double,double> newFractions,
0053      const pair<bool,bool> decaying = pair<bool,bool>(false,false),
0054      const pair<bool,bool> offShell = pair<bool,bool>(false,false),
0055      pair<Energy,Energy> newScales = pair<Energy,Energy>(ZERO,ZERO));
0056 
0057 
0058 public:
0059 
0060   /**
0061    * Get the left particle.
0062    */
0063   tPPtr leftParticle() const { return theParticles.first; }
0064 
0065   /**
0066    * Get the right particle.
0067    */
0068   tPPtr rightParticle() const { return theParticles.second; }
0069 
0070   /**
0071    * Get the left PDF.
0072    */
0073   const PDF& leftPDF() const { return thePDFs.first; }
0074 
0075   /**
0076    * Get the right PDF.
0077    */
0078   const PDF& rightPDF() const { return thePDFs.second; }
0079 
0080   /**
0081    * Get the left fraction.
0082    */
0083   double leftFraction() const { return theFractions.first; }
0084 
0085   /**
0086    * Get the right fraction.
0087    */
0088   double rightFraction() const { return theFractions.second; }
0089 
0090   /**
0091    * Get the bool indicating
0092    * incoming decay for the left
0093    * particle, for debugging only.
0094    */
0095   bool leftDecaying() { return theDecaying.first; }
0096 
0097   /**
0098    * Get the bool indicating
0099    * incoming decay for the right
0100    * particle, for debugging only.
0101    */
0102   bool rightDecaying() { return theDecaying.second; }
0103 
0104   /**
0105    * Set the left particle.
0106    */
0107   void leftParticle(PPtr p) { theParticles.first = p; }
0108 
0109   /**
0110    * Set the right particle.
0111    */
0112   void rightParticle(PPtr p) { theParticles.second = p; }
0113 
0114   /**
0115    * Set the left PDF
0116    */
0117   void leftPDF(const PDF& p) { thePDFs.first = p; }
0118 
0119   /**
0120    * Set the right PDF
0121    */
0122   void rightPDF(const PDF& p) { thePDFs.second = p; }
0123 
0124   /**
0125    * Set the momentum fraction for the left particle.
0126    */
0127   void leftFraction(double x) { theFractions.first = x; }
0128 
0129   /**
0130    * Set the momentum fraction for the right particle.
0131    */
0132   void rightFraction(double x) { theFractions.second = x; }
0133 
0134   /**
0135    * Get the scale for the left particle.
0136    */
0137   Energy leftScale() const { return theScales.first; }
0138 
0139   /**
0140    * Set the scale for the left particle.
0141    */
0142   void leftScale(Energy s) { theScales.first = s; }
0143 
0144   /**
0145    * Get the scale for the right particle.
0146    */
0147   Energy rightScale() const { return theScales.second; }
0148 
0149   /**
0150    * Set the scale for the right particle.
0151    */
0152   void rightScale(Energy s) { theScales.second = s; }
0153 
0154   /**
0155    * Set the decayed particle indicator
0156    * for the left particle
0157    */
0158   void leftDecaying(bool decaying) { theDecaying.first = decaying; }
0159 
0160   /**
0161    * Set the decayed particle indicator
0162    * for the right particle
0163    */
0164   void rightDecaying(bool decaying) { theDecaying.second = decaying; }
0165 
0166   /**
0167    * Update information, if modified.
0168    */
0169   void update();
0170 
0171 public:
0172 
0173   /**
0174    * Return the dipole index for the selected
0175    * emitter-spectator assignment.
0176    */
0177   const DipoleIndex& index(pair<bool,bool> conf) const {
0178     return conf.first ? theIndices.first : theIndices.second;
0179   }
0180 
0181   /**
0182    * Set the first index
0183    */
0184   void setFirstIndex(DipoleIndex s){theIndices.first=s;}
0185 
0186   /**
0187    * Set the first index
0188    */
0189   void setSecondIndex(DipoleIndex s){theIndices.second=s;}
0190 
0191   /**
0192    * Return the emitter particle for the
0193    * selected configuration.
0194    */
0195   tPPtr emitter(pair<bool,bool> conf) const {
0196     return conf.first ? theParticles.first : theParticles.second;
0197   }
0198 
0199   /**
0200    * Return the spectator particle for the
0201    * selected configuration.
0202    */
0203   tPPtr spectator(pair<bool,bool> conf) const {
0204     return conf.first ? theParticles.second : theParticles.first;
0205   }
0206 
0207   /**
0208    * Return the scale associated to the emitter
0209    * for the selected configuration.
0210    */
0211   Energy emitterScale(pair<bool,bool> conf) const {
0212     return conf.first ? theScales.first : theScales.second;
0213   }
0214 
0215   /**
0216    * Set the scale associated to the emitter
0217    * for the selected configuration.
0218    */
0219   void emitterScale(pair<bool,bool> conf, Energy scale) {
0220     (conf.first ? theScales.first : theScales.second) = scale;
0221   }
0222 
0223   /**
0224    * Return the momentum fraction of the emitter
0225    * for the selected configuration.
0226    */
0227   double emitterX(pair<bool,bool> conf) const {
0228     return conf.first ? theFractions.first : theFractions.second;
0229   }
0230 
0231   /**
0232    * Return the PDF of the emitter
0233    * for the selected configuration.
0234    */
0235   const PDF& emitterPDF(pair<bool,bool> conf) const {
0236     return conf.first ? thePDFs.first : thePDFs.second;
0237   }
0238 
0239   /**
0240    * Return the momentum fraction of the spectator
0241    * for the selected configuration.
0242    */
0243   double spectatorX(pair<bool,bool> conf) const {
0244     return conf.first ? theFractions.second : theFractions.first;
0245   }
0246 
0247   /**
0248    * Return the PDF of the spectator
0249    * for the selected configuration.
0250    */
0251   const PDF& spectatorPDF(pair<bool,bool> conf) const {
0252     return conf.first ? thePDFs.second : thePDFs.first;
0253   }
0254 
0255 public:
0256 
0257   /**
0258    * Split this dipole according to the given splitting.
0259    * If colourSpectator is true, do not change the spectator.
0260    */
0261   pair<Dipole,Dipole> split (DipoleSplittingInfo& dsplit,
0262                  bool colourSpectator,
0263                  bool subleadingNc = false) const;
0264 
0265   /**
0266    * As split, but without touching the event record.
0267    * Needed to produce a phase space point as it would 
0268    * be after calling split.
0269    */
0270   void tmpsplit (DipoleSplittingInfo& dsplit,
0271                              bool colourSpectator) const;
0272 
0273 
0274   /**
0275    * Produce a new spectator according to the
0276    * given splitting.
0277    */
0278   void recoil (DipoleSplittingInfo& dsplit);
0279 
0280 public:
0281 
0282   /**
0283    * Put information to ostream
0284    */
0285   void print(ostream&) const;
0286 
0287 private:
0288 
0289   /**
0290    * The particles forming the dipole
0291    */
0292   pair<PPtr,PPtr> theParticles;
0293 
0294   /**
0295    * The PDF objects.
0296    */
0297   pair<PDF,PDF> thePDFs;
0298 
0299   /**
0300    * The momentum fractions associated
0301    * to the incoming particles
0302    */
0303   pair<double,double> theFractions;
0304 
0305   /**
0306    * The dipole indices, if the first or second particle
0307    * is considered as emitter.
0308    */
0309   pair<DipoleIndex,DipoleIndex> theIndices;
0310 
0311   /**
0312    * Indicates if either the first or the second parton 
0313    * is incoming to a decay.
0314    */
0315   pair<bool,bool> theDecaying;
0316 
0317   /** 
0318    * Indicates if either the first or second parton
0319    * can be off-shell (required for sampling).
0320    **/
0321   pair<bool,bool> theOffShell;
0322   
0323   /**
0324    * The scale associated to the first and second
0325    * particle, respectively.
0326    */
0327   pair<Energy,Energy> theScales;
0328 
0329 };
0330 
0331 inline ostream& operator << (ostream& os, const Dipole& di) {
0332   di.print(os);
0333   return os;
0334 }
0335 
0336 }
0337 
0338 #endif /* HERWIG_Dipole_H */