herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey > Class Template Reference

Caching for amplitudes using spinor helicity techniques. More...

#include <AmplitudeCache.h>

Inheritance diagram for Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >:

Classes

struct  boolResetter
 Helper to reset flags. More...
 

Public Member Functions

 AmplitudeCache ()
 Constructor.
 
void nPoints (int n)
 Prepare for n-point amplitude.
 
int nPoints () const
 Return the number of points.
 
void amplitudeScale (Energy s) const
 Set the energy scale to obtain dimensionless quantities and flag all quantities to be recalculated.
 
void momentum (int k, const LorentzMomentum &p, bool getSpinors=true, Energy mass=ZERO) const
 Set the momentum for the k'th parton and its associated mass.
 
void reset () const
 Reset flags.
 
LorentzVector< double > momentum (int k) const
 Return the momentum for the k'th parton.
 
Energy amplitudeScale () const
 Get the energy scale to obtain dimensionless quantities and flag all quantities to be recalculated.
 
double mass (int k) const
 Return the mass associated to the k'th parton.
 
int crossingSign (int i) const
 Return the crossing sign for the i'th parton.
 
double crossingSign (int i, int j) const
 Return the crossing sign for the i'th and j'th parton.
 
double invariant (int i, int j) const
 Return (ij)
 
Complex plusProduct (int i, int j) const
 Return <ij>
 
Complex minusProduct (int i, int j) const
 Return [ij].
 
LorentzVector< ComplexplusCurrent (int i, int j) const
 Return <i|\gamma^\mu|j].
 
