00001 // -*- C++ -*- 00002 // 00003 // ME2to2Base.h is a part of ThePEG - Toolkit for HEP Event Generation 00004 // Copyright (C) 1999-2007 Leif Lonnblad 00005 // 00006 // ThePEG is licenced under version 2 of the GPL, see COPYING for details. 00007 // Please respect the MCnet academic guidelines, see GUIDELINES for details. 00008 // 00009 #ifndef ThePEG_ME2to2Base_H 00010 #define ThePEG_ME2to2Base_H 00011 // This is the declaration of the ME2to2Base class. 00012 00013 #include "ThePEG/MatrixElement/MEBase.h" 00014 #include "ThePEG/MatrixElement/Tree2toNDiagram.h" 00015 #include "ThePEG/Interface/Switch.fh" 00016 00017 namespace ThePEG { 00018 00032 class ME2to2Base: public MEBase { 00033 00034 public: 00035 00041 ME2to2Base() 00042 : theScaleChoice(0), theLastTHat(ZERO), theLastUHat(ZERO), 00043 theLastPhi(0.0) {} 00044 00048 virtual ~ME2to2Base(); 00050 00051 public: 00052 00059 virtual int nDim() const { return 1; } 00060 00068 virtual bool generateKinematics(const double * r); 00069 00075 virtual CrossSection dSigHatDR() const; 00076 00080 virtual Energy2 scale() const; 00081 00087 virtual void setKinematics(); 00089 00094 virtual double getCosTheta(double cthmin, double cthmax, const double * r); 00095 00100 int scaleChoice() const { return theScaleChoice; } 00101 00102 public: 00103 00109 Energy2 tHat() const { return theLastTHat; } 00110 00114 Energy2 uHat() const { return theLastUHat; } 00115 00119 double phi() const { return theLastPhi; } 00121 00122 public: 00123 00130 void persistentOutput(PersistentOStream & os) const; 00131 00137 void persistentInput(PersistentIStream & is, int version); 00139 00143 static void Init(); 00144 00145 protected: 00146 00152 void tHat(Energy2 e2) { theLastTHat = e2; } 00153 00157 void uHat(Energy2 e2) { theLastUHat = e2; } 00158 00162 void phi(double phi) { theLastPhi = phi; } 00164 00165 protected: 00166 00171 static Switch<ME2to2Base,int> & interfaceScaleChoice(); 00172 00173 private: 00174 00178 int theScaleChoice; 00179 00183 Energy2 theLastTHat; 00184 00188 Energy2 theLastUHat; 00189 00193 double theLastPhi; 00194 00195 00196 private: 00197 00201 static AbstractClassDescription<ME2to2Base> initME2to2Base; 00202 00206 ME2to2Base & operator=(const ME2to2Base &); 00207 00208 }; 00209 00210 } 00211 00212 00213 namespace ThePEG { 00214 00221 template <> 00222 struct BaseClassTrait<ME2to2Base,1>: public ClassTraitsType { 00224 typedef MEBase NthBase; 00225 }; 00226 00231 template <> 00232 struct ClassTraits<ME2to2Base>: public ClassTraitsBase<ME2to2Base> { 00234 static string className() { return "ThePEG::ME2to2Base"; } 00235 }; 00236 00239 } 00240 00241 #endif /* ThePEG_ME2to2Base_H */