Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // MatchboxReference.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_MatchboxReference_H
0010 #define Herwig_MatchboxReference_H
0011 //
0012 // This is the declaration of the MatchboxReference 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 Simon Platzer
0024  *
0025  * \brief MatchboxReference implements reference sample phase space generation.
0026  *
0027  */
0028 class MatchboxReference: public MatchboxPhasespace {
0029 
0030 public:
0031 
0032   /**
0033    * Generate a phase space point and return its weight.
0034    */
0035   virtual double generateTwoToNKinematics(const double*,
0036                       vector<Lorentz5Momentum>& momenta);
0037 
0038   /**
0039    * Return the number of random numbers required to produce a given
0040    * multiplicity final state.
0041    */
0042   virtual int nDimPhasespace(int nFinal) const {
0043     if ( nFinal == 1 )
0044       return 1;
0045     return 4*nFinal + 2;
0046   }
0047 
0048   /**
0049    * Return true, if this phase space generator will generate incoming
0050    * partons itself.
0051    */
0052   virtual bool haveX1X2() const { return true; }
0053 
0054   /**
0055    * Return true, if this phase space generator expects
0056    * the incoming partons in their center-of-mass system
0057    */
0058   virtual bool wantCMS() const { return false; }
0059 
0060 public:
0061 
0062   /** @name Functions used by the persistent I/O system. */
0063   //@{
0064   /**
0065    * Function used to write out object persistently.
0066    * @param os the persistent output stream written to.
0067    */
0068   void persistentOutput(PersistentOStream & os) const;
0069 
0070   /**
0071    * Function used to read in object persistently.
0072    * @param is the persistent input stream read from.
0073    * @param version the version number of the object when written.
0074    */
0075   void persistentInput(PersistentIStream & is, int version);
0076   //@}
0077 
0078   /**
0079    * The standard Init function used to initialize the interfaces.
0080    * Called exactly once for each class by the class description system
0081    * before the main function starts or
0082    * when this class is dynamically loaded.
0083    */
0084   static void Init();
0085 
0086 protected:
0087 
0088   /** @name Clone Methods. */
0089   //@{
0090   /**
0091    * Make a simple clone of this object.
0092    * @return a pointer to the new object.
0093    */
0094   virtual IBPtr clone() const;
0095 
0096   /** Make a clone of this object, possibly modifying the cloned object
0097    * to make it sane.
0098    * @return a pointer to the new object.
0099    */
0100   virtual IBPtr fullclone() const;
0101   //@}
0102 
0103 
0104 // If needed, insert declarations of virtual function defined in the
0105 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
0106 
0107 
0108 private:
0109 
0110   /**
0111    * The assignment operator is private and must never be called.
0112    * In fact, it should not even be implemented.
0113    */
0114   MatchboxReference & operator=(const MatchboxReference &) = delete;
0115 
0116   /**
0117    * Stream to read the reference samples.
0118    */
0119   map<cPDVector,ifstream*> referenceSamples;
0120 
0121 };
0122 
0123 }
0124 
0125 #endif /* Herwig_MatchboxReference_H */