Back to home page

EIC code displayed by LXR

 
 

    


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

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