herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
MatchboxHybridAmplitude.h
1 // -*- C++ -*-
2 //
3 // MatchboxHybridAmplitude.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_MatchboxHybridAmplitude_H
10 #define Herwig_MatchboxHybridAmplitude_H
11 //
12 // This is the declaration of the MatchboxHybridAmplitude class.
13 //
14 
15 #include "Herwig/MatrixElement/Matchbox/Base/MatchboxAmplitude.h"
16 
17 namespace Herwig {
18 
19 using namespace ThePEG;
20 
32 
33 public:
34 
41 
45  virtual ~MatchboxHybridAmplitude();
47 
48 public:
49 
53  Ptr<MatchboxAmplitude>::tptr treeLevelAmplitude() const { return theTreeLevelAmplitude; }
54 
58  void treeLevelAmplitude(Ptr<MatchboxAmplitude>::tptr amp) { theTreeLevelAmplitude = amp; }
59 
63  virtual Ptr<MatchboxAmplitude>::tptr oneLoopAmplitude() const { return theOneLoopAmplitude; }
64 
68  void oneLoopAmplitude(Ptr<MatchboxAmplitude>::tptr amp) { theOneLoopAmplitude = amp; }
69 
74  bool isConsistent() const;
75 
76 public:
77 
80 
84  virtual bool canHandle(const PDVector& p,
85  Ptr<MatchboxFactory>::tptr f,
86  bool virt) const;
87 
92  virtual int nDimAdditional() const {
93  if ( !oneLoopAmplitude() )
94  return treeLevelAmplitude()->nDimAdditional();
95  return
96  treeLevelAmplitude()->nDimAdditional() ?
97  treeLevelAmplitude()->nDimAdditional() :
98  oneLoopAmplitude()->nDimAdditional();
99  }
100 
105  virtual Ptr<MatchboxMEBase>::ptr makeME(const PDVector& p) const {
106  return treeLevelAmplitude()->makeME(p);
107  }
108 
113  virtual void orderInGs(unsigned int n) {
114  treeLevelAmplitude()->orderInGs(n);
115  if ( oneLoopAmplitude() )
116  oneLoopAmplitude()->orderInGs(n);
117  }
118 
123  virtual unsigned int orderInGs() const {
124  return treeLevelAmplitude()->orderInGs();
125  }
126 
131  virtual void orderInGem(unsigned int n) {
132  treeLevelAmplitude()->orderInGem(n);
133  if ( oneLoopAmplitude() )
134  oneLoopAmplitude()->orderInGem(n);
135  }
136 
141  virtual unsigned int orderInGem() const {
142  return treeLevelAmplitude()->orderInGem();
143  }
144 
149  virtual bool hasInitialAverage() const {
150  return treeLevelAmplitude()->hasInitialAverage();
151  }
152 
157  virtual bool hasFinalStateSymmetry() const {
158  return treeLevelAmplitude()->hasFinalStateSymmetry();
159  }
160 
164  virtual bool isOLPTree() const { return false; }
165 
169  virtual bool isOLPLoop() const {
170  if ( !oneLoopAmplitude() )
171  return false;
172  return oneLoopAmplitude()->isOLPLoop();
173  }
174 
179  virtual bool needsOLPCorrelators() const {
180  return theUseOLPCorrelators;
181  }
182 
187  virtual bool startOLP(const map<pair<Process,int>,int>& procs) {
188  assert(oneLoopAmplitude());
189  return oneLoopAmplitude()->startOLP(procs);
190  }
191 
196  virtual bool isExternal() const {
197  return treeLevelAmplitude()->isExternal();
198  }
199 
203  virtual bool initializeExternal() {
204  return treeLevelAmplitude()->initializeExternal();
205  }
206 
210  virtual int externalId(const cPDVector& proc) {
211  return treeLevelAmplitude()->externalId(proc);
212  }
213 
215 
218 
222  virtual Ptr<ColourBasis>::tptr colourBasis() const {
223  return treeLevelAmplitude()->colourBasis();
224  }
225 
230  virtual bool haveColourFlows() const {
231  return treeLevelAmplitude()->haveColourFlows();
232  }
233 
238  virtual Selector<const ColourLines *> colourGeometries(tcDiagPtr diag) const {
239  return treeLevelAmplitude()->colourGeometries(diag);
240  }
241 
243 
246 
250  virtual void setXComb(tStdXCombPtr xc) {
251  treeLevelAmplitude()->setXComb(xc);
252  if ( oneLoopAmplitude() )
253  oneLoopAmplitude()->setXComb(xc);
254  lastMatchboxXComb(xc);
255  }
256 
263  virtual void fillCrossingMap(size_t shift = 0) {
264  treeLevelAmplitude()->fillCrossingMap(shift);
265  }
266 
268 
271 
276  virtual void prepareAmplitudes(Ptr<MatchboxMEBase>::tcptr);
277 
281  virtual double me2() const {
282  return treeLevelAmplitude()->me2();
283  }
284 
288  virtual double largeNME2(Ptr<ColourBasis>::tptr largeNBasis) const {
289  return treeLevelAmplitude()->largeNME2(largeNBasis);
290  }
291 
295  virtual double colourCorrelatedME2(pair<int,int> ij) const {
296  return
297  theUseOLPCorrelators ?
298  oneLoopAmplitude()->colourCorrelatedME2(ij) :
299  treeLevelAmplitude()->colourCorrelatedME2(ij);
300  }
301 
305  virtual double largeNColourCorrelatedME2(pair<int,int> ij,
306  Ptr<ColourBasis>::tptr largeNBasis) const {
307  return treeLevelAmplitude()->largeNColourCorrelatedME2(ij,largeNBasis);
308  }
309 
315  virtual LorentzVector<Complex> plusPolarization(const Lorentz5Momentum& p,
316  const Lorentz5Momentum& n,
317  int id = -1) const {
318  return
319  theUseOLPCorrelators ?
320  oneLoopAmplitude()->plusPolarization(p,n,id) :
321  treeLevelAmplitude()->plusPolarization(p,n,id);
322  }
323 
327  virtual double spinColourCorrelatedME2(pair<int,int> emitterSpectator,
328  const SpinCorrelationTensor& c) const {
329  return
330  theUseOLPCorrelators ?
331  oneLoopAmplitude()->spinColourCorrelatedME2(emitterSpectator,c) :
332  treeLevelAmplitude()->spinColourCorrelatedME2(emitterSpectator,c);
333  }
334 
338  virtual double spinCorrelatedME2(pair<int,int> emitterSpectator,
339  const SpinCorrelationTensor& c) const {
340  return
341  theUseOLPCorrelators ?
342  oneLoopAmplitude()->spinCorrelatedME2(emitterSpectator,c) :
343  treeLevelAmplitude()->spinCorrelatedME2(emitterSpectator,c);
344  }
345 
350  virtual bool canFillRhoMatrix() const {
351  return treeLevelAmplitude()->canFillRhoMatrix();
352  }
353 
358  virtual vector<unsigned int> physicalHelicities(const vector<int>& hel) const {
359  return treeLevelAmplitude()->physicalHelicities(hel);
360  }
361 
365  virtual bool treeAmplitudes() const {
366  return treeLevelAmplitude()->treeAmplitudes();
367  }
368 
373  virtual Complex evaluate(size_t a, const vector<int>& hel, Complex& largeN) {
374  return treeLevelAmplitude()->evaluate(a,hel,largeN);
375  }
376 
378 
381 
385  virtual void disableOneLoop() { oneLoopAmplitude(Ptr<MatchboxAmplitude>::ptr()); }
386 
391  virtual bool haveOneLoop() const { return oneLoopAmplitude(); }
392 
397  virtual bool onlyOneLoop() const { return false; }
398 
402  virtual bool oneLoopAmplitudes() const {
403  assert(oneLoopAmplitude());
404  return oneLoopAmplitude()->oneLoopAmplitudes();
405  }
406 
411  virtual bool isDRbar() const {
412  assert(oneLoopAmplitude());
413  return oneLoopAmplitude()->isDRbar();
414  }
415 
422  virtual bool isDR() const {
423  assert(oneLoopAmplitude());
424  return oneLoopAmplitude()->isDR();
425  }
426 
431  virtual bool isCS() const {
432  assert(oneLoopAmplitude());
433  return oneLoopAmplitude()->isCS();
434  }
435 
440  virtual bool isBDK() const {
441  assert(oneLoopAmplitude());
442  return oneLoopAmplitude()->isBDK();
443  }
444 
449  virtual bool isExpanded() const {
450  assert(oneLoopAmplitude());
451  return oneLoopAmplitude()->isExpanded();
452  }
453 
459  virtual Energy2 mu2() const {
460  assert(oneLoopAmplitude());
461  return oneLoopAmplitude()->mu2();
462  }
463 
468  double symmetryRatio() const;
469 
473  virtual bool hasRunningAlphaS() const {
474  return treeLevelAmplitude()->hasRunningAlphaS();
475  }
476 
480  virtual bool hasRunningAlphaEW() const {
481  return treeLevelAmplitude()->hasRunningAlphaEW();
482  }
483 
487  virtual double oneLoopDoublePole() const {
488  assert(oneLoopAmplitude());
489  return symmetryRatio()*oneLoopAmplitude()->oneLoopDoublePole();
490  }
491 
495  virtual double oneLoopSinglePole() const {
496  assert(oneLoopAmplitude());
497  return symmetryRatio()*oneLoopAmplitude()->oneLoopSinglePole();
498  }
499 
504  virtual void prepareOneLoopAmplitudes(Ptr<MatchboxMEBase>::tcptr);
505 
509  virtual double oneLoopInterference() const {
510  assert(oneLoopAmplitude());
511  return symmetryRatio()*oneLoopAmplitude()->oneLoopInterference();
512  }
513 
518  virtual Complex evaluateOneLoop(size_t a, const vector<int>& hel) {
519  assert(oneLoopAmplitude());
520  return oneLoopAmplitude()->evaluateOneLoop(a,hel);
521  }
522 
524 
527 
531  virtual void flushCaches() {
532  treeLevelAmplitude()->flushCaches();
533  if ( oneLoopAmplitude() )
534  oneLoopAmplitude()->flushCaches();
535  }
536 
540  virtual void cloneDependencies(const std::string& prefix= "" , bool slim=false);
542 
543 protected:
544 
547 
553  virtual void doinit();
554 
559  virtual void doinitrun();
561 
562 public:
563 
570  void persistentOutput(PersistentOStream & os) const;
571 
577  void persistentInput(PersistentIStream & is, int version);
579 
586  static void Init();
587 
588 protected:
589 
596  virtual IBPtr clone() const;
597 
602  virtual IBPtr fullclone() const;
604 
605 
606 // If needed, insert declarations of virtual function defined in the
607 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
608 
609 
610 private:
611 
615  Ptr<MatchboxAmplitude>::ptr theTreeLevelAmplitude;
616 
620  Ptr<MatchboxAmplitude>::ptr theOneLoopAmplitude;
621 
626 
631  MatchboxHybridAmplitude & operator=(const MatchboxHybridAmplitude &) = delete;
632 
633 };
634 
635 }
636 
637 #endif /* Herwig_MatchboxHybridAmplitude_H */
virtual void orderInGem(unsigned int n)
Set the (tree-level) order in in which this matrix element should be evaluated.
virtual bool initializeExternal()
Initialize this amplitude.
virtual bool isBDK() const
Return true, if one loop corrections are given in the conventions of BDK.
virtual Ptr< ColourBasis >::tptr colourBasis() const
Return the colour basis.
virtual bool hasRunningAlphaEW() const
Indicate that this amplitude is running alphaew by itself.
virtual bool treeAmplitudes() const
Return true, if tree-level contributions will be evaluated at amplitude level.
std::complex< double > Complex
virtual bool startOLP(const map< pair< Process, int >, int > &procs)
Start the one loop provider, if appropriate.
virtual bool hasFinalStateSymmetry() const
Return true, if this amplitude already includes symmetry factors for identical outgoing particles...
virtual bool isDR() const
Return true, if one loop corrections have been calculated in dimensional reduction.
virtual bool isExpanded() const
Return true, if one loop corrections are given in the conventions of everything expanded.
virtual void fillCrossingMap(size_t shift=0)
Perform a normal ordering of external legs and fill the crossing information as.
bool theUseOLPCorrelators
True, if correlators should be used from the OLP amplitude.
virtual bool isOLPLoop() const
Return true, if this amplitude is handled by a BLHA one-loop provider.
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 bool hasInitialAverage() const
Return true, if this amplitude already includes averaging over incoming parton&#39;s quantum numbers...
virtual double me2() const
Return the matrix element squared.
virtual bool hasRunningAlphaS() const
Indicate that this amplitude is running alphas by itself.
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
virtual double largeNColourCorrelatedME2(pair< int, int > ij, Ptr< ColourBasis >::tptr largeNBasis) const
Return the large-N colour correlated matrix element.
virtual double largeNME2(Ptr< ColourBasis >::tptr largeNBasis) const
Return the largeN matrix element squared.
virtual double spinColourCorrelatedME2(pair< int, int > emitterSpectator, const SpinCorrelationTensor &c) const
Return the colour and spin correlated matrix element.
virtual double oneLoopDoublePole() const
If defined, return the coefficient of the pole in epsilon^2.
virtual Complex evaluateOneLoop(size_t a, const vector< int > &hel)
Evaluate the amplitude for the given colour tensor id and helicity assignment.
virtual void disableOneLoop()
Diasble one-loop functionality if not needed.
Ptr< MatchboxAmplitude >::ptr theOneLoopAmplitude
The amplitude object to provide one-loop amplitudes.
virtual Energy2 mu2() const
Return the value of the dimensional regularization parameter.
virtual double oneLoopSinglePole() const
If defined, return the coefficient of the pole in epsilon.
MatchboxHybridAmplitude unifies two amplitude objects to provide tree and one-loop matrix elements...
virtual int nDimAdditional() const
Return the number of random numbers required to evaluate this amplitude at a fixed phase space point...
virtual bool needsOLPCorrelators() const
Return true, if colour and spin correlated matrix elements should be ordered from the OLP...
MatchboxAmplitude is the base class for amplitude implementations inside Matchbox.
void oneLoopAmplitude(Ptr< MatchboxAmplitude >::tptr amp)
Set the amplitude object to provide one-loop amplitudes.
Ptr< MatchboxAmplitude >::tptr treeLevelAmplitude() const
Return the amplitude object to provide tree-level amplitudes.
virtual bool oneLoopAmplitudes() const
Return true, if one-loop contributions will be evaluated at amplitude level.
virtual void flushCaches()
Flush all cashes.
virtual Ptr< MatchboxAmplitude >::tptr oneLoopAmplitude() const
Return the amplitude object to provide one-loop amplitudes.
virtual double spinCorrelatedME2(pair< int, int > emitterSpectator, const SpinCorrelationTensor &c) const
Return the spin correlated matrix element.
virtual unsigned int orderInGs() const
Return the (tree-level) order in in which this matrix element is given.
virtual double oneLoopInterference() const
Return the one-loop/tree interference.
virtual double colourCorrelatedME2(pair< int, int > ij) const
Return the colour correlated matrix element.
vector< cPDPtr > cPDVector
void treeLevelAmplitude(Ptr< MatchboxAmplitude >::tptr amp)
Set the amplitude object to provide tree-level amplitudes.
virtual bool canFillRhoMatrix() const
Return true, if this amplitude is capable of consistently filling the rho matrices for the spin corre...
virtual bool haveOneLoop() const
Return true, if this amplitude is capable of calculating one-loop (QCD) corrections.
virtual Complex evaluate(size_t a, const vector< int > &hel, Complex &largeN)
Evaluate the amplitude for the given colour tensor id and helicity assignment.
virtual Ptr< MatchboxMEBase >::ptr makeME(const PDVector &p) const
Return a ME instance appropriate for this amplitude and the given subprocesses.
virtual vector< unsigned int > physicalHelicities(const vector< int > &hel) const
Return the helicity combination of the physical process in the conventions used by the spin correlati...
virtual bool isExternal() const
Return true, if this amplitude needs to initialize an external code.
virtual void setXComb(tStdXCombPtr xc)
Set the xcomb object.
virtual bool isOLPTree() const
Return true, if this amplitude is handled by a BLHA one-loop provider.
virtual bool onlyOneLoop() const
Return true, if this amplitude only provides one-loop (QCD) corrections.
virtual int externalId(const cPDVector &proc)
Return a generic process id for the given process.
-*- C++ -*-
virtual bool isCS() const
Return true, if one loop corrections are given in the conventions of the integrated dipoles...
virtual unsigned int orderInGem() const
Return the (tree-level) order in in which this matrix element is given.
vector< PDPtr > PDVector
virtual void orderInGs(unsigned int n)
Set the (tree-level) order in in which this matrix element should be evaluated.
Ptr< MatchboxAmplitude >::ptr theTreeLevelAmplitude
The amplitude object to provide tree-level amplitudes.
virtual bool haveColourFlows() const
Return true, if the colour basis is capable of assigning colour flows.
SpinCorrelationTensor represents a spin correlation tensor of the form.
virtual bool isDRbar() const
Return true, if the amplitude is DRbar renormalized, otherwise MSbar is assumed.
virtual Selector< const ColourLines * > colourGeometries(tcDiagPtr diag) const
Return a Selector with possible colour geometries for the selected diagram weighted by their relative...