Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // VectorSpinInfo.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_VectorSpinInfo_H
0010 #define THEPEG_VectorSpinInfo_H
0011 // This is the declaration of the VectorSpinInfo class.
0012 
0013 #include "ThePEG/EventRecord/SpinInfo.h"
0014 #include "ThePEG/Helicity/LorentzPolarizationVector.h"
0015 #include "VectorSpinInfo.fh"
0016 
0017 namespace ThePEG {
0018 namespace Helicity {
0019 
0020 /**
0021  *  The VectorSpinInfo class is the implementation of the spin
0022  *  information for vector particles.  It inherits from the SpinInfo
0023  *  class and implements the storage of the basis vectors.
0024  *
0025  *  These basis states should be set by either matrixelements or
0026  *  decayers which are capable of generating spin correlation
0027  *  information.
0028  *
0029  *  The basis states in the rest frame of the particles can then be
0030  *  accessed by decayers to produce the correct correlation.
0031  *
0032  *  N.B. in our convention 0 is the \f$-1\f$ helicity state,
0033  *  1 is the \f$0\f$ helicity state and
0034  *  2 is the \f$+1\f$ helicity state.
0035  *
0036  * @author Peter Richardson
0037  *
0038  */
0039 class VectorSpinInfo: public SpinInfo {
0040 
0041 public:
0042 
0043   /** @name Standard constructors and destructors. */
0044   //@{
0045   /**
0046    * Default constructor.
0047    */
0048   VectorSpinInfo() : SpinInfo(PDT::Spin1), _decaycalc(false) {}
0049   
0050   /**
0051    * Standard Constructor.
0052    * @param p the production momentum.
0053    * @param time true if the particle is time-like.
0054    */
0055   VectorSpinInfo(const Lorentz5Momentum & p, bool time)
0056     : SpinInfo(PDT::Spin1, p, time), _decaycalc(false) {}
0057   //@}
0058   
0059 public:
0060 
0061   /** @name Set and get methods for the basis state. */
0062   //@{
0063   /**
0064    * Set the basis state, this is production state.
0065    * @param hel the helicity (0,1,2 as described above.)
0066    * @param in the LorentzPolarizationVector for the given helicity.
0067    */
0068   void setBasisState(unsigned int hel, 
0069              const LorentzPolarizationVector & in) const {
0070     assert(hel<3);
0071     _productionstates[hel] = in;
0072     _currentstates   [hel] = in;
0073   }
0074 
0075   /**
0076    * Set the basis state for the decay.
0077    * @param hel the helicity (0,1,2 as described above.)
0078    * @param in the LorentzPolarizationVector for the given helicity.
0079    */
0080   void setDecayState(unsigned int hel, 
0081              const LorentzPolarizationVector & in) const {
0082     assert(hel<3);
0083     _decaycalc = true;
0084     _decaystates[hel] = in;;
0085   }
0086 
0087   /**
0088    * Get the basis state for the production for the given helicity, \a
0089    * hel (0,1,2 as described above.)
0090    */
0091   const LorentzPolarizationVector & getProductionBasisState(unsigned int hel) const {
0092     assert(hel<3);
0093     return _productionstates[hel];
0094   }
0095 
0096   /**
0097    * Get the basis state for the current for the given helicity, \a
0098    * hel (0,1,2 as described above.)
0099    */
0100   const LorentzPolarizationVector & getCurrentBasisState(unsigned int hel) const {
0101     assert(hel<3);
0102     return _currentstates[hel];
0103   }
0104 
0105   /**
0106    * Get the basis state for the decay for the given helicity, \a hel 
0107    * (0,1,2 as described above.)
0108    */
0109   const LorentzPolarizationVector & getDecayBasisState(unsigned int hel) const {
0110     assert(hel<3);
0111     if(!_decaycalc) {
0112       for(unsigned int ix=0;ix<3;++ix)
0113     _decaystates[ix]=_currentstates[ix].conjugate();
0114       _decaycalc=true;
0115     }
0116     // return the basis function
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 used to initialize the interfaces.
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   VectorSpinInfo & operator=(const VectorSpinInfo &) = delete;
0161 
0162 private:
0163 
0164   /**
0165    * Basis states in the frame in which the particle was produced.
0166    */
0167   mutable std::array<LorentzPolarizationVector,3> _productionstates;
0168 
0169   /**
0170    * Basis states in the frame in which the particle decays.
0171    */
0172   mutable std::array<LorentzPolarizationVector,3> _decaystates;
0173 
0174   /**
0175    * Basis states in the current frame of the particle
0176    */
0177   mutable std::array<LorentzPolarizationVector,3> _currentstates;
0178 
0179   /**
0180    * True if the decay state has been set.
0181    */
0182   mutable bool _decaycalc;
0183 
0184 };
0185 
0186 }
0187 }
0188 
0189 
0190 namespace ThePEG {
0191 
0192 }
0193 #endif /* THEPEG_VectorSpinInfo_H */