Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // VBFNLOPhasespace.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_VBFNLOPhasespace_H
0010 #define Herwig_VBFNLOPhasespace_H
0011 //
0012 // This is the declaration of the VBFNLOPhasespace class.
0013 //
0014 
0015 #include "Herwig/MatrixElement/Matchbox/Phasespace/MatchboxPhasespace.h"
0016 
0017 namespace Herwig {
0018 
0019 using namespace ThePEG;
0020 
0021 /**
0022  * \ingroup Matchbox
0023  * \author Michael Rauch
0024  *
0025  * \brief VBFNLOPhasespace is an interface to the internal phasespace generator
0026  * of VBFNLO. It uses the information passed via the BLHA interface to obtain
0027  * information on the required channels.
0028  *
0029  * @see \ref VBFNLOPhasespaceInterfaces "The interfaces"
0030  * defined for VBFNLOPhasespace.
0031  */
0032 class VBFNLOPhasespace: public MatchboxPhasespace {
0033 
0034 public:
0035 
0036   /** @name Standard constructors and destructors. */
0037   //@{
0038   /**
0039    * The default constructor.
0040    */
0041   VBFNLOPhasespace();
0042 
0043   /**
0044    * The destructor.
0045    */
0046   virtual ~VBFNLOPhasespace();
0047   //@}
0048 
0049 public:
0050 
0051   /**
0052    * Prepare a phase space generator for the given xcomb object.
0053    */
0054   virtual void setXComb(tStdXCombPtr);
0055 
0056   /**
0057    * Generate a phase space point and return its weight.
0058    */
0059   virtual double generateTwoToNKinematics(const double*,
0060                       vector<Lorentz5Momentum>& momenta);
0061 
0062   /**
0063    * Generate a phase space point and return its weight.
0064    */
0065   virtual double generateKinematics(const double* random,
0066                     vector<Lorentz5Momentum>& momenta) {
0067     return generateTwoToNKinematics(random,momenta);
0068   }
0069 
0070   /**
0071    * Return the number of random numbers required to produce a given
0072    * multiplicity final state.
0073    */
0074   virtual int nDimPhasespace(int nFinal) const;
0075 
0076   /**
0077    * Return true, if this phasespace generator will generate incoming
0078    * partons itself.
0079    */
0080   virtual bool haveX1X2() const { return true; }
0081 
0082   /**
0083    * Return true, if this phase space generator expects
0084    * the incoming partons in their center-of-mass system
0085    */
0086   virtual bool wantCMS() const { return false; }
0087 
0088   /**
0089    * Return true, if this phase space generator is invertible
0090    */
0091   virtual bool isInvertible() const { return false; }
0092 
0093 
0094 public:
0095 
0096   /** @name Functions used by the persistent I/O system. */
0097   //@{
0098   /**
0099    * Function used to write out object persistently.
0100    * @param os the persistent output stream written to.
0101    */
0102   void persistentOutput(PersistentOStream & os) const;
0103 
0104   /**
0105    * Function used to read in object persistently.
0106    * @param is the persistent input stream read from.
0107    * @param version the version number of the object when written.
0108    */
0109   void persistentInput(PersistentIStream & is, int version);
0110   //@}
0111 
0112   /**
0113    * The standard Init function used to initialize the interfaces.
0114    * Called exactly once for each class by the class description system
0115    * before the main function starts or
0116    * when this class is dynamically loaded.
0117    */
0118   static void Init();
0119 
0120 protected:
0121 
0122   /** @name Clone Methods. */
0123   //@{
0124   /**
0125    * Make a simple clone of this object.
0126    * @return a pointer to the new object.
0127    */
0128   virtual IBPtr clone() const;
0129 
0130   /** Make a clone of this object, possibly modifying the cloned object
0131    * to make it sane.
0132    * @return a pointer to the new object.
0133    */
0134   virtual IBPtr fullclone() const;
0135   //@}
0136 
0137 
0138 // If needed, insert declarations of virtual function defined in the
0139 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
0140 
0141 
0142 protected:
0143 
0144   /** @name Standard Interfaced functions. */
0145   //@{
0146   /**
0147    * Initialize this object after the setup phase before saving an
0148    * EventGenerator to disk.
0149    * @throws InitException if object could not be initialized properly.
0150    */
0151   virtual void doinit();
0152 
0153   /**
0154    * Initialize this object. Called in the run phase just before
0155    * a run begins.
0156    */
0157   virtual void doinitrun();
0158   //@}
0159 
0160 
0161 private:
0162 
0163   /**
0164    * Last hadronic centre-of-mass energy, to update VBFNLO value only
0165    * when this has changed.
0166    */
0167   Energy lastSqrtS;
0168 
0169 private:
0170 
0171   /**
0172    * The assignment operator is private and must never be called.
0173    * In fact, it should not even be implemented.
0174    */
0175   VBFNLOPhasespace & operator=(const VBFNLOPhasespace &) = delete;
0176 
0177   /**
0178    * Whether or not we need to reshuffle.
0179    */
0180   bool needToReshuffle;
0181 
0182 protected:
0183 
0184   /**
0185    * Location of the VBFNLO library
0186    */
0187   string VBFNLOlib_;
0188 
0189   /**
0190    *  load the VBFNLO library
0191    */
0192   void loadVBFNLO();
0193 
0194   /**
0195    * The function object defining the equation
0196    * to be solved.
0197    */
0198   struct ReshuffleEquation {
0199 
0200     typedef double ArgType;
0201     typedef Energy ValType;
0202 
0203     static double aUnit() { return 1.; }
0204     static Energy vUnit() { return 1.*GeV; }
0205 
0206     Energy operator() (double xi) const;
0207 
0208     Energy w;
0209     cPDVector::const_iterator dataBegin;
0210     cPDVector::const_iterator dataEnd;
0211     vector<Lorentz5Momentum>::const_iterator momentaBegin;
0212     vector<Lorentz5Momentum>::const_iterator momentaEnd;
0213 
0214     ReshuffleEquation(Energy q,
0215               cPDVector::const_iterator dBegin,
0216               cPDVector::const_iterator dEnd,
0217               vector<Lorentz5Momentum>::const_iterator mBegin,
0218               vector<Lorentz5Momentum>::const_iterator mEnd)
0219       : w(q),
0220     dataBegin(dBegin), dataEnd(dEnd),
0221     momentaBegin(mBegin),
0222     momentaEnd(mEnd) {}
0223 
0224   };
0225 
0226 };
0227 
0228 }
0229 
0230 #endif /* Herwig_VBFNLOPhasespace_H */