Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // ResonantProcessConstructor.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_ResonantProcessConstructor_H
0010 #define HERWIG_ResonantProcessConstructor_H
0011 //
0012 // This is the declaration of the ResonantProcessConstructor class.
0013 //
0014 
0015 #include "HardProcessConstructor.h"
0016 #include "ThePEG/Utilities/Exception.h"
0017 #include "ResonantProcessConstructor.fh"
0018 
0019 namespace Herwig {
0020 using namespace ThePEG;
0021 
0022 /**
0023  * This class is designed to construct the diagrams for resonant processes
0024  * using a provdided set of particles as interemdiates.
0025  *
0026  * @see \ref ResonantProcessConstructorInterfaces "The interfaces"
0027  * defined for ResonantProcessConstructor.
0028  * @see HardProcessConstructor
0029  */
0030 class ResonantProcessConstructor: public HardProcessConstructor {
0031 
0032 public:
0033 
0034   /** Set of ParticleData pointers */
0035   typedef set<tPDPtr> tPDSet;
0036 
0037   /** Nested vector of doubles. */
0038   typedef vector<vector<double> > CFMatrix;
0039 
0040   /** Enumeration for the direction */
0041   enum direction {incoming, outgoing};
0042 
0043 public:
0044 
0045   /**
0046    * The default constructor.
0047    */
0048   ResonantProcessConstructor() :
0049     processOption_(0), scaleChoice_(1), scaleFactor_(1.),
0050     incoming_(0), intermediates_(0),
0051     outgoing_(0), diagrams_(0)
0052   {}
0053 
0054 public:
0055 
0056   /** @name Functions used by the persistent I/O system. */
0057   //@{
0058   /**
0059    * Function used to write out object persistently.
0060    * @param os the persistent output stream written to.
0061    */
0062   void persistentOutput(PersistentOStream & os) const;
0063 
0064   /**
0065    * Function used to read in object persistently.
0066    * @param is the persistent input stream read from.
0067    * @param version the version number of the object when written.
0068    */
0069   void persistentInput(PersistentIStream & is, int version);
0070   //@}
0071 
0072   /**
0073    * The standard Init function used to initialize the interfaces.
0074    * Called exactly once for each class by the class description system
0075    * before the main function starts or
0076    * when this class is dynamically loaded.
0077    */
0078   static void Init();
0079 
0080   /**
0081    * The main function to create the resonant diagrams
0082    */
0083   void constructDiagrams() ;
0084 
0085 protected:
0086 
0087   /** @name Clone Methods. */
0088   //@{
0089   /**
0090    * Make a simple clone of this object.
0091    * @return a pointer to the new object.
0092    */
0093   virtual IBPtr clone() const;
0094 
0095   /** Make a clone of this object, possibly modifying the cloned object
0096    * to make it sane.
0097    * @return a pointer to the new object.
0098    */
0099   virtual IBPtr fullclone() const;
0100   //@}
0101 
0102 protected:
0103 
0104   /** @name Standard HardProcessConstructor functions. */
0105   //@{
0106   /**
0107    * Initialize this object after the setup phase before saving an
0108    * EventGenerator to disk.
0109    * @throws InitException if object could not be initialized properly.
0110    */
0111   virtual void doinit();
0112   //@}
0113 
0114 private:
0115 
0116   /**
0117    * Utility function to help second vertex
0118    */
0119   void constructVertex2(IDPair in, VertexBasePtr vertex, 
0120             PDPtr partc);
0121   
0122   /**
0123    * Function to create the appropriate diagrams
0124    */
0125   void makeResonantDiagram(IDPair in, PDPtr offshell, long outa, 
0126                long outb, VBPair vertices);
0127   
0128   /**
0129    * Given a vertex and 2 particle id's find the possible states
0130    * that can be the 3rd external particle
0131    * @param vertex Pointer to the vertex
0132    * @param part1 id of first particle
0133    * @param d1 direction of particle one
0134    * @param part2 id of other particle
0135    * @param d2 direction of particle two
0136    * @param d3 required direction of 3rd state (default = outgoing)
0137    * @return container of third particles
0138    */
0139   tPDSet search(VertexBasePtr vertex, long part1, direction d1, 
0140            long part2, direction d2, direction d3 = outgoing);
0141 
0142   /** 
0143    * Return the pair of outgoing particles from the list
0144    */
0145   IDPair find(long part, const PDVector & out) const;
0146 
0147   /**
0148    * Create a matrix element from the given resonant process diagram
0149    */
0150   void createMatrixElement(const HPDiagram & diag) const;
0151 
0152   /**
0153    * Create the correct classname and objectname for a matrix element 
0154    */
0155   string MEClassname(const tcPDVector & extpart, tcPDPtr inter,
0156              string & objname) const;
0157 
0158 private:
0159 
0160   /**
0161    * The assignment operator is private and must never be called.
0162    * In fact, it should not even be implemented.
0163    */
0164   ResonantProcessConstructor & operator=(const ResonantProcessConstructor &) = delete;
0165 
0166 private:
0167 
0168   /**
0169    * Which types of processes to generate
0170    */
0171   unsigned int processOption_;
0172 
0173   /**
0174    *  Scale choice
0175    */
0176   unsigned int scaleChoice_;
0177 
0178   /**
0179    *  Prefactor for the scale calculation
0180    */
0181   double scaleFactor_;
0182   
0183   /**
0184    * Storage for the required intermediate particles
0185    */
0186   vector<PDPtr> incoming_;
0187 
0188   /**
0189    * Storage for the required intermediate particles
0190    */
0191   vector<PDPtr> intermediates_;
0192 
0193   /**
0194    * Storage for the required intermediate particles
0195    */
0196   vector<PDPtr> outgoing_; 
0197 
0198   /**
0199    * Storage for the diagrams
0200    */
0201   vector<HPDiagram> diagrams_;
0202 
0203 };
0204 
0205   /** Exception class indicating setup problem. */
0206   class RPConstructorError : public Exception {};
0207 
0208 }
0209 
0210 
0211 #endif /* HERWIG_ResonantProcessConstructor_H */