Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:38:24

0001 // -*- C++ -*-
0002 //
0003 // SpinorWaveFunction.h is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 2003-2019 Peter Richardson, Leif Lonnblad
0005 //
0006 // ThePEG 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 #ifndef ThePEG_SpinorWaveFunction_H
0010 #define ThePEG_SpinorWaveFunction_H
0011 //
0012 // This is the declaration of the SpinorWaveFunction class.
0013 //
0014 #include "WaveFunctionBase.h"
0015 #include <ThePEG/Helicity/LorentzSpinor.h>
0016 #include <ThePEG/Helicity/FermionSpinInfo.h>
0017 #include <ThePEG/EventRecord/Particle.h>
0018 #include <ThePEG/EventRecord/RhoDMatrix.h>
0019 
0020 namespace ThePEG {
0021 
0022 namespace Helicity {
0023 
0024 /**
0025  *  Forward declaration of the SpinorBarWaveFunction class
0026  */
0027 class SpinorBarWaveFunction;
0028 
0029 /** \ingroup Helicity
0030  *  \author Peter Richardson
0031  *
0032  *  The SpinorWaveFunction class is designed to store the wavefunction
0033  *  of a spinor in a form suitable for use in helicity amplitude calculations 
0034  *  of the matrix element using a similar philosophy to the FORTRAN HELAS code.
0035  *
0036  *  In addition to storing the spinor using the LorentzSpinor class
0037  *  it inherits from the WaveFunctionBase class to provide storage of
0038  *  the momentum and getParticleData for the fermion.
0039  *
0040  *  This class also contains the code which does the actually calculation 
0041  *  of the spinor for an external particle.
0042  *
0043  *  When calculating the wavefunction the direction of the particle is used,
0044  *
0045  *  \e i.e. 
0046  *  - incoming calculates a \f$u\f$ spinor.
0047  *  - outgoing calculates a \f$v\f$ spinor.
0048  *
0049  *  N.B. In our convention 0 is the \f$-\frac12\f$ helicity state and 
0050  *        1 is the \f$+\frac12\f$ helicity state
0051  *
0052  *  @see WaveFunctionBase
0053  *  @see LorentzSpinor
0054  *  @see HelicityDefinitions
0055  */
0056 class SpinorWaveFunction : public WaveFunctionBase {
0057 
0058 public:
0059 
0060   /** @name Standard constructors and destructors. */
0061   //@{
0062   /**
0063    * Constructor, set the momentum and the components of the spinor.
0064    * @param p The momentum.
0065    * @param part The ParticleData pointer.
0066    * @param s1 The first component
0067    * @param s2 The second component
0068    * @param s3 The third component
0069    * @param s4 The fourth component
0070    */
0071   SpinorWaveFunction(const Lorentz5Momentum & p,tcPDPtr part,complex<double> s1,
0072              complex<double> s2,complex<double> s3,complex<double> s4)
0073     : WaveFunctionBase(p,part), _wf(s1,s2,s3,s4)
0074   {
0075     assert(iSpin()==2);
0076   }
0077 
0078   /**
0079    * Constructor, set the momentum and the wavefunction.
0080    * @param p The momentum.
0081    * @param part The ParticleData pointer.
0082    * @param wave The wavefunction.
0083    * @param dir The direction of the particle
0084    */
0085   SpinorWaveFunction(const Lorentz5Momentum & p, tcPDPtr part,
0086              const LorentzSpinor<double> & wave,
0087              Direction dir=intermediate) 
0088     : WaveFunctionBase(p,part,dir), _wf(wave)
0089   {
0090     assert(iSpin()==2);
0091   }
0092 
0093   /**
0094    * Constructor, set the momentum and the wavefunction.
0095    * @param p The particle
0096    * @param wave The wavefunction.
0097    * @param dir The direction of the particle
0098    */
0099   SpinorWaveFunction(const tPPtr & p, const LorentzSpinor<SqrtEnergy> & wave,
0100              Direction dir=intermediate) 
0101     : WaveFunctionBase(p->momentum(), p->dataPtr(), dir), _wf(wave.Type())
0102   {
0103     assert(iSpin()==2);
0104     for (unsigned int i=0; i<4; ++i)
0105       _wf[i]=Complex(wave[i]*UnitRemoval::InvSqrtE);
0106   }
0107 
0108   /**
0109    * Constructor, set the momentum, helicity, direction.
0110    * @param p The momentum.
0111    * @param part The ParticleData pointer.
0112    * @param ihel The helicity (0,1 as described above.)
0113    * @param dir The direction.
0114    */
0115   SpinorWaveFunction(const Lorentz5Momentum & p,tcPDPtr part,
0116              unsigned int ihel,
0117              Direction dir) 
0118     : WaveFunctionBase(p,part,dir)
0119   {
0120     assert(iSpin()==2);
0121     calculateWaveFunction(ihel);
0122   }
0123 
0124   /**
0125    * Constructor, set the momentum, direction, zero the 
0126    * wavefunction.
0127    * @param p The momentum.
0128    * @param part The ParticleData pointer.
0129    * @param dir The direction.
0130    */
0131   SpinorWaveFunction(const Lorentz5Momentum & p,
0132              tcPDPtr part,Direction dir)
0133     : WaveFunctionBase(p,part,dir), _wf()
0134   {
0135     assert(iSpin()==2);
0136   }
0137   
0138   /**
0139    * Default constructor.
0140    */
0141   SpinorWaveFunction() 
0142     : WaveFunctionBase(), _wf()
0143   {}
0144 
0145   /**
0146    *  Special for spin correlations
0147    */
0148   SpinorWaveFunction(vector<SpinorWaveFunction> & wave,
0149              tPPtr part,Direction dir,bool time,bool=true) {
0150     calculateWaveFunctions(wave,part,dir);
0151     constructSpinInfo(wave,part,dir,time);
0152   }
0153   //@}
0154 
0155   /**
0156    *  Access to the wavefunction and its components.
0157    */
0158   //@{
0159   /**
0160    * Subscript operator for the wavefunction.
0161    */
0162   complex<double> operator ()(int i) const {
0163     assert(i>=0 &&i<=3);
0164     return _wf(i);
0165   }
0166 
0167   /**
0168    * Return wavefunction as LorentzSpinor<double>.
0169    */
0170   const LorentzSpinor<double> & wave() const {return _wf;}
0171 
0172   /**
0173    * Return wavefunction as LorentzSpinor<SqrtEnergy>.
0174    */
0175   LorentzSpinor<SqrtEnergy> dimensionedWave() const {return dimensionedWf();}
0176 
0177   /**
0178    * Get the first spin component component.
0179    */
0180   complex<double> s1() const {return _wf.s1();}
0181 
0182   /**
0183    * Get the second spin component component.
0184    */
0185   complex<double> s2() const {return _wf.s2();}
0186 
0187   /**
0188    * Get the third spin component component.
0189    */
0190   complex<double> s3() const {return _wf.s3();}
0191 
0192   /**
0193    * Get the fourth spin component component.
0194    */
0195   complex<double> s4() const {return _wf.s4();}
0196   //@}
0197 
0198   /**
0199    * Take the conjugate of the spinor \f$u_c=C\bar{u}^T\f$. This operation
0200    * transforms u-spinors to v-spinors and vice-versa and is required when
0201    * dealing with majorana particles.
0202    */
0203   void conjugate() {
0204     _wf=_wf.conjugate();
0205   }
0206 
0207   /**
0208    * Return the barred spinor
0209    */
0210   SpinorBarWaveFunction bar();
0211 
0212   /**
0213    * Reset functions.
0214    */
0215   //@{
0216   /**
0217    * Reset the helicity (calculates the new spinor).
0218    * @param ihel The helicity (0,1 as described above.)
0219    */
0220   void reset(unsigned int ihel) {
0221     calculateWaveFunction(ihel);
0222   }
0223   //@}
0224 
0225 public:
0226 
0227   /**
0228    *  Perform the Lorentz transformation of the wave function
0229    */
0230   void transform(const LorentzRotation & r) {
0231     _wf.transform(r);
0232     transformMomentum(r);
0233   }
0234 
0235 public:
0236 
0237   /**
0238    *  Calculate the wavefunctions
0239    */
0240   static void calculateWaveFunctions(vector<LorentzSpinor<SqrtEnergy> > & waves,
0241                      tPPtr particle,Direction);
0242 
0243   /**
0244    *  Calculate the wavefunctions
0245    */
0246   static void calculateWaveFunctions(vector<SpinorWaveFunction> & waves,
0247                      tPPtr particle,Direction);
0248 
0249   /**
0250    *  Calculate the wavefunctions
0251    */
0252   static void calculateWaveFunctions(vector<SpinorWaveFunction> & waves,
0253                      const Lorentz5Momentum & momentum,
0254                      tcPDPtr parton,Direction);
0255 
0256   /**
0257    *  Calculate the wavefunctions
0258    */
0259   static void calculateWaveFunctions(vector<LorentzSpinor<SqrtEnergy> > & waves,
0260                      RhoDMatrix & rho,
0261                      tPPtr particle,Direction);
0262 
0263   /**
0264    *  Calculate the wavefunctions
0265    */
0266   static void calculateWaveFunctions(vector<SpinorWaveFunction> & waves,
0267                      RhoDMatrix & rho,
0268                      tPPtr particle,Direction);
0269 
0270   /**
0271    *  Construct the SpinInfo object
0272    */
0273   static void constructSpinInfo(const vector<LorentzSpinor<SqrtEnergy> > & waves,
0274                 tPPtr part,Direction dir, bool time);
0275 
0276   /**
0277    *  Construct the SpinInfo object
0278    */
0279   static void constructSpinInfo(const vector<SpinorWaveFunction> & waves,
0280                 tPPtr part,Direction dir, bool time);
0281   
0282 
0283 private:
0284 
0285   /**
0286    * Calcuate the wavefunction.
0287    * @param ihel The helicity (0,1 as described above.)
0288    */
0289   void calculateWaveFunction(unsigned int ihel);
0290 
0291 private:
0292 
0293   /**
0294    * Storage of the Lorentz Spinor.
0295    */
0296   LorentzSpinor<double> _wf;
0297 
0298   /// Return wavefunction as LorentzSpinor<SqrtEnergy>
0299   LorentzSpinor<SqrtEnergy> dimensionedWf() const {
0300     LorentzSpinor<SqrtEnergy> temp(_wf.Type());
0301     for (unsigned int i=0; i<4; ++i)
0302       temp(i) = _wf(i)*UnitRemoval::SqrtE;
0303     return temp;
0304   }
0305   
0306 };
0307 
0308 }
0309 
0310 }
0311 #endif
0312 
0313 
0314 
0315