herwig is hosted by Hepforge, IPPP Durham
Herwig++  2.7.0
HwMEBase.h
00001 // -*- C++ -*-
00002 #ifndef HERWIG_HwMEBase_H
00003 #define HERWIG_HwMEBase_H
00004 //
00005 // This is the declaration of the HwMEBase class.
00006 //
00007 
00008 #include "ThePEG/MatrixElement/MEBase.h"
00009 #include "Herwig++/Shower/Base/ShowerParticle.fh"
00010 #include "Herwig++/Shower/Base/ShowerProgenitor.fh"
00011 #include "Herwig++/Shower/Base/ShowerTree.fh"
00012 #include "Herwig++/Shower/Base/HardTree.fh"
00013 #include "Herwig++/Shower/ShowerConfig.h"
00014 #include "ThePEG/PDF/BeamParticleData.h"
00015 #include "HwMEBase.fh"
00016 
00017 namespace Herwig {
00018 
00019 struct Branching;
00020 
00021 using namespace ThePEG;
00022 
00023 typedef Ptr<BeamParticleData>::transient_const_pointer tcBeamPtr;
00024 
00038 class HwMEBase: public MEBase {
00039 
00040 public:
00041 
00045   HwMEBase() : lastTHat_(ZERO), lastUHat_(ZERO),
00046                lastPhi_(0.0), rescaleOption_(1)
00047   {}
00048 
00055   virtual int nDim() const;
00056 
00064   virtual bool generateKinematics(const double * r);
00065 
00071   virtual CrossSection dSigHatDR() const;
00072 
00078   virtual void setKinematics();
00080 
00086 
00090   enum POWHEGType {No, ISR, FSR, Both};
00091 
00095   virtual POWHEGType  hasPOWHEGCorrection() {return No;}
00096 
00100   virtual bool hasMECorrection() {return false;}
00101 
00105   virtual void initializeMECorrection(ShowerTreePtr , double & ,
00106                                       double & ) {}
00107 
00111   virtual void applyHardMatrixElementCorrection(ShowerTreePtr) {}
00112 
00121   virtual bool softMatrixElementVeto(ShowerProgenitorPtr initial,
00122                                      ShowerParticlePtr parent,
00123                                      Branching br);
00124 
00128   virtual HardTreePtr generateHardest(ShowerTreePtr);
00130 
00131 public:
00132 
00139   void persistentOutput(PersistentOStream & os) const;
00140 
00146   void persistentInput(PersistentIStream & is, int version);
00148 
00155   static void Init();
00156 
00157 protected:
00158 
00164   Energy2 tHat() const { return lastTHat_; }
00165 
00169   Energy2 uHat() const { return lastUHat_; }
00170 
00174   double phi() const { return lastPhi_; }
00176 
00182   void tHat(Energy2 e2) { lastTHat_ = e2; }
00183 
00187   void uHat(Energy2 e2) { lastUHat_ = e2; }
00188 
00192   void phi(double phi) { lastPhi_ = phi; }
00194 
00199   void massOption(vector<unsigned int> iopt) {
00200     massOption_ = iopt;
00201   }
00202 
00212   void rescalingOption(unsigned int iopt) {
00213     rescaleOption_=iopt;
00214   }
00215 
00219   bool rescaleMomenta(const vector<Lorentz5Momentum> &,
00220                       const cPDVector &);
00221 
00225   const vector<Lorentz5Momentum> & rescaledMomenta() const {
00226     return rescaledMomenta_;
00227   }
00229 
00233   bool generateMasses(vector<Energy> & masses, double & mjac,
00234                       const double *r);
00235 
00240   virtual double getCosTheta(double cthmin, double cthmax, const double r);
00241 
00242 private:
00243 
00248   static AbstractClassDescription<HwMEBase> initHwMEBase;
00249 
00254   HwMEBase & operator=(const HwMEBase &);
00255 
00256 private:
00257 
00261   vector<unsigned int> massOption_;
00262   
00266   Energy2 lastTHat_;
00267   
00271   Energy2 lastUHat_;
00272 
00276   double lastPhi_;
00277 
00281   unsigned int rescaleOption_;
00282 
00286   vector<Lorentz5Momentum> rescaledMomenta_;
00287 
00288 };
00289 
00290 }
00291 
00292 #include "ThePEG/Utilities/ClassTraits.h"
00293 
00294 namespace ThePEG {
00295 
00300 template <>
00301 struct BaseClassTrait<Herwig::HwMEBase,1> {
00303   typedef MEBase NthBase;
00304 };
00305 
00308 template <>
00309 struct ClassTraits<Herwig::HwMEBase>
00310   : public ClassTraitsBase<Herwig::HwMEBase> {
00312   static string className() { return "Herwig::HwMEBase"; }
00313 };
00314 
00317 }
00318 
00319 #endif /* HERWIG_HwMEBase_H */