Back to home page

EIC code displayed by LXR

 
 

    


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

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