Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 #ifndef Herwig_DipoleVertexRecord_H
0003 #define Herwig_DipoleVertexRecord_H
0004 //
0005 // This is the declaration of the DipoleVertexRecord class.
0006 //
0007 
0008 #include "ThePEG/Config/ThePEG.h"
0009 #include "Herwig/Shower/Dipole/Base/DipoleSplittingInfo.h"
0010 #include "Herwig/Shower/Dipole/Base/Dipole.h"
0011 #include "ThePEG/EventRecord/RhoDMatrix.h"
0012 #include "DipoleShowerParticle.h"
0013 
0014 namespace Herwig {
0015 
0016   using namespace ThePEG;
0017 
0018   /**
0019    * Here is the documentation of the DipoleVertexRecord class.
0020    */
0021   class DipoleVertexRecord: public Base {
0022 
0023   public:
0024 
0025     /** @name Standard constructors and destructors. */
0026     //@{
0027     /**
0028      * The default constructor.
0029      */
0030     DipoleVertexRecord() {}
0031 
0032     /**
0033      * The destructor.
0034      */
0035     virtual ~DipoleVertexRecord() { clear(); }
0036     //@}
0037 
0038   public:
0039 
0040     /**
0041      * Prepare the emitter and spectator
0042      * for the spin correlations computations.
0043      **/
0044     void prepareSplitting( const DipoleSplittingInfo& dInfo, const Dipole& dip);
0045 
0046     /**
0047      * Correctly initialise the decay matrix 
0048      * to a delta matrix for an external particle.
0049      */
0050     void initDecayMatrix(PPtr& particle, Helicity::Direction dir);
0051 
0052     /**
0053      * Compute the spin density matrix for the given emitter.
0054      * This tracks the path between the given emitter and 
0055      * the previous emitter, calculating a rho/decay matrix
0056      * at each vertex as appropriate.
0057      */
0058     RhoDMatrix emitterDensityMatrix(PPtr emitter);
0059 
0060     /**
0061      * Generate the spin-correlated azimuthal angle for a splitting.
0062      */
0063     void generatePhi(DipoleSplittingInfo& dInfo, Dipole& dip);
0064 
0065 
0066     /**
0067      * Identify the type of particle and use the appropriate function
0068      * to set up the spin info.
0069      * Required for e.g. MPI
0070      */
0071     void createSpinInfo(PPtr& part,
0072                         const Helicity::Direction& dir);
0073     
0074     /**
0075      * Create and set up fermion spin info.
0076      * Required for e.g. MPI
0077      */
0078     void createFermionSpinInfo(PPtr& part,
0079                                const Helicity::Direction& dir);
0080       
0081     /**
0082      * Create and set up vector spin info. 
0083      * Required for e.g. MPI
0084      */
0085     void createVectorSpinInfo(PPtr& part,
0086                               const Helicity::Direction& dir);
0087     
0088     /**
0089      * Update the vertex record following a splitting.
0090      */
0091     void update(const DipoleSplittingInfo& dInfo);
0092 
0093     /**
0094      * For spectators. Set new particle spin info the that of the 
0095      * old particle. Update the spin info to include any momentum changes.
0096      */
0097     void updateSpinInfo( PPtr& oldPart,
0098                          PPtr& newPart );
0099     
0100     /**
0101      * Set the stopUpdate flag in the spin info of a particle
0102      * incoming to the current decay.
0103      */
0104     void prepareParticleDecay( const PPtr& parent );
0105 
0106     /**
0107      * Update the spin info of the incoming to the decay
0108      * following showering of the decay.
0109      */
0110     void updateParticleDecay();
0111 
0112     /**
0113      * SW 06/02/2019: Required for NearestNeighbourDipoleAnalysis tests.
0114      * Access the emitter info record.
0115      */
0116     //map<PPtr,DipoleSplittingInfo> emitterInfoRecord() const {
0117     //return theEmitterInfoRecord;
0118     //}    
0119     
0120     /**
0121      * SW 06/02/2019: Required for NearestNeighbourDipoleAnalysis tests.
0122      * Add a splitting to the emitter info record.
0123      */
0124     // void addToRecord(const DipoleSplittingInfo& dInfo) {
0125     //   assert(dInfo.emitter());
0126     //   theEmitterInfoRecord[dInfo.emitter()] = dInfo;
0127     // }
0128     
0129     /**
0130      * Clear the vertex record: Give up ownership
0131      * on any object involved in the evolution.
0132      */
0133     virtual void clear();
0134      
0135     /**
0136      * The standard Init function used to initialize the interfaces.
0137      * Called exactly once for each class by the class description system
0138      * before the main function starts or
0139      * when this class is dynamically loaded.
0140      */
0141     static void Init();
0142     
0143   private:
0144 
0145     /**
0146      * The current emitter.
0147      */
0148     DipoleShowerParticle theCurrentEmitter;
0149 
0150     /**
0151      * SW 06/02/2019: Required for NearestNeighbourDipoleAnalysis tests.
0152      * Record of the splittings as 
0153      * required for the testing analysis.
0154      */
0155     //map<PPtr, DipoleSplittingInfo> theEmitterInfoRecord;
0156 
0157     /**
0158      * The spin info of a particle incoming to the decay
0159      * under consideration.
0160      */
0161     tcSpinPtr theDecayParentSpinInfo;
0162     
0163     /**
0164      * The assignment operator is private and must never be called.
0165      * In fact, it should not even be implemented.
0166      */
0167     DipoleVertexRecord & operator=(const DipoleVertexRecord &) = delete;
0168 
0169   };
0170 
0171 }
0172 
0173 #include "ThePEG/Utilities/ClassTraits.h"
0174 
0175 namespace ThePEG {
0176 
0177   /** @cond TRAITSPECIALIZATIONS */
0178 
0179   /** This template specialization informs ThePEG about the
0180    *  base classes of DipoleVertexRecord. */
0181   template <>
0182   struct BaseClassTrait<Herwig::DipoleVertexRecord,1> {
0183     /** Typedef of the first base class of DipoleVertexRecord. */
0184     typedef Base NthBase;
0185   };
0186 
0187   /** This template specialization informs ThePEG about the name of
0188    *  the DipoleVertexRecord class and the shared object where it is defined. */
0189   template <>
0190   struct ClassTraits<Herwig::DipoleVertexRecord>
0191     : public ClassTraitsBase<Herwig::DipoleVertexRecord> {
0192     /** Return a platform-independent class name */
0193     static string className() { return "Herwig::DipoleVertexRecord"; }
0194     /**
0195      * The name of a file containing the dynamic library where the class
0196      * DipoleVertexRecord is implemented. It may also include several, space-separated,
0197      * libraries if the class DipoleVertexRecord depends on other classes (base classes
0198      * excepted). In this case the listed libraries will be dynamically
0199      * linked in the order they are specified.
0200      */
0201     static string library() { return "HwDipoleShower.so"; }
0202   };
0203 
0204   /** @endcond */
0205 
0206 }
0207 #endif /* Herwig_DipoleVertexRecord_H */