Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // TwoBodyMatrixElement.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig 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 HERWIG_TwoBodyDecayMatrixElement_H
0010 #define HERWIG_TwoBodyDecayMatrixElement_H
0011 //
0012 // This is the declaration of the TwoBodyDecayMatrixElement class.
0013 
0014 #include "DecayMatrixElement.h"
0015 
0016 namespace Herwig {
0017 
0018 using namespace ThePEG;
0019 
0020 
0021 /** \ingroup Helicity
0022  *  \author Peter Richardson
0023  *
0024  *  Implementation of the complex matrix element for a two-body decay
0025  * a decay.
0026  *  An arbitary number of external particles are supported.
0027  *  @see RhoDMatrix
0028  *  @see ProductionMatrixElement
0029  *  @see DecayVertex
0030  */
0031 class TwoBodyDecayMatrixElement: public DecayMatrixElement {
0032   
0033 public:
0034       
0035   /** @name Standard constructors and destructors. */
0036   //@{
0037   /**
0038    * Default constructor.
0039    */
0040   TwoBodyDecayMatrixElement() : DecayMatrixElement(2) {}
0041 
0042   /** 
0043    * Constructor for two body decay.
0044    * @param spinin \f$2S+1\f$ for the decaying particle
0045    * @param outspin1 \f$2S+1\f$ for the first  decay product.
0046    * @param outspin2 \f$2S+1\f$ for the second decay product.
0047    */
0048   TwoBodyDecayMatrixElement(PDT::Spin spinin,PDT::Spin outspin1,PDT::Spin outspin2)
0049     : DecayMatrixElement(2,spinin) {
0050     outspin().push_back(outspin1);
0051     outspin().push_back(outspin2);
0052   }
0053 
0054   /** 
0055    * Constructor for arbitary body decay.
0056    * @param inspin \f$2S+1\f$ for the decaying particle
0057    * @param spinout \f$2S+1\f$ for the decay products.
0058    */
0059   TwoBodyDecayMatrixElement(PDT::Spin inspin,vector<PDT::Spin> spinout)
0060     : DecayMatrixElement(2,inspin) {
0061     assert(spinout.size()==2);
0062     outspin() = spinout;
0063   }
0064 
0065   /** 
0066    * Constructor for arbitary body decay.
0067    * @param extspin  \f$2S+1\f$ external particles.
0068    */
0069   TwoBodyDecayMatrixElement(vector<PDT::Spin> extspin)
0070     : DecayMatrixElement(2,extspin[0]) {
0071     assert(extspin.size()==3);
0072     outspin() = vector<PDT::Spin>(extspin.begin()+1,extspin.end());
0073   }
0074   //@}
0075 
0076 public:
0077 
0078   /**
0079    * Spin Density matrices
0080    */
0081   //@{
0082   /** 
0083    * Calculate the decay matrix for this decay.
0084    * @param rhoout The \f$D\f$ matrix for this decay.
0085    */
0086   RhoDMatrix calculateDMatrix(const vector<RhoDMatrix> & rhoout) const;
0087 
0088   /** 
0089    * Calculate the \f$\rho\f$ matrix for a given outgoing particle.
0090    * @param ipart The outgoing particle the \f$\rho\f$ matrix is needed for
0091    * @param rhoin The \f$\rho\f$ matrix for the decaying particle.
0092    * @param rhoout he \f$D\f$ matrices for the other decay products.
0093    */
0094   RhoDMatrix calculateRhoMatrix(int ipart,const RhoDMatrix & rhoin,
0095                 const vector<RhoDMatrix> & rhoout) const;
0096 
0097   /** 
0098    * Contract the matrix element with the \f$\rho\f$ matrix of the 
0099    * incoming particle. The spins of the decay products are summed over.
0100    * @param rhoin The \f$\rho\f$ matrix for the decaying particle.
0101    */
0102   Complex contract(const RhoDMatrix & rhoin) const;
0103 
0104   /** 
0105    * Contract the matrix element with the \f$\rho\f$ matrix of the 
0106    * incoming particle. The spins of the decay products are summed over.
0107    * @param con The conjugate matrix elemetn for the contraction
0108    * @param rhoin The \f$\rho\f$ matrix for the decaying particle.
0109    */
0110   Complex contract(const TwoBodyDecayMatrixElement & con, 
0111            const RhoDMatrix & rhoin);
0112   //@}
0113 
0114 public:
0115   
0116   /** 
0117    * Access to the individual helicity components. 
0118    */
0119   //@{
0120   /** 
0121    * Get the helicity components for a two body decay
0122    * @param inhel The helicity of the decaying particle.
0123    * @param outhel1 The helicity of the first  decay product.
0124    * @param outhel2 The helicity of the second decay product.
0125    */
0126   Complex   operator () (unsigned int inhel, unsigned int outhel1,
0127              unsigned int outhel2) const {
0128     return matrixElement_[inhel][outhel1][outhel2];
0129   }
0130 
0131   /** 
0132    * Set the helicity components for a two body decay
0133    * @param inhel The helicity of the decaying particle.
0134    * @param outhel1 The helicity of the first  decay product.
0135    * @param outhel2 The helicity of the second decay product.
0136    */
0137   Complex & operator () (unsigned int inhel, unsigned int outhel1,
0138              unsigned int outhel2) {
0139     return matrixElement_[inhel][outhel1][outhel2];
0140   }
0141 
0142   /** 
0143    * Get the helicity components for a three body decay
0144    */
0145   Complex   operator () (unsigned int , unsigned int ,
0146              unsigned int , unsigned int ) const {
0147     assert(false);
0148     static const Complex out = 0.;
0149     return out;
0150   }
0151 
0152   /** 
0153    * Set the helicity components for a three body decay
0154    */
0155   Complex & operator () (unsigned int , unsigned int ,
0156              unsigned int , unsigned int ) {
0157     assert(false);
0158     static Complex out = 0.;
0159     return out;
0160   }
0161 
0162   /** 
0163    * Get the helicity components for a four body decay
0164    */
0165   Complex   operator () (unsigned int , unsigned int ,
0166              unsigned int , unsigned int ,
0167              unsigned int ) const {
0168     assert(false);
0169     static const Complex out = 0.;
0170     return out;
0171   }
0172 
0173   /** 
0174    * Set the helicity components for a four body decay
0175    */
0176   Complex & operator () (unsigned int , unsigned int ,
0177              unsigned int , unsigned int ,
0178              unsigned int ) {
0179     assert(false);
0180     static Complex out = 0.;
0181     return out;
0182   }
0183 
0184   /** 
0185    * Get the helicity components for a five body decay
0186    * @param inhel The helicity of the decaying particle.
0187    * @param outhel1 The helicity of the first  decay product.
0188    * @param outhel2 The helicity of the second decay product.
0189    * @param outhel3 The helicity of the third  decay product.
0190    * @param outhel4 The helicity of the fourth decay product.
0191    * @param outhel5 The helicity of the fifth  decay product.
0192    */
0193   Complex   operator () (unsigned int , unsigned int ,
0194              unsigned int , unsigned int ,
0195              unsigned int , unsigned int ) const {
0196     assert(false);
0197     static const Complex out = 0.;
0198     return out;
0199   }
0200 
0201   /** 
0202    * Set the helicity components for a five body decay
0203    */
0204   Complex & operator () (unsigned int , unsigned int ,
0205              unsigned int , unsigned int ,
0206              unsigned int , unsigned int ) {
0207     assert(false);
0208     static Complex out = 0.;
0209     return out;
0210   }
0211 
0212   /** 
0213    * Get the helicity components for a six body decay
0214    */
0215   Complex   operator () (unsigned int ,unsigned int ,
0216              unsigned int ,unsigned int ,
0217              unsigned int ,unsigned int ,
0218              unsigned int ) const {
0219     assert(false);
0220     static const Complex out = 0.;
0221     return out;
0222   }
0223 
0224   /** 
0225    * Set the helicity components for a six body decay
0226    */
0227   Complex & operator () (unsigned int , unsigned int ,
0228              unsigned int , unsigned int ,
0229              unsigned int , unsigned int ,
0230              unsigned int ) {
0231     assert(false);
0232     static Complex out = 0.;
0233     return out;
0234   }
0235 
0236   /**
0237    * Get the helicity components for an \f$n\f$-body decay.
0238    * @param in The helicities of the external particles.
0239    */
0240   Complex   operator () (const vector<unsigned int> & in) const {
0241     assert(in.size()==3);
0242     return matrixElement_[in[0]][in[1]][in[2]];
0243   }
0244 
0245   /**
0246    * Set the helicity components for an \f$n\f$-body decay.
0247    * @param in The helicities of the external particles.
0248    */
0249   Complex & operator () (const vector<unsigned int> & in) {
0250     assert(in.size()==3);
0251     return matrixElement_[in[0]][in[1]][in[2]];
0252   }
0253   //@}
0254 
0255   /**
0256    *  Member to zero all the elements for the matrix element
0257    */
0258   void zero() {
0259     for(unsigned int ix=0;ix<5;++ix) {
0260       for(unsigned int iy=0;iy<5;++iy) {
0261     for(unsigned int iz=0;iz<5;++iz) {
0262       matrixElement_[ix][iy][iz]=0.;
0263     }
0264       }
0265     }
0266   }
0267 
0268 private:
0269 
0270   /**
0271    * Storage of the matrix element, a vector is better for memory usage.
0272    */
0273   Complex matrixElement_[5][5][5];
0274 
0275 };
0276 
0277 }
0278 
0279 #endif /* HERWIG_TwoBodyDecayMatrixElement_H */