ThePEG  1.8.0
SpinorWaveFunction.h
1 // -*- C++ -*-
2 //
3 // SpinorWaveFunction.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 2003-2011 Peter Richardson, Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 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]=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,
248 
252  static void calculateWaveFunctions(vector<LorentzSpinor<SqrtEnergy> > & waves,
253  RhoDMatrix & rho,
255 
259  static void calculateWaveFunctions(vector<SpinorWaveFunction> & waves,
260  RhoDMatrix & rho,
262 
266  static void constructSpinInfo(const vector<LorentzSpinor<SqrtEnergy> > & waves,
267  tPPtr part,Direction dir, bool time);
268 
272  static void constructSpinInfo(const vector<SpinorWaveFunction> & waves,
273  tPPtr part,Direction dir, bool time);
274 
275 
276 private:
277 
282  void calculateWaveFunction(unsigned int ihel);
283 
284 private:
285 
290 
294  for (unsigned int i=0; i<4; ++i)
295  temp(i) = _wf(i)*UnitRemoval::SqrtE;
296  return temp;
297  }
298 
299 };
300 
301 }
302 
303 }
304 #endif
305 
306 
307 
308