herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
MadGraphAmplitude.h
1 // -*- C++ -*-
2 //
3 // MadGraphAmplitude.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2019 The Herwig Collaboration
5 //
6 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef Herwig_MadGraphAmplitude_H
10 #define Herwig_MadGraphAmplitude_H
11 //
12 // This is the declaration of the MadGraphAmplitude class.
13 //
14 
15 #include "Herwig/MatrixElement/Matchbox/Base/MatchboxAmplitude.h"
16 #include "Herwig/MatrixElement/Matchbox/Builtin/Amplitudes/MatchboxCurrents.h"
17 #include "ThePEG/Utilities/DynamicLoader.h"
18 
19 namespace Herwig {
20 
21 
22 using namespace ThePEG;
23 
31  public MatchboxAmplitude {
32 
33 public:
34 
41 
45  virtual ~MadGraphAmplitude();
47 
48 public:
49 
53  virtual bool canHandle(const PDVector&,
54  Ptr<MatchboxFactory>::tptr,
55  bool) const;
56 
61  virtual bool hasFinalStateSymmetry() const { return false; }
62 
67  virtual void orderInGs(unsigned int ogs) { theOrderInGs = ogs; }
68 
73  virtual unsigned int orderInGs() const { return theOrderInGs; }
74 
79  virtual void orderInGem(unsigned int oge) { theOrderInGem = oge; }
80 
85  virtual unsigned int orderInGem() const { return theOrderInGem; }
86 
91  virtual bool haveOneLoop() const { return true; }
92 
97  virtual void prepareAmplitudes(Ptr<MatchboxMEBase>::tcptr);
98 
103  virtual void prepareOneLoopAmplitudes(Ptr<MatchboxMEBase>::tcptr);
104 
109  virtual Complex evaluate(size_t, const vector<int>&, Complex&);
110 
114  virtual bool oneLoopAmplitudes() const { return false; }
115 
119  virtual double oneLoopInterference() const;
120 
121  void evaloneLoopInterference() const;
122 
123 
129  virtual bool isCS() const { return false; }
130  virtual bool isExpanded() const { return true; }
131  virtual bool isBDK() const { return false; }
132  virtual bool isDR() const { return false; }
133  virtual bool isDRbar() const {return false;}
134 
140  virtual Energy2 mu2() const { return sqr(91.18800000000*GeV);}
141  //virtual Energy2 mu2() const { return lastSHat(); }
142 
143 
144  virtual LorentzVector<Complex> plusPolarization(const Lorentz5Momentum& p,
145  const Lorentz5Momentum& n,
146  int id = -1) const;
150  virtual double spinColourCorrelatedME2(pair<int,int> emitterSpectator,
151  const SpinCorrelationTensor& c) const;
152 
156  vector<size_t> gluonsFirst(vector<size_t> i);
157 
161  virtual void flushCaches() {
163  }
164 
169  virtual bool isExternal() const { return true; }
170 
174  virtual bool initializeExternal();
175 
179  virtual int externalId(const cPDVector&);
180 
181 
187  virtual bool writeAmplitudesDat();
188 
193  virtual bool checkAmplitudes();
194 
195 
196  string mgProcLibPath();
197 
202  virtual bool canFillRhoMatrix() const { return true; }
203 
208  virtual vector<unsigned int> physicalHelicities(const vector<int>&) const;
209 
210 public:
211 
218  void persistentOutput(PersistentOStream & os) const;
219 
225  void persistentInput(PersistentIStream & is, int version);
227 
234  static void Init();
235 
236 protected:
237 
244  virtual IBPtr clone() const;
245 
250  virtual IBPtr fullclone() const;
252 
253 
254 // If needed, insert declarations of virtual function defined in the
255 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
256 
257 protected:
258 
266  virtual void doinit();
267 
272  virtual void doinitrun();
273 
278  unsigned int theOrderInGs;
279 
284  unsigned int theOrderInGem;
285 
289  static string theProcessPath;
290 
294  static string theMGmodel;
295 
296  bool keepinputtopmass;
297 
298 
302  void initProcess(const cPDVector&);
303 
304 
308  static vector<string> BornAmplitudes,VirtAmplitudes;
309 
313  mutable vector<int> colourindex, crossing;
314 
315 
321  static bool initializedMad;
322 
323 
324 
326 
327 protected:
328 
332  static string bindir_;
333 
337  static string includedir_;
338 
342  static string pkgdatadir_;
343 
347  static string madgraphPrefix_;
348 
353  void setProcessPath(string );
354  string getProcessPath() const;
355 
356  void setBinDir(string p);
357  string getBinDir() const;
358 
359  void setDataDir(string p);
360  string getDataDir() const;
361 
362  void setModel(string p);
363  string getModel() const;
364 
365  void setMadgraphPrefix(string p);
366  string getMadgraphPrefix() const ;
367 
368 private:
369 
374  MadGraphAmplitude & operator=(const MadGraphAmplitude &) = delete;
375 
376 
377 };
378 
379 }
380 
381 #endif /* Herwig_MadGraphAmplitude_H */
static string madgraphPrefix_
Location of MADGRAPH.
virtual unsigned int orderInGem() const
Return the (tree-level) order in in which this matrix element is given.
std::complex< double > Complex
virtual bool hasFinalStateSymmetry() const
Return true, if this amplitude already includes symmetry factors for identical outgoing particles...
static vector< string > BornAmplitudes
Storage for Amplitudes.
virtual bool isExpanded() const
Return true, if one loop corrections are given in the conventions of everything expanded.
MadGraphAmplitude implements an interface to MadGraph.
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
constexpr auto sqr(const T &x) -> decltype(x *x)
virtual unsigned int orderInGs() const
Return the (tree-level) order in in which this matrix element is given.
static string theProcessPath
The path for the process libraries.
virtual void orderInGem(unsigned int oge)
Set the (tree-level) order in in which this matrix element should be evaluated.
MatchboxAmplitude is the base class for amplitude implementations inside Matchbox.
unsigned int theOrderInGs
The (tree-level) order in in which this matrix element is given.
unsigned int theOrderInGem
The (tree-level) order in in which this matrix element is given.
virtual bool canFillRhoMatrix() const
Return true, if this amplitude is capable of consistently filling the rho matrices for the spin corre...
virtual bool isCS() const
Return true, if one loop corrections are given in the conventions of BDK.
static string bindir_
Location of the installed executables.
virtual void orderInGs(unsigned int ogs)
Set the (tree-level) order in in which this matrix element should be evaluated.
virtual Energy2 mu2() const
Return the value of the dimensional regularization parameter.
virtual bool isDR() const
Return true, if one loop corrections have been calculated in dimensional reduction.
virtual bool isBDK() const
Return true, if one loop corrections are given in the conventions of BDK.
static string pkgdatadir_
Location of the data files.
virtual bool haveOneLoop() const
Return true, if this amplitude is capable of calculating one-loop (QCD) corrections.
virtual void flushCaches()
Flush all cashes.
vector< cPDPtr > cPDVector
virtual bool isExternal() const
Return true, if this amplitude needs to initialize an external code.
static string includedir_
Location of the installed include files.
virtual bool oneLoopAmplitudes() const
Return true, if one-loop contributions will be evaluated at amplitude level.
static bool ranMadGraphInitializeExternal
Static Variables to handle initialization.
-*- C++ -*-
virtual bool isDRbar() const
Return true, if the amplitude is DRbar renormalized, otherwise MSbar is assumed.
static string theMGmodel
The path to generate amplitudes in.
vector< PDPtr > PDVector
virtual void flushCaches()
Flush all cashes.
SpinCorrelationTensor represents a spin correlation tensor of the form.
vector< int > colourindex
Helper for color and crossing handling.