herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
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
19namespace Herwig {
20
21
22using namespace ThePEG;
23
31 public MatchboxAmplitude {
32
33public:
34
41
47
48public:
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
210public:
211
219
225 void persistentInput(PersistentIStream & is, int version);
227
234 static void Init();
235
236protected:
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
257protected:
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
327protected:
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
368private:
369
375
376
377};
378
379}
380
381#endif /* Herwig_MadGraphAmplitude_H */
MadGraphAmplitude implements an interface to MadGraph.
virtual vector< unsigned int > physicalHelicities(const vector< int > &) const
Return the helicity combination of the physical process in the conventions used by the spin correlati...
virtual bool haveOneLoop() const
Return true, if this amplitude is capable of calculating one-loop (QCD) corrections.
virtual int externalId(const cPDVector &)
Return a generic process id for the given process.
static string includedir_
Location of the installed include files.
virtual IBPtr clone() const
Make a simple clone of this object.
static string bindir_
Location of the installed executables.
virtual bool isDR() const
Return true, if one loop corrections have been calculated in dimensional reduction.
virtual bool initializeExternal()
Initialize this amplitude.
virtual bool hasFinalStateSymmetry() const
Return true, if this amplitude already includes symmetry factors for identical outgoing particles.
virtual unsigned int orderInGem() const
Return the (tree-level) order in in which this matrix element is given.
virtual bool isDRbar() const
Return true, if the amplitude is DRbar renormalized, otherwise MSbar is assumed.
virtual Complex evaluate(size_t, const vector< int > &, Complex &)
Evaluate the amplitude for the given colour tensor id and helicity assignment.
static string madgraphPrefix_
Location of MADGRAPH.
virtual LorentzVector< Complex > plusPolarization(const Lorentz5Momentum &p, const Lorentz5Momentum &n, int id=-1) const
Return a positive helicity polarization vector for a gluon of momentum p (with reference vector n) to...
static vector< string > BornAmplitudes
Storage for Amplitudes.
virtual void doinitrun()
Initialize this object.
static string pkgdatadir_
Location of the data files.
static string theProcessPath
The path for the process libraries.
virtual Energy2 mu2() const
Return the value of the dimensional regularization parameter.
virtual ~MadGraphAmplitude()
The destructor.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
virtual bool isBDK() const
Return true, if one loop corrections are given in the conventions of BDK.
unsigned int theOrderInGs
The (tree-level) order in in which this matrix element is given.
void setProcessPath(string)
Helper functions to make long strings static.
virtual void prepareAmplitudes(Ptr< MatchboxMEBase >::tcptr)
Calculate the tree level amplitudes for the phasespace point stored in lastXComb.
virtual bool checkAmplitudes()
CHeck if all amplitudes are in the Libary.
virtual bool isCS() const
Return true, if one loop corrections are given in the conventions of BDK.
MadGraphAmplitude & operator=(const MadGraphAmplitude &)=delete
The assignment operator is private and must never be called.
static string theMGmodel
The path to generate amplitudes in.
virtual double spinColourCorrelatedME2(pair< int, int > emitterSpectator, const SpinCorrelationTensor &c) const
Return the colour and spin correlated matrix element.
virtual void flushCaches()
Flush all cashes.
virtual bool canHandle(const PDVector &, Ptr< MatchboxFactory >::tptr, bool) const
Return true, if this amplitude can handle the given process.
virtual void prepareOneLoopAmplitudes(Ptr< MatchboxMEBase >::tcptr)
Calculate the one-loop amplitudes for the phasespace point stored in lastXComb, if provided.
void initProcess(const cPDVector &)
Initialize the given process.
MadGraphAmplitude()
The default constructor.
virtual void orderInGs(unsigned int ogs)
Set the (tree-level) order in in which this matrix element should be evaluated.
static void Init()
The standard Init function used to initialize the interfaces.
vector< size_t > gluonsFirst(vector< size_t > i)
Order process in MadGraph conventions.
virtual bool writeAmplitudesDat()
Write out BornAmplitudes.dat and VirtualAmplitudes.dat, return true if new files are written.
virtual unsigned int orderInGs() const
Return the (tree-level) order in in which this matrix element is given.
virtual void orderInGem(unsigned int oge)
Set the (tree-level) order in in which this matrix element should be evaluated.
virtual bool oneLoopAmplitudes() const
Return true, if one-loop contributions will be evaluated at amplitude level.
unsigned int theOrderInGem
The (tree-level) order in in which this matrix element is given.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual double oneLoopInterference() const
Return the one-loop/tree interference.
vector< int > colourindex
Helper for color and crossing handling.
virtual bool isExpanded() const
Return true, if one loop corrections are given in the conventions of everything expanded.
static bool ranMadGraphInitializeExternal
Static Variables to handle initialization.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
virtual bool isExternal() const
Return true, if this amplitude needs to initialize an external code.
virtual bool canFillRhoMatrix() const
Return true, if this amplitude is capable of consistently filling the rho matrices for the spin corre...
MatchboxAmplitude is the base class for amplitude implementations inside Matchbox.
virtual void flushCaches()
Flush all cashes.
SpinCorrelationTensor represents a spin correlation tensor of the form.
-*- C++ -*-
vector< PDPtr > PDVector
std::complex< double > Complex
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
constexpr auto sqr(const T &x) -> decltype(x *x)
vector< cPDPtr > cPDVector