Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 #ifndef Herwig_ReweightEW_H
0003 #define Herwig_ReweightEW_H
0004 //
0005 // This is the declaration of the ReweightEW class.
0006 //
0007 
0008 #include "ThePEG/MatrixElement/ReweightBase.h"
0009 #include <array>
0010 
0011 namespace Herwig {
0012 
0013 using namespace ThePEG;
0014 
0015 /**
0016  * Here is the documentation of the ReweightEW class.
0017  *
0018  * @see \ref ReweightEWInterfaces "The interfaces"
0019  * defined for ReweightEW.
0020  */
0021 class ReweightEW: public ReweightBase {
0022 
0023 public:
0024 
0025   /** @name Standard constructors and destructors. */
0026   //@{
0027   /**
0028    * The default constructor.
0029    */
0030   ReweightEW();
0031 
0032   /**
0033    * The destructor.
0034    */
0035   virtual ~ReweightEW();
0036   //@}
0037 
0038 public:
0039 
0040   /**
0041    * Return the weight for the kinematical configuation provided by
0042    * the assigned XComb object (in the LastXCombInfo base class).
0043    */
0044   virtual double weight() const;
0045 
0046   /**
0047    * Return values of the last evaluation (double/doubles in GeV2)
0048    */
0049   double lastS() const {return thelasts;} 
0050   double lastT() const {return thelastt;} 
0051   double lastK() const {return thelastk;} 
0052 
0053   void setSTK(double s, double t, double K); 
0054 
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 protected:
0081 
0082   /** @name Clone Methods. */
0083   //@{
0084   /**
0085    * Make a simple clone of this object.
0086    * @return a pointer to the new object.
0087    */
0088   virtual IBPtr clone() const;
0089 
0090   /** Make a clone of this object, possibly modifying the cloned object
0091    * to make it sane.
0092    * @return a pointer to the new object.
0093    */
0094   virtual IBPtr fullclone() const;
0095   //@}
0096 
0097 
0098 private:
0099 
0100   /**
0101    * The last s
0102    */
0103   mutable double thelasts;
0104 
0105   /**
0106    * The last t
0107    */
0108   mutable double thelastt;
0109 
0110   /**
0111    * The last K-factor
0112    */
0113   mutable double thelastk;
0114 
0115   /**
0116    * The table of K factors to be read from file 
0117    */
0118   std::array<std::array<double,6>,40001> tab;
0119 
0120   /**
0121    *  EW K factor filename
0122    */
0123   string filename;
0124 
0125 public:
0126   /**
0127    * Computation of K factors from table (s and t in GeV)
0128    */
0129   double EWKFac(unsigned int f, double s, double t) const;
0130 
0131 private:
0132   /**
0133    * initialize tables
0134    */  
0135   void inittable();
0136 
0137 private:
0138 
0139   /**
0140    * Initialize this object after the setup phase before saving an
0141    * EventGenerator to disk.
0142    * @throws InitException if object could not be initialized properly.
0143    */
0144   virtual void doinit();
0145 
0146   /**
0147    * Initialize this object. Called in the run phase just before
0148    * a run begins.
0149    */
0150   virtual void doinitrun();
0151 
0152 private:
0153 
0154   /**
0155    * The assignment operator is private and must never be called.
0156    * In fact, it should not even be implemented.
0157    */
0158   ReweightEW & operator=(const ReweightEW &) = delete;
0159 
0160 };
0161 
0162 }
0163 
0164 #endif /* Herwig_ReweightEW_H */