thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
SpinorWaveFunction.h
1 // -*- C++ -*-
2 //
3 // SpinorWaveFunction.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 2003-2019 Peter Richardson, Leif Lonnblad
5 //
6 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_SpinorWaveFunction_H
10 #define ThePEG_SpinorWaveFunction_H
11 //
12 // This is the declaration of the SpinorWaveFunction class.
13 //
14 #include "WaveFunctionBase.h"
15 #include <ThePEG/Helicity/LorentzSpinor.h>
16 #include <ThePEG/Helicity/FermionSpinInfo.h>
17 #include <ThePEG/EventRecord/Particle.h>
18 #include <ThePEG/EventRecord/RhoDMatrix.h>
19 
20 namespace ThePEG {
21 
22 namespace Helicity {
23 
27 class SpinorBarWaveFunction;
28 
57 
58 public:
59 
71  SpinorWaveFunction(const Lorentz5Momentum & p,tcPDPtr part,complex<double> s1,
72  complex<double> s2,complex<double> s3,complex<double> s4)
73  : WaveFunctionBase(p,part), _wf(s1,s2,s3,s4)
74  {
75  assert(iSpin()==2);
76  }
77 
88  : WaveFunctionBase(p,part,dir), _wf(wave)
89  {
90  assert(iSpin()==2);
91  }
92 
100  Direction dir=intermediate)
101  : WaveFunctionBase(p->momentum(), p->dataPtr(), dir), _wf(wave.Type())
102  {
103  assert(iSpin()==2);
104  for (unsigned int i=0; i<4; ++i)
105  _wf[i]=Complex(wave[i]*UnitRemoval::InvSqrtE);
106  }
107 
116  unsigned int ihel,
117  Direction dir)
118  : WaveFunctionBase(p,part,dir)
119  {
120  assert(iSpin()==2);
121  calculateWaveFunction(ihel);
122  }
123 
132  tcPDPtr part,Direction dir)
133  : WaveFunctionBase(p,part,dir), _wf()
134  {
135  assert(iSpin()==2);
136  }
137 
142  : WaveFunctionBase(), _wf()
143  {}
144 
148  SpinorWaveFunction(vector<SpinorWaveFunction> & wave,
149  tPPtr part,Direction dir,bool time,bool=true) {
150  calculateWaveFunctions(wave,part,dir);
151  constructSpinInfo(wave,part,dir,time);
152  }
154 
162  complex<double> operator ()(int i) const {
163  assert(i>=0 &&i<=3);
164  return _wf(i);
165  }
166 
170  const LorentzSpinor<double> & wave() const {return _wf;}
171 
176 
180  complex<double> s1() const {return _wf.s1();}
181 
185  complex<double> s2() const {return _wf.s2();}
186 
190  complex<double> s3() const {return _wf.s3();}
191 
195  complex<double> s4() const {return _wf.s4();}
197 
203  void conjugate() {
204  _wf=_wf.conjugate();
205  }
206 
211 
220  void reset(unsigned int ihel) {
221  calculateWaveFunction(ihel);
222  }
224 
225 public:
226 
230  void transform(const LorentzRotation & r) {
231  _wf.transform(r);
233  }
234 
235 public:
236 
240  static void calculateWaveFunctions(vector<LorentzSpinor<SqrtEnergy> > & waves,
242 
246  static void calculateWaveFunctions(vector<SpinorWaveFunction> & waves,
247  tPPtr particle,Direction);
248 
252  static void calculateWaveFunctions(vector<SpinorWaveFunction> & waves,
253  const Lorentz5Momentum & momentum,
254  tcPDPtr parton,Direction);
255 
259  static void calculateWaveFunctions(vector<LorentzSpinor<SqrtEnergy> > & waves,
260  RhoDMatrix & rho,
261  tPPtr particle,Direction);
262 
266  static void calculateWaveFunctions(vector<SpinorWaveFunction> & waves,
267  RhoDMatrix & rho,
268  tPPtr particle,Direction);
269 
273  static void constructSpinInfo(const vector<LorentzSpinor<SqrtEnergy> > & waves,
274  tPPtr part,Direction dir, bool time);
275 
279  static void constructSpinInfo(const vector<SpinorWaveFunction> & waves,
280  tPPtr part,Direction dir, bool time);
281 
282 
283 private:
284 
289  void calculateWaveFunction(unsigned int ihel);
290 
291 private:
292 
297 
300  LorentzSpinor<SqrtEnergy> temp(_wf.Type());
301  for (unsigned int i=0; i<4; ++i)
302  temp(i) = _wf(i)*UnitRemoval::SqrtE;
303  return temp;
304  }
305 
306 };
307 
308 }
309 
310 }
311 #endif
312 
313 
314 
315 
complex< Value > s2() const
Get second component.
complex< double > s2() const
Get the second spin component component.
LorentzSpinor conjugate() const
Return the conjugated spinor .
LorentzSpinor< double > _wf
Storage of the Lorentz Spinor.
void transform(const LorentzRotation &r)
Perform the Lorentz transformation of the wave function.
static void constructSpinInfo(const vector< LorentzSpinor< SqrtEnergy > > &waves, tPPtr part, Direction dir, bool time)
Construct the SpinInfo object.
complex< double > s3() const
Get the third spin component component.
std::complex< double > Complex
ThePEG code should use Complex for all complex scalars.
Definition: Complex.h:23
SpinorBarWaveFunction bar()
Return the barred spinor.
SpinorWaveFunction(const Lorentz5Momentum &p, tcPDPtr part, Direction dir)
Constructor, set the momentum, direction, zero the wavefunction.
void conjugate()
Take the conjugate of the spinor .
SpinorWaveFunction(const Lorentz5Momentum &p, tcPDPtr part, unsigned int ihel, Direction dir)
Constructor, set the momentum, helicity, direction.
const LorentzSpinor< double > & wave() const
Return wavefunction as LorentzSpinor<double>.
complex< double > s1() const
Get the first spin component component.
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
void calculateWaveFunction(unsigned int ihel)
Calcuate the wavefunction.
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
void reset(unsigned int ihel)
Reset functions.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
complex< double > operator()(int i) const
Access to the wavefunction and its components.
An intermediate particle.
complex< Value > s4() const
Get fourth component.
SpinorWaveFunction(const Lorentz5Momentum &p, tcPDPtr part, const LorentzSpinor< double > &wave, Direction dir=intermediate)
Constructor, set the momentum and the wavefunction.
complex< Value > s3() const
Get third component.
complex< Value > s1() const
Get first component.
complex< double > s4() const
Get the fourth spin component component.
SpinorWaveFunction(vector< SpinorWaveFunction > &wave, tPPtr part, Direction dir, bool time, bool=true)
Special for spin correlations.
static void calculateWaveFunctions(vector< LorentzSpinor< SqrtEnergy > > &waves, tPPtr particle, Direction)
Calculate the wavefunctions.
LorentzSpinor & transform(const SpinHalfLorentzRotation &)
General Lorentz transformation.
LorentzSpinor< SqrtEnergy > dimensionedWf() const
Return wavefunction as LorentzSpinor<SqrtEnergy>
PDT::Spin iSpin() const
Get 2s+1 for the particle.
SpinorWaveFunction(const Lorentz5Momentum &p, tcPDPtr part, complex< double > s1, complex< double > s2, complex< double > s3, complex< double > s4)
Constructor, set the momentum and the components of the spinor.
LorentzSpinor< SqrtEnergy > dimensionedWave() const
Return wavefunction as LorentzSpinor<SqrtEnergy>.
const Lorentz5Momentum & momentum() const
Access to the 5-momentum.
A Direction object can be used to specify that some following operations should be assumed to be perf...
Definition: Direction.h:41
tcPDPtr particle() const
Get the particle pointer.
The RhoDMatrix class is designed to implement the storage of the rho and D matrices which are require...
Definition: RhoDMatrix.h:28
SpinorType Type() const
Return the type of the spinor.
void transformMomentum(const LorentzRotation &r)
Perform the Lorentz transformation of the wave function.
SpinorWaveFunction(const tPPtr &p, const LorentzSpinor< SqrtEnergy > &wave, Direction dir=intermediate)
Constructor, set the momentum and the wavefunction.