Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // DipoleChain.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_DipoleChain_H
0010 #define HERWIG_DipoleChain_H
0011 //
0012 // This is the declaration of the DipoleChain class.
0013 //
0014 
0015 #include "Dipole.h"
0016 
0017 namespace Herwig {
0018 
0019 using namespace ThePEG;
0020 
0021 /**
0022  * \ingroup DipoleShower
0023  * \author Simon Platzer
0024  *
0025  * \brief The DipoleChain class is used by the dipole shower to
0026  * represent a chain of dipoles.
0027  *
0028  */
0029 class DipoleChain {
0030 
0031 public:
0032 
0033   /**
0034    * Default constructor
0035    */
0036   DipoleChain();
0037 
0038   /**
0039    * Return true, if this chain is circular.
0040    */
0041   bool circular () const;
0042 
0043   /*
0044    * Return true, if the dipole referred to
0045    * has a left neighbour
0046    */
0047   bool hasLeftNeighbour(list<Dipole>::const_iterator dc) const;
0048 
0049   /*
0050    * Return a reference to the left neighbour,
0051    * if existing
0052    */
0053   Dipole& leftNeighbour(list<Dipole>::iterator dc);
0054 
0055   /*
0056    * Return a const reference to the left neighbour,
0057    * if existing
0058    */
0059   const Dipole& leftNeighbour(list<Dipole>::const_iterator dc) const;
0060 
0061   /**
0062    * Return an iterator to the left neighbour
0063    */
0064   list<Dipole>::iterator leftNeighbourIterator(list<Dipole>::iterator dc);
0065 
0066   /*
0067    * Return true, if the dipole referred to
0068    * has a right neighbour
0069    */
0070   bool hasRightNeighbour (list<Dipole>::const_iterator dc) const;
0071 
0072   /*
0073    * Return a reference to the right neighbour,
0074    * if existing
0075    */
0076   Dipole& rightNeighbour (list<Dipole>::iterator dc);
0077 
0078   /*
0079    * Return a const reference to the right neighbour,
0080    * if existing
0081    */
0082   const Dipole& rightNeighbour (list<Dipole>::const_iterator dc) const;
0083 
0084   /**
0085    * Return an iterator to the right neighbour
0086    */
0087   list<Dipole>::iterator rightNeighbourIterator(list<Dipole>::iterator dc);
0088 
0089 public:
0090 
0091   /**
0092    * Access the dipole list
0093    */
0094   list<Dipole>& dipoles() { return theDipoles; }
0095 
0096   /**
0097    * Return the dipole list
0098    */
0099   const list<Dipole>& dipoles() const { return theDipoles; }
0100 
0101   /**
0102    * Check for gg single dipole
0103    */
0104   void check();
0105 
0106 public:
0107 
0108   /*
0109    * Insert the given splitting; if this contains a chain-breakup emission and
0110    * the chain is circular, reshuffle the chain to make it non-circular; if it is
0111    * already non-circular return the iterator starting the new chain. If no
0112    * splitting is needed return the end iterator of the dipole list.
0113    * Set the iterators pointing to the children dipoles.
0114    */
0115   list<Dipole>::iterator insertSplitting(list<Dipole>::iterator emittingDipole,
0116                      pair<Dipole,Dipole> children,
0117                      pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators);
0118 
0119   /**
0120    * Indicate a change in the given dipole.
0121    */
0122   void updateDipole(list<Dipole>::iterator dip);
0123 
0124 public:
0125 
0126   /**
0127    * Put information to ostream
0128    */
0129   void print(ostream&) const;
0130 
0131 private:
0132 
0133   /**
0134    * The dipoles contained in this chain
0135    */
0136   list<Dipole> theDipoles;
0137 
0138   /**
0139    * Switch on special treatment for
0140    * gg single dipole
0141    */
0142   bool ggSingleDipole;
0143 
0144 };
0145 
0146 inline ostream& operator << (ostream& os, const DipoleChain& di) {
0147   di.print(os);
0148   return os;
0149 }
0150 
0151 }
0152 
0153 #endif /* HERWIG_DipoleChain_H */