thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
FermionSpinInfo.h
1 // -*- C++ -*-
2 //
3 // FermionSpinInfo.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_FermionSpinInfo_H
10 #define ThePEG_FermionSpinInfo_H
11 // This is the declaration of the FermionSpinInfo class.
12 
13 #include "ThePEG/EventRecord/SpinInfo.h"
14 #include "ThePEG/Helicity/LorentzSpinor.h"
15 #include "FermionSpinInfo.fh"
16 #include <array>
17 
18 namespace ThePEG {
19 namespace Helicity {
20 
40 class FermionSpinInfo: public SpinInfo {
41 
42 public:
43 
50  : SpinInfo(PDT::Spin1Half), _decaycalc(false) {}
51 
57  FermionSpinInfo(const Lorentz5Momentum & p, bool time)
58  : SpinInfo(PDT::Spin1Half, p, time), _decaycalc(false) {}
60 
61 public:
62 
70  void setBasisState(unsigned int hel,
71  const LorentzSpinor<SqrtEnergy> & in) const {
72  assert(hel<2);
73  _productionstates[hel] = in;
74  _currentstates [hel] = in;
75  }
76 
82  void setDecayState(unsigned int hel,
83  const LorentzSpinor<SqrtEnergy> & in) const {
84  assert(hel<2);
85  _decaycalc = true;
86  _decaystates[hel] = in;
87  }
88 
93  const LorentzSpinor<SqrtEnergy> & getProductionBasisState(unsigned int hel) const {
94  assert(hel<2);
95  return _productionstates[hel];
96  }
97 
102  const LorentzSpinor<SqrtEnergy> & getCurrentBasisState(unsigned int hel) const {
103  assert(hel<2);
104  return _currentstates[hel];
105  }
106 
111  const LorentzSpinor<SqrtEnergy> & getDecayBasisState(unsigned int hel) const {
112  assert(hel<2);
113  if(!_decaycalc) {
114  for(unsigned int ix=0;ix<2;++ix) _decaystates[ix]=_currentstates[ix];
115  _decaycalc=true;
116  }
117  return _decaystates[hel];
118  }
120 
124  virtual void transform(const LorentzMomentum &,const LorentzRotation &);
125 
129  virtual void undecay() const {
130  _decaycalc=false;
132  }
133 
137  virtual void reset() {
138  undecay();
140  SpinInfo::reset();
141  }
142 
143 public:
144 
148  static void Init();
149 
153  virtual EIPtr clone() const;
154 
155 private:
156 
160  FermionSpinInfo & operator=(const FermionSpinInfo &) = delete;
161 
162 private:
163 
167  mutable std::array<LorentzSpinor<SqrtEnergy>,2> _productionstates;
168 
172  mutable std::array<LorentzSpinor<SqrtEnergy>,2> _currentstates;
173 
177  mutable std::array<LorentzSpinor<SqrtEnergy>,2> _decaystates;
178 
182  mutable bool _decaycalc;
183 
184 };
185 
186 }
187 }
188 
189 namespace ThePEG {
190 
191 }
192 #endif /* ThePEG_FermionSpinInfo_H */
void setDecayState(unsigned int hel, const LorentzSpinor< SqrtEnergy > &in) const
Set the basis state for the decay.
virtual void transform(const LorentzMomentum &, const LorentzRotation &)
Perform a lorentz rotation of the spin information.
const LorentzSpinor< SqrtEnergy > & getCurrentBasisState(unsigned int hel) const
Get the current basis state for the given helicity, hel (which is 0 or 1 as described above...
FermionSpinInfo & operator=(const FermionSpinInfo &)=delete
Private and non-existent assignment operator.
virtual void undecay() const
Undecay.
virtual EIPtr clone() const
Standard clone method.
PDT is a helper class implementing enumerations for charge, colour and spin to be used by the Particl...
Definition: PDT.h:24
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
FermionSpinInfo(const Lorentz5Momentum &p, bool time)
Standard Constructor.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
const LorentzSpinor< SqrtEnergy > & getProductionBasisState(unsigned int hel) const
Get the basis state for the production for the given helicity, hel (which is 0 or 1 as described abov...
The LorentzSpinor class is designed to store a spinor.
Definition: LorentzSpinor.h:71
FermionSpinInfo()
Default constructor.
virtual void reset()
Reset - Undoes any transformations and calls undecay.
Definition: SpinInfo.h:159
The SpinInfo is the base class for the spin information for the spin correlation algorithm.
Definition: SpinInfo.h:58
const LorentzSpinor< SqrtEnergy > & getDecayBasisState(unsigned int hel) const
Get the basis state for the decay for the given helicity, hel (which is 0 or 1 as described above...
std::array< LorentzSpinor< SqrtEnergy >, 2 > _decaystates
basis states in the frame in which the particle decays
bool _decaycalc
True if the decay state has been set.
static void Init()
Standard Init function.
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
std::array< LorentzSpinor< SqrtEnergy >, 2 > _productionstates
basis states in the frame in which the particle was produced
void setBasisState(unsigned int hel, const LorentzSpinor< SqrtEnergy > &in) const
Set the basis state, this is production state.
std::array< LorentzSpinor< SqrtEnergy >, 2 > _currentstates
basis states in the current frame of the particle
virtual void undecay() const
Calculate the rho matrix for the decay if not already done.
The FermionSpinInfo class inherits from the SpinInfo class and implements the storage of the basis ve...