herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
MatchboxAmplitude.h
1// -*- C++ -*-
2//
3// MatchboxAmplitude.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_MatchboxAmplitude_H
10#define HERWIG_MatchboxAmplitude_H
11//
12// This is the declaration of the MatchboxAmplitude class.
13//
14
15#include "ThePEG/MatrixElement/Amplitude.h"
16#include "ThePEG/Handlers/LastXCombInfo.h"
17#include "Herwig/MatrixElement/Matchbox/Utility/ColourBasis.h"
18#include "Herwig/MatrixElement/Matchbox/Utility/SpinCorrelationTensor.h"
19#include "Herwig/MatrixElement/Matchbox/Utility/LastMatchboxXCombInfo.h"
20#include "Herwig/MatrixElement/Matchbox/Utility/MatchboxXComb.h"
21#include "Herwig/MatrixElement/Matchbox/Phasespace/MatchboxPhasespace.h"
22#include "Herwig/MatrixElement/Matchbox/Base/MatchboxMEBase.fh"
23#include "Herwig/MatrixElement/Matchbox/MatchboxFactory.fh"
24#include "ThePEG/Persistency/PersistentOStream.h"
25#include "ThePEG/Persistency/PersistentIStream.h"
26
27namespace Herwig {
28
29using namespace ThePEG;
30
37struct Process {
38
39 PDVector legs;
40 unsigned int orderInAlphaS;
41 unsigned int orderInAlphaEW;
42
43 Process()
44 : orderInAlphaS(0), orderInAlphaEW(0) {}
45
46 Process(const PDVector& p,
47 unsigned int oas,
48 unsigned int oae)
49 : legs(p), orderInAlphaS(oas), orderInAlphaEW(oae) {}
50
51 bool operator==(const Process& other) const {
52 return
53 legs == other.legs &&
54 orderInAlphaS == other.orderInAlphaS &&
55 orderInAlphaEW == other.orderInAlphaEW;
56 }
57
58 bool operator<(const Process& other) const {
59 if ( orderInAlphaS != other.orderInAlphaS )
60 return orderInAlphaS < other.orderInAlphaS;
61 if ( orderInAlphaEW != other.orderInAlphaEW )
62 return orderInAlphaEW < other.orderInAlphaEW;
63 return legs < other.legs;
64 }
65
66 void persistentOutput(PersistentOStream & os) const {
67 os << legs << orderInAlphaS << orderInAlphaEW;
68 }
69
70 void persistentInput(PersistentIStream & is) {
71 is >> legs >> orderInAlphaS >> orderInAlphaEW;
72 }
73
74};
75
82namespace ProcessType {
83
84 enum Types {
85
86 treeME2 = 0,
87 colourCorrelatedME2,
88 spinColourCorrelatedME2,
89 oneLoopInterference,
90 loopInducedME2,
91 spinCorrelatedME2
92
93 };
94
95}
96
97
109 public Amplitude,
110 public LastXCombInfo<StandardXComb>,
111 public LastMatchboxXCombInfo {
112
113public:
114
119
120public:
121
128 virtual Complex value(const tcPDVector & particles,
129 const vector<Lorentz5Momentum> & momenta,
130 const vector<int> & helicities);
131
135 Ptr<MatchboxFactory>::tptr factory() const;
136
139
143 virtual bool canHandle(const PDVector& p,
144 Ptr<MatchboxFactory>::tptr,
145 bool) const { return canHandle(p); }
146
150 virtual bool canHandle(const PDVector&) const { return false; }
151
156 virtual int nDimAdditional() const { return 0; }
157
162 virtual Ptr<MatchboxMEBase>::ptr makeME(const PDVector&) const;
163
168 virtual void orderInGs(unsigned int) {}
169
174 virtual unsigned int orderInGs() const = 0;
175
180 virtual void orderInGem(unsigned int) {}
181
186 virtual unsigned int orderInGem() const = 0;
187
191 Ptr<StandardModel>::tcptr standardModel() {
192 if ( !hwStandardModel() )
193 hwStandardModel(dynamic_ptr_cast<Ptr<StandardModel>::tcptr>(HandlerBase::standardModel()));
194 return hwStandardModel();
195 }
196
201 virtual bool hasInitialAverage() const { return false; }
202
207 virtual bool hasFinalStateSymmetry() const { return false; }
208
212 virtual bool isOLPTree() const { return false; }
213
217 virtual bool isOLPLoop() const { return false; }
218
223 virtual bool needsOLPCorrelators() const { return true; }
224
228 virtual void olpOrderFileHeader(ostream&) const;
229
233 virtual void olpOrderFileProcesses(ostream&,
234 const map<pair<Process,int>,int>& procs) const;
235
240 virtual void signOLP(const string&, const string&) { }
241
245 virtual void startOLP(const string&, int& status) { status = -1; }
246
251 virtual bool startOLP(const map<pair<Process,int>,int>& procs);
252
257 virtual bool isExternal() const { return false; }
258
262 virtual bool initializeExternal() { return false; }
263
267 virtual int externalId(const cPDVector&) { return 0; }
268
272 const map<long,Energy>& reshuffleMasses() const { return theReshuffleMasses; }
273
277 void checkReshuffling(Ptr<MatchboxPhasespace>::tptr);
278
282 virtual bool hasAmplitudeMomenta() const { return false; }
283
285
288
292 virtual Ptr<ColourBasis>::tptr colourBasis() const { return theColourBasis; }
293
298 virtual bool haveColourFlows() const {
299 return colourBasis() ? colourBasis()->haveColourFlows() : false;
300 }
301
306 virtual Selector<const ColourLines *> colourGeometries(tcDiagPtr diag) const;
307
312 const string& colourOrderingString(size_t id) const;
313
318 const set<vector<size_t> >& colourOrdering(size_t id) const;
319
321
324
328 virtual void setXComb(tStdXCombPtr xc);
329
333 Lorentz5Momentum amplitudeMomentum(int) const;
334
341 virtual void fillCrossingMap(size_t shift = 0);
342
346 virtual set<vector<int> > generateHelicities() const;
347
352 virtual vector<unsigned int> physicalHelicities(const vector<int>&) const;
353
355
358
363 virtual void prepareAmplitudes(Ptr<MatchboxMEBase>::tcptr);
364
368 virtual double me2() const;
369
373 double colourCharge(tcPDPtr) const;
374
379
383 virtual double largeNME2(Ptr<ColourBasis>::tptr largeNBasis) const;
384
388 virtual double colourCorrelatedME2(pair<int,int> ij) const;
389
393 virtual double largeNColourCorrelatedME2(pair<int,int> ij,
394 Ptr<ColourBasis>::tptr largeNBasis) const;
395
400
405 virtual bool canFillRhoMatrix() const { return false; }
406
412 virtual LorentzVector<Complex> plusPolarization(const Lorentz5Momentum& p,
413 const Lorentz5Momentum& n,
414 int id = -1) const;
415
419 virtual double spinColourCorrelatedME2(pair<int,int> emitterSpectator,
420 const SpinCorrelationTensor& c) const;
421
425 virtual double spinCorrelatedME2(pair<int,int> emitterSpectator,
426 const SpinCorrelationTensor& c) const;
427
428
432 virtual bool treeAmplitudes() const { return true; }
433
438 virtual Complex evaluate(size_t, const vector<int>&, Complex&) { return 0.; }
439
441
444
448 virtual Ptr<MatchboxAmplitude>::tptr oneLoopAmplitude() const {
449 return Ptr<MatchboxAmplitude>::tptr();
450 }
451
455 virtual void disableOneLoop() {}
456
461 virtual bool haveOneLoop() const { return false; }
462
467 virtual bool onlyOneLoop() const { return false; }
468
472 virtual bool oneLoopAmplitudes() const { return true; }
473
480 virtual bool isDR() const { return false; }
481
486 virtual bool isDRbar() const { return true; }
487
492 virtual bool isCS() const { return false; }
493
498 virtual bool isBDK() const { return false; }
499
504 virtual bool isExpanded() const { return false; }
505
511 virtual Energy2 mu2() const { return 0.*GeV2; }
512
516 virtual bool hasRunningAlphaS() const { return false; }
517
521 virtual bool hasRunningAlphaEW() const { return false; }
522
526 virtual double oneLoopDoublePole() const { return 0.; }
527
531 virtual double oneLoopSinglePole() const { return 0.; }
532
537 virtual void prepareOneLoopAmplitudes(Ptr<MatchboxMEBase>::tcptr);
538
542 virtual double oneLoopInterference() const;
543
548 virtual Complex evaluateOneLoop(size_t, const vector<int>&) { return 0.; }
549
551
554
558 virtual void flushCaches() {}
559
563 Ptr<MatchboxAmplitude>::ptr cloneMe() const {
564 return dynamic_ptr_cast<Ptr<MatchboxAmplitude>::ptr>(clone());
565 }
566
570 virtual void cloneDependencies(const std::string& prefix="" , bool slim=false);
571
573
574public:
575
583
589 void persistentInput(PersistentIStream & is, int version);
591
598 static void Init();
599
600// If needed, insert declarations of virtual function defined in the
601// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
602
603protected:
604
607
613 virtual void doinit();
614
619 virtual void doinitrun();
621
622private:
623
627 void doGenerateHelicities(set<vector<int> >& res,
628 vector<int>& current,
629 size_t pos) const;
630
634 Ptr<ColourBasis>::ptr theColourBasis;
635
641
647
653
657 map<long,Energy> theReshuffleMasses;
658
663
667 string doReshuffle(string);
668
672 string doMassless(string);
673
677 string doOnShell(string);
678
682 string doClearReshuffling(string);
683
689
690};
691
693 const Process& h) {
694 h.persistentOutput(os);
695 return os;
696}
697
699 Process& h) {
700 h.persistentInput(is);
701 return is;
702}
703
704}
705
706#endif /* HERWIG_MatchboxAmplitude_H */
Provide easy access to MatchboxXComb XComb extensions.
Ptr< StandardModel >::tcptr hwStandardModel() const
Get the Herwig StandardModel object.
MatchboxAmplitude is the base class for amplitude implementations inside Matchbox.
string doOnShell(string)
A command to fill the reshuffle mass map.
virtual double oneLoopSinglePole() const
If defined, return the coefficient of the pole in epsilon.
virtual bool hasAmplitudeMomenta() const
Return true, if this amplitude makes use of amplitudeMomenta.
virtual void setXComb(tStdXCombPtr xc)
Set the xcomb object.
virtual Complex value(const tcPDVector &particles, const vector< Lorentz5Momentum > &momenta, const vector< int > &helicities)
Return the amplitude.
virtual bool haveColourFlows() const
Return true, if the colour basis is capable of assigning colour flows.
virtual Ptr< MatchboxMEBase >::ptr makeME(const PDVector &) const
Return a ME instance appropriate for this amplitude and the given subprocesses.
virtual bool isExternal() const
Return true, if this amplitude needs to initialize an external code.
virtual Complex evaluateOneLoop(size_t, const vector< int > &)
Evaluate the amplitude for the given colour tensor id and helicity assignment.
bool theTrivialColourLegs
True if trivial colour configuration.
string doMassless(string)
A command to fill the reshuffle mass map.
virtual bool hasFinalStateSymmetry() const
Return true, if this amplitude already includes symmetry factors for identical outgoing particles.
virtual unsigned int orderInGs() const =0
Return the (tree-level) order in in which this matrix element is given.
virtual bool hasInitialAverage() const
Return true, if this amplitude already includes averaging over incoming parton's quantum numbers.
virtual double oneLoopDoublePole() const
If defined, return the coefficient of the pole in epsilon^2.
Ptr< StandardModel >::tcptr standardModel()
Return the Herwig StandardModel object.
virtual void prepareOneLoopAmplitudes(Ptr< MatchboxMEBase >::tcptr)
Calculate the one-loop amplitudes for the phasespace point stored in lastXComb, if provided.
virtual void prepareAmplitudes(Ptr< MatchboxMEBase >::tcptr)
Calculate the tree level amplitudes for the phasespace point stored in lastXComb.
virtual bool needsOLPCorrelators() const
Return true, if colour and spin correlated matrix elements should be ordered from the OLP.
virtual bool hasRunningAlphaEW() const
Indicate that this amplitude is running alphaew by itself.
map< long, Energy > theReshuffleMasses
The map with masses to be used for amplitude evaluation.
static void Init()
The standard Init function used to initialize the interfaces.
int treeLevelHelicityPoints
The number of points that are calculated before a certain helicity is excluded.
virtual Ptr< MatchboxAmplitude >::tptr oneLoopAmplitude() const
Return the one-loop amplitude, if applicable.
virtual void flushCaches()
Flush all cashes.
virtual void olpOrderFileProcesses(ostream &, const map< pair< Process, int >, int > &procs) const
Write the order file process list.
virtual void fillCrossingMap(size_t shift=0)
Perform a normal ordering of external legs and fill the crossing information as.
virtual bool isDR() const
Return true, if one loop corrections have been calculated in dimensional reduction.
virtual bool startOLP(const map< pair< Process, int >, int > &procs)
Start the one loop provider, if appropriate.
virtual bool onlyOneLoop() const
Return true, if this amplitude only provides one-loop (QCD) corrections.
void checkReshuffling(Ptr< MatchboxPhasespace >::tptr)
Check if reshuffling is needed at all.
virtual bool oneLoopAmplitudes() const
Return true, if one-loop contributions will be evaluated at amplitude level.
virtual double me2() const
Return the matrix element squared.
virtual void orderInGem(unsigned int)
Set the (tree-level) order in in which this matrix element should be evaluated.
virtual bool canHandle(const PDVector &p, Ptr< MatchboxFactory >::tptr, bool) const
Return true, if this amplitude can handle the given process.
virtual void orderInGs(unsigned int)
Set the (tree-level) order in in which this matrix element should be evaluated.
virtual bool initializeExternal()
Initialize this amplitude.
virtual double colourCorrelatedME2(pair< int, int > ij) const
Return the colour correlated matrix element.
virtual bool canHandle(const PDVector &) const
Return true, if this amplitude can handle the given process.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
virtual void signOLP(const string &, const string &)
Start the one loop provider, if appropriate, giving order and contract files.
virtual bool isCS() const
Return true, if one loop corrections are given in the conventions of the integrated dipoles.
virtual bool isExpanded() const
Return true, if one loop corrections are given in the conventions of everything expanded.
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 Selector< const ColourLines * > colourGeometries(tcDiagPtr diag) const
Return a Selector with possible colour geometries for the selected diagram weighted by their relative...
double largeNColourCharge(tcPDPtr) const
Return the large-N charge of a given leg.
virtual int nDimAdditional() const
Return the number of random numbers required to evaluate this amplitude at a fixed phase space point.
virtual void disableOneLoop()
Diasble one-loop functionality if not needed.
string doReshuffle(string)
A command to fill the reshuffle mass map.
virtual bool isBDK() const
Return true, if one loop corrections are given in the conventions of BDK.
virtual bool treeAmplitudes() const
Return true, if tree-level contributions will be evaluated at amplitude level.
virtual Energy2 mu2() const
Return the value of the dimensional regularization parameter.
virtual Complex evaluate(size_t, const vector< int > &, Complex &)
Evaluate the amplitude for the given colour tensor id and helicity assignment.
virtual unsigned int orderInGem() const =0
Return the (tree-level) order in in which this matrix element is given.
void doGenerateHelicities(set< vector< int > > &res, vector< int > &current, size_t pos) const
Recursively generate helicities.
virtual void olpOrderFileHeader(ostream &) const
Write the order file header.
int theCleanupAfter
The number of points after which helicity combinations wil be cleaned up.
bool trivialColourLegs() const
Return true if trivial colour configuration.
Ptr< MatchboxAmplitude >::ptr cloneMe() const
Clone this amplitude.
const string & colourOrderingString(size_t id) const
Return an ordering identifier for the current subprocess and colour absis tensor index.
virtual int externalId(const cPDVector &)
Return a generic process id for the given process.
const map< long, Energy > & reshuffleMasses() const
Return the map with masses to be used for amplitude evaluation.
virtual bool canFillRhoMatrix() const
Return true, if this amplitude is capable of consistently filling the rho matrices for the spin corre...
MatchboxAmplitude()
The default constructor.
Ptr< ColourBasis >::ptr theColourBasis
The colour basis implementation to be used.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
const set< vector< size_t > > & colourOrdering(size_t id) const
Return an ordering identifier for the current subprocess and colour absis tensor index.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
MatchboxAmplitude & operator=(const MatchboxAmplitude &)=delete
The assignment operator is private and must never be called.
virtual bool hasRunningAlphaS() const
Indicate that this amplitude is running alphas by itself.
virtual void cloneDependencies(const std::string &prefix="", bool slim=false)
Clone the dependencies, using a given prefix.
virtual double oneLoopInterference() const
Return the one-loop/tree interference.
virtual Ptr< ColourBasis >::tptr colourBasis() const
Return the colour basis.
string doClearReshuffling(string)
Clear the reshuffling map.
virtual bool isOLPTree() const
Return true, if this amplitude is handled by a BLHA one-loop provider.
virtual bool isOLPLoop() const
Return true, if this amplitude is handled by a BLHA one-loop provider.
virtual void doinitrun()
Initialize this object.
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...
virtual void startOLP(const string &, int &status)
Start the one loop provider, if appropriate.
Ptr< MatchboxFactory >::tptr factory() const
Return the factory which produced this matrix element.
virtual double spinColourCorrelatedME2(pair< int, int > emitterSpectator, const SpinCorrelationTensor &c) const
Return the colour and spin correlated matrix element.
virtual set< vector< int > > generateHelicities() const
Generate the helicity combinations.
virtual double largeNColourCorrelatedME2(pair< int, int > ij, Ptr< ColourBasis >::tptr largeNBasis) const
Return the large-N colour correlated matrix element.
double colourCharge(tcPDPtr) const
Return the colour charge of a given leg.
virtual bool isDRbar() const
Return true, if the amplitude is DRbar renormalized, otherwise MSbar is assumed.
virtual bool haveOneLoop() const
Return true, if this amplitude is capable of calculating one-loop (QCD) corrections.
virtual double spinCorrelatedME2(pair< int, int > emitterSpectator, const SpinCorrelationTensor &c) const
Return the spin correlated matrix element.
Lorentz5Momentum amplitudeMomentum(int) const
Return the momentum as crossed appropriate for this amplitude.
int oneLoopHelicityPoints
The number of points that are calculated before a certain helicity is excluded.
virtual double largeNME2(Ptr< ColourBasis >::tptr largeNBasis) const
Return the largeN matrix element squared.
SpinCorrelationTensor represents a spin correlation tensor of the form.
virtual IBPtr clone() const=0
-*- C++ -*-
PersistentIStream & operator>>(PersistentIStream &is, HandlerGroup< HDLR > &hg)
vector< PDPtr > PDVector
std::complex< double > Complex
ThePEG::Ptr< ParticleData >::transient_const_pointer tcPDPtr
ostream & operator<<(ostream &, const Collision &)
vector< tcPDPtr > tcPDVector
vector< cPDPtr > cPDVector
Process information with coupling order.