Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // TensorWaveFunction.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_TensorWaveFunction_H
0010 #define ThePEG_TensorWaveFunction_H
0011 //
0012 // This is the declaration of the TensorWaveFunction class.
0013 //
0014 #include "WaveFunctionBase.h"
0015 #include "VectorWaveFunction.h"
0016 #include <ThePEG/Helicity/LorentzTensor.h>
0017 #include <ThePEG/Helicity/TensorSpinInfo.h>
0018 #include <ThePEG/EventRecord/Particle.h>
0019 #include <ThePEG/EventRecord/RhoDMatrix.h>
0020 
0021 namespace ThePEG {
0022 namespace Helicity {
0023 
0024 /**\ingroup Helicity
0025  * Definition of the enumerated values of the phase to include in the 
0026  * calculation of the polarization tensor.
0027  */
0028 enum TensorPhase {
0029   tensor_phase, /**< Include the phase factor.*/
0030   tensor_nophase, /**< No phase-factor. */
0031   default_tensor_phase=tensor_nophase /**< Default option.*/
0032 };
0033 
0034 /** \ingroup Helicity
0035  *  \author Peter Richardson
0036  *
0037  *  The TensorWaveFunction class is designed to store the wavefunction
0038  *  of a tensor in a form suitable for use in helicity amplitude 
0039  *  calculations of the matrix element using a similar philosophy to the 
0040  *  FORTRAN HELAS code.
0041  * 
0042  *  In addition to storing the tensor using the LorentzTensor class
0043  *  it inherits from the WaveFunctionBase class to provide storage of
0044  *  the momentum and ParticleData for the tensor particle.
0045  *
0046  *  This class also contains the code which does the actually 
0047  *  calculation of the tensor wavefunction.
0048  *
0049  *  There are two choices available for the calculation of the 
0050  *  wavefunction. These are set using the TensorPhase enumeration 
0051  *  which specifies a default choice.
0052  *  The first choice, tensor_phase, includes a phase factor 
0053  *  \f$\exp(\pm i \phi)\f$ for the \f$\pm\f$ helicity states while the second, 
0054  *  tensor_nophase, does not.
0055  *
0056  *  N.B. In our convention 
0057  *        0 is the \f$-2\f$ helicity state,
0058  *        1 is the \f$-1\f$ helicity state,
0059  *        2 is the \f$ 0\f$ helicity state,
0060  *        3 is the \f$+1\f$ helicity state and
0061  *        4 is the \f$+2\f$ helicity state.
0062  *
0063  *  @see WaveFunctionBase
0064  *  @see LorentzTensor
0065  *  @see VectorWaveFunction
0066  */
0067 class TensorWaveFunction : public WaveFunctionBase {
0068 
0069 public:
0070 
0071   /** @name Standard constructors and destructors. */
0072   //@{
0073   /**
0074    * Constructor, set the momentum and Wavefunction, the direction can also
0075    * be specified. 
0076    * @param p The momentum.
0077    * @param part The ParticleData pointer
0078    * @param wave The wavefunction, \e i.e. the polarization vector.
0079    * @param dir The direction of the particle.
0080    */
0081   TensorWaveFunction(const Lorentz5Momentum & p,tcPDPtr part,
0082              const LorentzTensor<double> & wave,
0083              Direction  dir=intermediate) 
0084     : WaveFunctionBase(p,part,dir), _wf(wave)
0085   {
0086     assert(iSpin()==PDT::Spin2);
0087   }
0088 
0089   /**
0090    * Constructor, set the momentum and the components of the tensor.
0091    * @param p The momentum.
0092    * @param part The ParticleData pointer
0093    * @param xx The \f$xx\f$ component.
0094    * @param xy The \f$xy\f$ component.
0095    * @param xz The \f$xz\f$ component.
0096    * @param xt The \f$xt\f$ component.
0097    * @param yx The \f$yx\f$ component.
0098    * @param yy The \f$yy\f$ component.
0099    * @param yz The \f$yz\f$ component.
0100    * @param yt The \f$yt\f$ component.
0101    * @param zx The \f$zx\f$ component.
0102    * @param zy The \f$zy\f$ component.
0103    * @param zz The \f$zz\f$ component.
0104    * @param zt The \f$zt\f$ component.
0105    * @param tx The \f$tx\f$ component.
0106    * @param ty The \f$ty\f$ component.
0107    * @param tz The \f$tz\f$ component.
0108    * @param tt The \f$tt\f$ component.
0109    */
0110   TensorWaveFunction(const Lorentz5Momentum & p,tcPDPtr part,
0111              Complex xx,Complex xy,Complex xz,Complex xt,Complex yx,
0112              Complex yy,Complex yz,Complex yt,Complex zx,Complex zy,
0113              Complex zz,Complex zt,Complex tx,Complex ty,Complex tz,
0114              Complex tt) 
0115     : WaveFunctionBase(p,part), _wf(xx,xy,xz,xt,
0116                     yx,yy,yz,yt,
0117                     zx,zy,zz,zt,
0118                     tx,ty,tz,tt)
0119   {
0120     assert(iSpin()==PDT::Spin2);
0121   }
0122 
0123   /**
0124    * Constructor, set the momentum, helicity, direction and optionally the phase
0125    * @param p The momentum.
0126    * @param part The ParticleData pointer
0127    * @param ihel The helicity (0,1,2,3,4 as described above.)
0128    * @param dir The direction.
0129    * @param phase The phase choice.
0130    */
0131   TensorWaveFunction(const Lorentz5Momentum & p,tcPDPtr part,
0132              unsigned int ihel,Direction dir,
0133              TensorPhase phase=default_tensor_phase) 
0134     : WaveFunctionBase(p,part,dir)
0135   {
0136     assert(iSpin()==PDT::Spin2);
0137     calculateWaveFunction(ihel,phase);
0138   }
0139 
0140   /**
0141    * Constructor, set the 5-momentum and direction, zero the wavefunction.
0142    * @param p The momentum.
0143    * @param part The ParticleData pointer.
0144    * @param dir The direction.
0145    */
0146   TensorWaveFunction(const Lorentz5Momentum & p,
0147              tcPDPtr part,Direction dir) 
0148     : WaveFunctionBase(p,part,dir), _wf()
0149   {
0150     assert(iSpin()==PDT::Spin2);
0151   }
0152 
0153   /** 
0154    * Default constructor.
0155    */
0156   TensorWaveFunction() {}
0157 
0158   /**
0159    *  Special for spin correlations \todo make static?
0160    */
0161   TensorWaveFunction(vector<TensorWaveFunction> & wave,
0162              tPPtr part,Direction dir,bool time,bool massless,
0163              bool=true,
0164              TensorPhase phase=default_tensor_phase) {
0165     calculateWaveFunctions(wave,part,dir,massless,phase);
0166     constructSpinInfo(wave,part,dir,time,massless);
0167   }
0168   //@}
0169 
0170   /**
0171    *  Access to the wavefunction and its components.
0172    */
0173   //@{
0174   /**
0175    * Subscript operator for the wavefunction.
0176    */
0177   Complex operator ()(int i, int j) const {
0178     return _wf(i,j);
0179   }
0180 
0181   /**
0182    * Set components by index.
0183    */
0184   Complex & operator () (int i, int j) {
0185     return _wf(i,j);
0186   }
0187 
0188   /**
0189    * Return wavefunction as polarization vector.
0190    */
0191   const LorentzTensor<double> & wave() const {return _wf;}
0192 
0193   /**
0194    * Get the \f$xx\f$ component.
0195    */
0196   Complex xx() const {return _wf.xx();}
0197 
0198   /**
0199    * Get the \f$yx\f$ component.
0200    */
0201   Complex yx() const {return _wf.yx();}
0202 
0203   /**
0204    * Get the \f$zx\f$ component.
0205    */
0206   Complex zx() const {return _wf.zx();}
0207 
0208   /**
0209    * Get the \f$tx\f$ component.
0210    */
0211   Complex tx() const {return _wf.tx();}
0212 
0213   /**
0214    * Get the \f$xy\f$ component.
0215    */
0216   Complex xy() const {return _wf.xy();}
0217 
0218   /**
0219    * Get the \f$yy\f$ component.
0220    */
0221   Complex yy() const {return _wf.yy();}
0222 
0223   /**
0224    * Get the \f$zy\f$ component.
0225    */
0226   Complex zy() const {return _wf.zy();}
0227 
0228   /**
0229    * Get the \f$ty\f$ component.
0230    */
0231   Complex ty() const {return _wf.ty();}
0232 
0233   /**
0234    * Get the \f$xz\f$ component.
0235    */
0236   Complex xz() const {return _wf.xz();}
0237 
0238   /**
0239    * Get the \f$yz\f$ component.
0240    */
0241   Complex yz() const {return _wf.yz();}
0242 
0243   /**
0244    * Get the \f$zz\f$ component.
0245    */
0246   Complex zz() const {return _wf.zz();}
0247 
0248   /**
0249    * Get the \f$tz\f$ component.
0250    */
0251   Complex tz() const {return _wf.tz();}
0252 
0253   /**
0254    * Get the \f$xt\f$ component.
0255    */
0256   Complex xt() const {return _wf.xt();}
0257 
0258   /**
0259    * Get the \f$yt\f$ component.
0260    */
0261   Complex yt() const {return _wf.yt();}
0262 
0263   /**
0264    * Get the \f$zt\f$ component.
0265    */
0266   Complex zt() const {return _wf.zt();}
0267 
0268   /**
0269    * Get the \f$tt\f$ component.
0270    */
0271   Complex tt() const {return _wf.tt();}
0272   //@}
0273 
0274   /**
0275    * Reset functions.
0276    */
0277   //@{
0278 
0279   /**
0280    * Reset helicity (recalculate the tensor ).
0281    * @param ihel The new helicity (0,1,2,3,4 as described above.)
0282    * @param phase The phase choice.
0283    */
0284   void reset(unsigned int ihel,TensorPhase phase=default_tensor_phase) {
0285     calculateWaveFunction(ihel,phase);
0286   }
0287   //@}
0288 
0289 public:
0290 
0291   /**
0292    *  Perform the Lorentz transformation of the wave function
0293    */
0294   void transform(const LorentzRotation & r) {
0295     _wf.transform(r);
0296     transformMomentum(r);
0297   }
0298 
0299 public:
0300 
0301   /**
0302    *  Calculate the wavefunctions
0303    */
0304   static void calculateWaveFunctions(vector<LorentzTensor<double> > & waves,
0305                      tPPtr particle,Direction,bool massless,
0306                      TensorPhase phase=default_tensor_phase);
0307 
0308   /**
0309    *  Calculate the wavefunctions
0310    */
0311   static void calculateWaveFunctions(vector<TensorWaveFunction> & waves,
0312                      tPPtr particle,Direction,bool massless,
0313                      TensorPhase phase=default_tensor_phase);
0314 
0315   /**
0316    *  Calculate the wavefunctions
0317    */
0318   static void calculateWaveFunctions(vector<LorentzTensor<double> > & waves,
0319                      RhoDMatrix & rho,
0320                      tPPtr particle,Direction,bool massless,
0321                      TensorPhase phase=default_tensor_phase);
0322 
0323   /**
0324    *  Calculate the wavefunctions
0325    */
0326   static void calculateWaveFunctions(vector<TensorWaveFunction> & waves,
0327                      RhoDMatrix & rho,
0328                      tPPtr particle,Direction,bool massless,
0329                      TensorPhase phase=default_tensor_phase);
0330 
0331   /**
0332    *  Construct the SpinInfo object
0333    */
0334   static void constructSpinInfo(const vector<LorentzTensor<double> > & waves,
0335                 tPPtr part,Direction dir, bool time,bool massless);
0336 
0337   /**
0338    *  Construct the SpinInfo object
0339    */
0340   static void constructSpinInfo(const vector<TensorWaveFunction> & waves,
0341                 tPPtr part,Direction dir, bool time,bool massless);
0342 
0343 private:
0344 
0345   /**
0346    * Calculate the wavefunction.
0347    * @param ihel The helicity (0,1,2,3,4 as described above.)
0348    * @param phase The phase choice.
0349    */
0350   void calculateWaveFunction(unsigned int ihel,
0351                  TensorPhase phase=default_tensor_phase);
0352 
0353 private:
0354 
0355   /**
0356    * Storage of the wavefunction as a Lorentz Tensor.
0357    */
0358   LorentzTensor<double> _wf;
0359 
0360 };
0361 }
0362 }
0363 
0364 #endif