Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/Herwig/MatrixElement/Matchbox/Utility/AmplitudeCache.tcc is written in an unsupported language. File is not indexed.

0001 // -*- C++ -*-
0002 //
0003 // AmplitudeCache.cc is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 
0010 namespace Herwig {
0011 namespace SpinorHelicity {
0012 
0013 template<typename AmplitudeKey>
0014 void AmplitudeCache<AmplitudeKey>::nPoints(int n) {
0015 
0016   assert( n <= MAX_N );
0017 
0018   theNPoints = n;
0019 
0020   theMasses.fill({});
0021   theMomenta.fill({});
0022   theCrossingSigns.fill({});
0023   thePlusSpinors.fill(PlusSpinor());
0024   thePlusConjugateSpinors.fill(PlusConjugateSpinor());  
0025   theInvariants.fill({});
0026   thePlusProducts.fill({});
0027   thePlusCurrents.fill({});
0028 
0029   reset();    
0030 }
0031 
0032 template<typename AmplitudeKey>
0033 void AmplitudeCache<AmplitudeKey>::amplitudeScale(Energy s) const { 
0034   theScale = s;
0035   reset();
0036 }
0037 
0038 template<typename AmplitudeKey>
0039 void AmplitudeCache<AmplitudeKey>::momentum(int k, const LorentzMomentum& p, 
0040                               bool getSpinors,
0041                               Energy mass) const {
0042   theMasses[k] = mass/theScale;
0043   theMomenta[k] = p;
0044   if ( getSpinors ) {
0045     theCrossingSigns[k] = p.t() > ZERO ? 1 : -1;
0046     thePlusSpinors[k] = PlusSpinor(p);
0047     thePlusConjugateSpinors[k] = PlusConjugateSpinor(p);
0048   }
0049 }
0050 
0051 template<typename AmplitudeKey>
0052 void AmplitudeCache<AmplitudeKey>::reset() const {
0053   getInvariant.fill(true);
0054   getPlusProduct.fill(true);
0055   getPlusCurrent.fill(true);
0056   for_each(theCachedAmplitudes.begin(),theCachedAmplitudes.end(),boolResetter());
0057   for_each(theCachedCurrents.begin(),theCachedCurrents.end(),boolResetter());
0058 }
0059 
0060 }}