Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // FermionSpinInfo.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_FermionSpinInfo_H
0010 #define ThePEG_FermionSpinInfo_H
0011 // This is the declaration of the FermionSpinInfo class.
0012 
0013 #include "ThePEG/EventRecord/SpinInfo.h"
0014 #include "ThePEG/Helicity/LorentzSpinor.h"
0015 #include "FermionSpinInfo.fh"
0016 #include <array>
0017 
0018 namespace ThePEG {
0019 namespace Helicity {
0020 
0021 /**
0022  *  The FermionSpinInfo class inherits from the SpinInfo class and
0023  *  implements the storage of the basis vectors for a spin-1/2
0024  *  particle.  The basis states are the u-spinors for a particle and
0025  *  the v-spinors for an antiparticle. The barred spinors can be
0026  *  obtained from these.
0027  *
0028  *  These basis states should be set by either matrixelements or
0029  *  decayers which are capable of generating spin correlation
0030  *  information.
0031  *
0032  *  The basis states in the rest frame of the particles can then be
0033  *  accessed by decayers to produce the correct correlations.
0034  *
0035  *  N.B. in our convention 0 is the \f$-\frac12\f$ helicity state and
0036  *  1 is the \f$+\frac12\f$ helicity state.
0037  *
0038  * @author Peter Richardson
0039  */
0040 class FermionSpinInfo: public SpinInfo {
0041 
0042 public:
0043 
0044   /** @name Standard constructors and destructors. */
0045   //@{
0046   /**
0047    * Default constructor.
0048    */
0049   FermionSpinInfo()
0050     : SpinInfo(PDT::Spin1Half), _decaycalc(false) {}
0051 
0052   /**
0053    * Standard Constructor.
0054    * @param p the production momentum.
0055    * @param time true if the particle is time-like.
0056    */
0057   FermionSpinInfo(const Lorentz5Momentum & p, bool time)
0058     : SpinInfo(PDT::Spin1Half, p, time), _decaycalc(false) {}
0059   //@}
0060 
0061 public:
0062 
0063   /** @name Set and get methods for the basis state. */
0064   //@{
0065   /**
0066    * Set the basis state, this is production state.
0067    * @param hel the helicity (0 or 1 as described above.)
0068    * @param in the LorentzSpinor for the given helicity.
0069    */
0070   void setBasisState(unsigned int hel,
0071              const LorentzSpinor<SqrtEnergy> & in) const {
0072     assert(hel<2);
0073     _productionstates[hel] = in;
0074     _currentstates   [hel] = in;
0075   }
0076 
0077   /**
0078    * Set the basis state for the decay.
0079    * @param hel the helicity (0 or 1 as described above.)
0080    * @param in the LorentzSpinor for the given helicity.
0081    */
0082   void setDecayState(unsigned int hel,
0083              const LorentzSpinor<SqrtEnergy> & in) const {
0084     assert(hel<2);
0085     _decaycalc = true;
0086     _decaystates[hel] = in;
0087   }
0088 
0089   /**
0090    * Get the basis state for the production for the given helicity, \a
0091    * hel (which is 0 or 1 as described above.)
0092    */
0093   const LorentzSpinor<SqrtEnergy> & getProductionBasisState(unsigned int hel) const {
0094     assert(hel<2);
0095     return _productionstates[hel];
0096   }
0097 
0098   /**
0099    * Get the current basis state for the given helicity, \a
0100    * hel (which is 0 or 1 as described above.)
0101    */
0102   const LorentzSpinor<SqrtEnergy> & getCurrentBasisState(unsigned int hel) const {
0103     assert(hel<2);
0104     return _currentstates[hel];
0105   }
0106 
0107   /**
0108    * Get the basis state for the decay for the given helicity, \a hel
0109    * (which is 0 or 1 as described above.)
0110    */
0111   const LorentzSpinor<SqrtEnergy> & getDecayBasisState(unsigned int hel) const {
0112     assert(hel<2);
0113     if(!_decaycalc) {
0114       for(unsigned int ix=0;ix<2;++ix) _decaystates[ix]=_currentstates[ix];
0115       _decaycalc=true;
0116     }
0117     return _decaystates[hel];
0118   }
0119   //@}
0120 
0121   /**
0122    * Perform a lorentz rotation of the spin information
0123    */
0124   virtual void transform(const LorentzMomentum &,const LorentzRotation &);
0125 
0126   /**
0127    *  Undecay
0128    */
0129   virtual void undecay() const {
0130     _decaycalc=false;
0131     SpinInfo::undecay();
0132   }
0133 
0134   /**
0135    *  Reset
0136    */
0137   virtual void reset() {
0138     undecay();
0139     _currentstates = _productionstates;
0140     SpinInfo::reset();
0141   }
0142 
0143 public:
0144 
0145   /**
0146    * Standard Init function.
0147    */
0148   static void Init();
0149 
0150   /**
0151    * Standard clone method.
0152    */
0153   virtual EIPtr clone() const;
0154 
0155 private:
0156 
0157   /**
0158    * Private and non-existent assignment operator.
0159    */
0160   FermionSpinInfo & operator=(const FermionSpinInfo &) = delete;
0161 
0162 private:
0163 
0164   /**
0165    * basis states in the frame in which the particle was produced
0166    */
0167   mutable std::array<LorentzSpinor<SqrtEnergy>,2> _productionstates;
0168 
0169   /**
0170    * basis states in the current frame of the particle
0171    */
0172   mutable std::array<LorentzSpinor<SqrtEnergy>,2> _currentstates;
0173 
0174   /**
0175    * basis states in the frame in which the particle decays
0176    */
0177   mutable std::array<LorentzSpinor<SqrtEnergy>,2> _decaystates;
0178 
0179   /**
0180    * True if the decay state has been set.
0181    */
0182   mutable bool _decaycalc;
0183 
0184 };
0185 
0186 }
0187 }
0188 
0189 namespace ThePEG {
0190 
0191 }
0192 #endif /* ThePEG_FermionSpinInfo_H */