LorentzVector< ComplexminusCurrent (int i, int j) const
 Return [i|\gamma^\mu|j>
 
bool getAmplitude (const AmplitudeKey &key) const
 Return true, if the given amplitude needs to be recalculated.
 
void cacheAmplitude (Complex amp) const
 Cache an amplitude.
 
const ComplexcachedAmplitude () const
 Return a cached amplitude.
 
bool getCurrent (const AmplitudeKey &key) const
 Return true, if the given current needs to be recalculated.
 
void cacheCurrent (const LorentzVector< Complex > &curr) const
 Cache an current.
 
const LorentzVector< Complex > & cachedCurrent () const
 Return a cached current.
 

Private Types

enum  { MAX_N = 7 , SYM_N = MAX_N*(MAX_N+1)/2 }
 Maximum N we can handle, SYM_N is storage size for a symmetric matrix of N * N elements. More...
 
typedef map< AmplitudeKey, pair< bool, Complex > > AmplitudeCacheMap
 
typedef map< AmplitudeKey, pair< bool, LorentzVector< Complex > > > CurrentCacheMap
 

Private Member Functions

size_t idx (size_t i, size_t j) const
 Helper function to index symmetric arrays, assumes i <= j.
 

Private Attributes

int theNPoints
 The number of points.
 
Energy theScale
 The energy scale to obtain dimensionless quantities.
 
array< double, MAX_N > theMasses
 Masses indexed by partons.
 
array< LorentzMomentum, MAX_N > theMomenta
 Momenta indexed by partons.
 
array< int, MAX_N > theCrossingSigns
 Crossing signs indexed by partons.
 
array< PlusSpinor, MAX_N > thePlusSpinors
 Plus spinors indexed by partons.
 
array< PlusConjugateSpinor, MAX_N > thePlusConjugateSpinors
 Plus conjugate spinors indexed by partons.
 
array< double, SYM_N > theInvariants
 Invariants indexed by partons.
 
array< bool, SYM_N > getInvariant
 Flag products to be recalculated.
 
array< Complex, SYM_N > thePlusProducts
 Spinor products indexed by partons.
 
array< bool, SYM_N > getPlusProduct
 Flag products to be recalculated.
 
array< LorentzVector< Complex >, SYM_N > thePlusCurrents
 Spinor currents indexed by partons.
 
array< bool, SYM_N > getPlusCurrent
 Flag currents to be recalculated.
 
AmplitudeCacheMap theCachedAmplitudes
 Cache intermediate amplitudes by index.
 
AmplitudeCacheMap::iterator theLastAmplitude
 The last query for a cached amplitude.
 
CurrentCacheMap theCachedCurrents
 Cache intermediate currents by index.
 
CurrentCacheMap::iterator theLastCurrent
 The last query for a cached current.
 

Detailed Description

template<typename AmplitudeKey>
class Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >

Caching for amplitudes using spinor helicity techniques.

Author
Simon Platzer

Definition at line 31 of file AmplitudeCache.h.

Member Typedef Documentation

◆ AmplitudeCacheMap

template<typename AmplitudeKey >
typedef map<AmplitudeKey,pair<bool,Complex> > Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::AmplitudeCacheMap
private

Definition at line 33 of file AmplitudeCache.h.

◆ CurrentCacheMap

template<typename AmplitudeKey >
typedef map<AmplitudeKey,pair<bool,LorentzVector<Complex> > > Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::CurrentCacheMap
private

Definition at line 34 of file AmplitudeCache.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename AmplitudeKey >
anonymous enum
private

Maximum N we can handle, SYM_N is storage size for a symmetric matrix of N * N elements.

Definition at line 39 of file AmplitudeCache.h.

Constructor & Destructor Documentation

◆ AmplitudeCache()

template<typename AmplitudeKey >
Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::AmplitudeCache ( )
inline

Constructor.

Definition at line 152 of file AmplitudeCache.h.

Member Function Documentation

◆ amplitudeScale()

template<typename AmplitudeKey >
Energy Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::amplitudeScale ( ) const
inline

Get the energy scale to obtain dimensionless quantities and flag all quantities to be recalculated.

Definition at line 196 of file AmplitudeCache.h.

References Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theScale.

◆ cacheAmplitude()

template<typename AmplitudeKey >
void Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::cacheAmplitude ( Complex  amp) const
inline

Cache an amplitude.

Definition at line 300 of file AmplitudeCache.h.

References Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theLastAmplitude.

◆ cacheCurrent()

template<typename AmplitudeKey >
void Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::cacheCurrent ( const LorentzVector< Complex > &  curr) const
inline

Cache an current.

Definition at line 327 of file AmplitudeCache.h.

References Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theLastCurrent.

◆ cachedAmplitude()

template<typename AmplitudeKey >
const Complex & Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::cachedAmplitude ( ) const
inline

Return a cached amplitude.

Definition at line 307 of file AmplitudeCache.h.

References Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theLastAmplitude.

◆ cachedCurrent()

template<typename AmplitudeKey >
const LorentzVector< Complex > & Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::cachedCurrent ( ) const
inline

Return a cached current.

Definition at line 334 of file AmplitudeCache.h.

References Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theLastCurrent.

◆ crossingSign() [1/2]

template<typename AmplitudeKey >
int Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::crossingSign ( int  i) const
inline

◆ crossingSign() [2/2]

template<typename AmplitudeKey >
double Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::crossingSign ( int  i,
int  j 
) const
inline

Return the crossing sign for the i'th and j'th parton.

Definition at line 213 of file AmplitudeCache.h.

References Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theCrossingSigns.

◆ getAmplitude()

template<typename AmplitudeKey >
bool Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::getAmplitude ( const AmplitudeKey &  key) const
inline

Return true, if the given amplitude needs to be recalculated.

Definition at line 288 of file AmplitudeCache.h.

References Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theCachedAmplitudes, and Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theLastAmplitude.

◆ getCurrent()

template<typename AmplitudeKey >
bool Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::getCurrent ( const AmplitudeKey &  key) const
inline

Return true, if the given current needs to be recalculated.

Definition at line 315 of file AmplitudeCache.h.

References Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theCachedCurrents, and Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theLastCurrent.

◆ idx()

template<typename AmplitudeKey >
size_t Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::idx ( size_t  i,
size_t  j 
) const
inlineprivate

Helper function to index symmetric arrays, assumes i <= j.

Usual indexing function (N*i + j) corrected by triangle number for i-th row.

Definition at line 131 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::invariant(), Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::plusCurrent(), and Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::plusProduct().

◆ invariant()

◆ mass()

template<typename AmplitudeKey >
double Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::mass ( int  k) const
inline

Return the mass associated to the k'th parton.

Definition at line 201 of file AmplitudeCache.h.

References Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theMasses.

◆ minusCurrent()

template<typename AmplitudeKey >
LorentzVector< Complex > Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::minusCurrent ( int  i,
int  j 
) const
inline

Return [i|\gamma^\mu|j>

Definition at line 278 of file AmplitudeCache.h.

References Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::plusCurrent().

◆ minusProduct()

template<typename AmplitudeKey >
Complex Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::minusProduct ( int  i,
int  j 
) const
inline

◆ momentum()

template<typename AmplitudeKey >
LorentzVector< double > Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::momentum ( int  k) const
inline

◆ nPoints()

template<typename AmplitudeKey >
int Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::nPoints ( ) const
inline

Return the number of points.

Definition at line 162 of file AmplitudeCache.h.

References Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theNPoints.

◆ plusCurrent()

◆ plusProduct()

Member Data Documentation

◆ getInvariant

template<typename AmplitudeKey >
array<bool,SYM_N> Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::getInvariant
mutableprivate

Flag products to be recalculated.

Definition at line 85 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::invariant().

◆ getPlusCurrent

template<typename AmplitudeKey >
array<bool,SYM_N> Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::getPlusCurrent
mutableprivate

Flag currents to be recalculated.

Definition at line 105 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::plusCurrent().

◆ getPlusProduct

template<typename AmplitudeKey >
array<bool,SYM_N> Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::getPlusProduct
mutableprivate

Flag products to be recalculated.

Definition at line 95 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::plusProduct().

◆ theCachedAmplitudes

template<typename AmplitudeKey >
AmplitudeCacheMap Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theCachedAmplitudes
mutableprivate

Cache intermediate amplitudes by index.

Definition at line 110 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::getAmplitude().

◆ theCachedCurrents

template<typename AmplitudeKey >
CurrentCacheMap Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theCachedCurrents
mutableprivate

Cache intermediate currents by index.

Definition at line 120 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::getCurrent().

◆ theCrossingSigns

template<typename AmplitudeKey >
array<int,MAX_N> Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theCrossingSigns
mutableprivate

Crossing signs indexed by partons.

Definition at line 65 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::crossingSign().

◆ theInvariants

template<typename AmplitudeKey >
array<double,SYM_N> Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theInvariants
mutableprivate

Invariants indexed by partons.

Definition at line 80 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::invariant().

◆ theLastAmplitude

template<typename AmplitudeKey >
AmplitudeCacheMap::iterator Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theLastAmplitude
mutableprivate

◆ theLastCurrent

template<typename AmplitudeKey >
CurrentCacheMap::iterator Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theLastCurrent
mutableprivate

◆ theMasses

template<typename AmplitudeKey >
array<double,MAX_N> Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theMasses
mutableprivate

Masses indexed by partons.

Definition at line 55 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::mass().

◆ theMomenta

template<typename AmplitudeKey >
array<LorentzMomentum,MAX_N> Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theMomenta
mutableprivate

◆ theNPoints

template<typename AmplitudeKey >
int Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::theNPoints
private

The number of points.

Definition at line 44 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::nPoints().

◆ thePlusConjugateSpinors

template<typename AmplitudeKey >
array<PlusConjugateSpinor,MAX_N> Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::thePlusConjugateSpinors
mutableprivate

◆ thePlusCurrents

template<typename AmplitudeKey >
array<LorentzVector<Complex>,SYM_N> Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::thePlusCurrents
mutableprivate

Spinor currents indexed by partons.

Definition at line 100 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::plusCurrent().

◆ thePlusProducts

template<typename AmplitudeKey >
array<Complex,SYM_N> Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::thePlusProducts
mutableprivate

Spinor products indexed by partons.

Definition at line 90 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::plusProduct().

◆ thePlusSpinors

template<typename AmplitudeKey >
array<PlusSpinor,MAX_N> Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::thePlusSpinors
mutableprivate

Plus spinors indexed by partons.

Definition at line 70 of file AmplitudeCache.h.

Referenced by Herwig::SpinorHelicity::AmplitudeCache< AmplitudeKey >::plusProduct().

◆ theScale


The documentation for this class was generated from the following file: