00001 // -*- C++ -*- 00002 // 00003 // MEBase.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_MEBase_H 00010 #define ThePEG_MEBase_H 00011 // This is the declaration of the MEBase class. 00012 00013 #include "ThePEG/Handlers/HandlerBase.h" 00014 #include "ThePEG/EventRecord/SubProcess.h" 00015 #include "ThePEG/MatrixElement/DiagramBase.h" 00016 #include "ThePEG/MatrixElement/ColourLines.h" 00017 #include "ThePEG/MatrixElement/Amplitude.h" 00018 #include "ThePEG/Handlers/LastXCombInfo.h" 00019 #include "ThePEG/Handlers/StandardXComb.fh" 00020 #include "ReweightBase.h" 00021 00022 #include "MEBase.fh" 00023 00024 namespace ThePEG { 00025 00067 class MEBase: public HandlerBase, public LastXCombInfo<StandardXComb> { 00068 00069 public: 00070 00072 typedef vector<DiagPtr> DiagramVector; 00074 typedef DiagramVector::size_type DiagramIndex; 00076 typedef vector<ReweightPtr> ReweightVector; 00077 00078 public: 00079 00085 MEBase(); 00086 00090 virtual ~MEBase(); 00092 00093 public: 00094 00101 virtual unsigned int orderInAlphaS() const = 0; 00102 00107 virtual unsigned int orderInAlphaEW() const = 0; 00108 00114 virtual double me2() const = 0; 00115 00120 virtual Energy2 scale() const = 0; 00121 00127 virtual double alphaS() const; 00128 00134 virtual double alphaEM() const; 00135 00140 void setKinematics(tPPair in, const PVector & out); 00141 00149 virtual void setKinematics(); 00150 00154 virtual void constructVertex(tSubProPtr sub); 00155 00160 virtual int nDim() const; 00161 00170 virtual bool generateKinematics(const double * r) = 0; 00171 00176 virtual CrossSection dSigHatDR() const = 0; 00177 00185 virtual void generateSubCollision(SubProcess &); 00186 00191 virtual void clearKinematics(); 00192 00196 virtual void getDiagrams() const = 0; 00197 00201 const DiagramVector & diagrams() const { 00202 if ( theDiagrams.empty() ) getDiagrams(); 00203 return theDiagrams; 00204 } 00205 00210 virtual Selector<const ColourLines *> 00211 colourGeometries(tcDiagPtr diag) const = 0; 00212 00218 virtual const ColourLines & 00219 selectColourGeometry(tcDiagPtr diag) const; 00220 00227 virtual Selector<DiagramIndex> diagrams(const DiagramVector &) const { 00228 return Selector<DiagramIndex>(); 00229 } 00230 00231 00238 virtual DiagramIndex diagram(const DiagramVector &) const; 00239 00244 inline bool reweighted() const { 00245 return reweights.size() > 0 || preweights.size() > 0; 00246 } 00247 00253 double reWeight() const; 00254 00260 double preWeight() const; 00261 00265 void addReweighter(tReweightPtr rw); 00266 00270 void addPreweighter(tReweightPtr rw); 00271 00277 Ptr<Amplitude>::pointer amplitude() const { return theAmplitude; } 00279 00280 public: 00281 00287 Energy2 sHat() const { return theLastSHat; } 00288 00293 double preweight() const { return lastPreweight; } 00294 00299 virtual void setXComb(tStdXCombPtr); 00300 00305 const DVector & meInfo() const; 00306 00311 void meInfo(const DVector & info) const; 00312 00319 int maxMultCKKW() const { return theMaxMultCKKW; } 00320 00327 int minMultCKKW() const { return theMinMultCKKW; } 00329 00330 public: 00331 00338 void persistentOutput(PersistentOStream & os) const; 00339 00345 void persistentInput(PersistentIStream & is, int version); 00347 00351 static void Init(); 00352 00353 protected: 00354 00359 void add(DiagPtr dp) const { theDiagrams.push_back(dp); } 00360 00364 vector<Lorentz5Momentum> & meMomenta(); 00365 using LastXCombInfo<StandardXComb>::meMomenta; 00366 00371 double jacobian() const { return theLastJacobian; } 00372 00377 void jacobian(double j) { theLastJacobian = j; } 00378 00379 private: 00380 00384 mutable DiagramVector theDiagrams; 00385 00389 Energy2 theLastSHat; 00390 00394 ReweightVector reweights; 00395 00399 ReweightVector preweights; 00400 00404 mutable double lastPreweight; 00405 00409 Ptr<Amplitude>::pointer theAmplitude; 00410 00415 double theLastJacobian; 00416 00423 int theMaxMultCKKW; 00424 00431 int theMinMultCKKW; 00432 00433 private: 00434 00438 static AbstractClassDescription<MEBase> initMEBase; 00439 00443 MEBase & operator=(const MEBase &); 00444 00445 }; 00446 00447 } 00448 00449 00450 namespace ThePEG { 00451 00458 template <> 00459 struct BaseClassTrait<MEBase,1>: public ClassTraitsType { 00461 typedef HandlerBase NthBase; 00462 }; 00463 00468 template <> 00469 struct ClassTraits<MEBase>: public ClassTraitsBase<MEBase> { 00471 static string className() { return "ThePEG::MEBase"; } 00472 }; 00473 00476 } 00477 00478 #include "ThePEG/Handlers/StandardXComb.h" 00479 00480 #endif /* ThePEG_MEBase_H */