Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-13 10:29:13

0001 #ifndef METOOLS_SpinCorrelations_Polarized_CrossSections_Handler_H
0002 #define METOOLS_SpinCorrelations_Polarized_CrossSections_Handler_H
0003 
0004 
0005 #include <vector>
0006 #include <string>
0007 #include <map>
0008 #include "ATOOLS/Math/Vector.H"
0009 #include "ATOOLS/Phys/Spinor.H"
0010 #include "METOOLS/SpinCorrelations/Amplitude2_Tensor.H"
0011 
0012 namespace ATOOLS{
0013   class Blob;
0014   class Particle;
0015 }
0016 
0017 namespace METOOLS {
0018   class Decay_Matrix;
0019   class Amplitude2_Tensor;
0020   class PolWeights_Map;
0021   class Polarization_Vector;
0022   typedef ATOOLS::Spinor<double> SpinorType;
0023 
0024   class Polarized_CrossSections_Handler {
0025     std::vector<std::string> m_refsystem;
0026     std::string m_spinbasis, m_singlepol_channel;
0027     std::map<std::string, std::string> m_customweights;
0028     int m_trans_mode;
0029     ATOOLS::Vec4D m_old_refmom;
0030     ATOOLS::Vec4D m_new_refmom;
0031     bool m_helicitybasis;
0032     bool m_pol_checks;
0033 
0034     void InitPolSettings();
0035     void InitRefMoms();
0036     ATOOLS::Vec4D Beta(const ATOOLS::Blob* signalblob, const METOOLS::Amplitude2_Tensor* prod_amps,
0037                        std::string refsystem) const;
0038     METOOLS::PolWeights_Map* Calculation(ATOOLS::Blob* signalblob, const METOOLS::Amplitude2_Tensor* prod_amps,
0039                                          const std::vector<METOOLS::Decay_Matrix>& decay_matrices,
0040                                          std::map<int, METOOLS::Polarization_Vector>& default_polarization_vectors,
0041                                          std::map<int, SpinorType>& default_spinors, ATOOLS::Vec4D beta,
0042                                          std::string refsystem) const;
0043     void Tests(const METOOLS::Amplitude2_Tensor* amps, const METOOLS::Amplitude2_Tensor* trafo_pol_amps) const;
0044 
0045   public:
0046     Polarized_CrossSections_Handler();
0047 
0048     std::vector<METOOLS::PolWeights_Map*> Treat(ATOOLS::Blob* signalblob, const METOOLS::Amplitude2_Tensor* prod_amps,
0049                                                 const std::vector<METOOLS::Decay_Matrix>& decay_matrices) const;
0050     inline std::vector<std::string> GetRefSystems() { return m_refsystem; }
0051   };
0052 
0053 
0054   /*!
0055       \file Polarized_CrossSections_Handler.H
0056       \brief Declares the class METOOLS::Polarized_CrossSections_Handler; currently only massive, unstable spin 1
0057       particles are supported
0058       */
0059   /*!
0060     \class Polarized_CrossSections_Handler
0061     \brief Class to handle the calculation of polarized cross sections out of an Amplitude2_Tensor and decay matrices,
0062            currently only unstable, massive spin 1 particles are supported
0063 
0064       This class enables to calculate polarized cross sections out of an Amplitude2_Tensor and decay matrices of the
0065       particles of interest in various polarization definitions. Currently the ComixDefault spin basis ("ComixDefault",
0066       the helicity basis ("Helicity")
0067       and user defined constant spin axes are supported to define the spin basis for massive particles. The polarization
0068       objects can be calculated in the laboratory ("Lab"), the hard decaying particles center of mass ("COM") and the
0069       parton-parton frame("PPFr") as well as the restframe of each particle of interest where the spin axis is defined
0070       in the particle's direction of flight in laboratory frame ("RestFrames"), and the center-of-mass frames defined
0071       by any combination of hard-process particles. The matrix elements are always taken in the laboratory frame, so all
0072       polarization objects determined in different frames than that are transformed to the laboratory frame after
0073       calculation.
0074       To enable various polarization definitions in one simulation run independent of the matrix
0075       element generator, the Amplitude2_Tensor and the decay matrices are transformed according to the desired
0076       polarization definition. It is possible to calculate cross sections for several reference frames in one run.
0077       The result of the calculation performed here is a PolWeights_Map for each polarization definition containing
0078       polarization fractions of all polarization definitions. Cross sections are calculated out of that during the event
0079       output together with all other events weights.
0080     */
0081   /*!
0082   \var Polarized_CrossSections_Handler::m_refsystem
0083   \brief Vector containing the strings specifing the several reference frames which should be used for polarization
0084          definition, default: std::vector<std::string>(1, "Lab")
0085   */
0086   /*!
0087   \var Polarized_CrossSections_Handler::m_spinbasis
0088   \brief String characterizes which spinbasis should be used to calculated the polarized matrix elements, currently
0089          only one spin basis is supported during one simulation run, default: "Helicity"
0090   */
0091   /*!
0092   \var Polarized_CrossSections_Handler::m_singlepol_channel
0093   \brief String describes the decay channel which characterizes the only hard decaying particle which should be
0094          polarized in the desired polarized cross sections, form of the string should be the same as under Channels
0095          in Hard_Decays scoped setting e.g. 24,-11,12 for W+ decaying into a positron and a neutrino,
0096          default: "no channel"
0097   */
0098   /*!
0099   \var Polarized_CrossSections_Handler::m_customweights
0100   \brief Map containing the settings for custom weights specified by the user, default: empty map
0101   */
0102   /*!
0103   \var int Polarized_CrossSections_Handler::m_trans_mode
0104   \brief trans_mode specifies how transverse polarized cross sections should be derived from the "base" polarization
0105   combinations, 0 = incoherent sum of left and right polarization, 1 = coherent sum of left and right polarization
0106   including left-right-interference, 2 = cross sections/fractions for both transverse polarization definitions are
0107   calculated, default: 1
0108   */
0109   /*!
0110   \var Polarized_CrossSections_Handler::m_old_refmom
0111   \brief Reference momentum used in matrix element generation, defines spin axes for massive particles
0112   */
0113   /*!
0114   \var Polarized_CrossSections_Handler::m_new_refmom
0115   \brief Reference momentum defining the desired spin axis for massive particles, (0.0, 0.0, 0.0, 0.0) if helicity basis
0116          is chosen
0117   */
0118   /*!
0119   \var Polarized_CrossSections_Handler::m_helicitybasis
0120   \brief Boolean specifies whether the helicity basis is chosen to define the spin axis
0121   */
0122   /*!
0123   \var Polarized_CrossSections_Handler::m_pol_checks
0124   \brief Boolean specifies whether polarization consistency checks should be done (especially unpol=polsum+int and
0125    checks whether transformation works properly and is unitary)
0126   */
0127   /*!
0128   \fn Polarized_CrossSections_Handler::Polarized_CrossSections_Handler()
0129   \brief Constructor of the class
0130 
0131    Constructor of the class, it reads in the polarization settings from the user input and sets the default and the
0132    desired reference vectors which define the spin axis for massive particles if they are constant; the default
0133    reference vector is the one used for matrix element calculation with COMIX
0134   */
0135   /*!
0136   \fn Polarized_CrossSections_Handler::InitPolSettings()
0137   \brief Helper function for constructor to read in all settings important for the polarization calculation from the user
0138          input
0139   */
0140   /*!
0141   \fn Polarized_CrossSections_Handler::InitRefMoms()
0142   \brief Helper function for constructor to set the default reference momentum m_old_refmom according to the ComixDefault
0143          used for the matrix element calculation and the desired one m_new_refmom if it is constant (not the helicity
0144          basis), the reference momenta fix the spin axis for massive particles
0145          If further spin bases should be supported, they can be added here by introducing a new keyword and the
0146          corresponding reference momentum.
0147    */
0148   /*!
0149   \fn Polarized_CrossSections_Handler::Treat(ATOOLS::Blob* signalblob, const METOOLS::Amplitude2_Tensor* prod_amps,
0150                                              std::vector<METOOLS::Decay_Matrix> decay_matrices) const
0151   \brief Method steers the calculation of the polarization fractions with the desired polarization definitions
0152          This method needs to be called for the actual calculation, it then will call \link Beta Beta() \endlink
0153          and \link Calculation Calculation() \endlink
0154   \param signalblob (pointer to) the signalblob describing the production of the particles whose polarization
0155     should be investigated
0156   \param prod_amps (pointer to) the Amplitude2_Tensor containing the production
0157     matrix elements of the particles of interest, it should contain the
0158     amplitudes of all polarization combinations of the matrix element and its
0159     complex conjugate. Polarization indexes of particles different than the
0160     particles of interest should be summed up.
0161   \param decay_matrices Vector containing the decay matrices of all particles
0162     of interest in case they are unstable, they are calculated during the spin
0163     correlation algorithm in the \link SHERPA::Decay_Handler_Base
0164     Decay_Handler_Base \endlink
0165   \return vector of pointers to PolWeight_Maps, for each reference system one
0166   */
0167   /*!
0168   \fn Polarized_CrossSections_Handler::Beta(const ATOOLS::Blob* signalblob, const METOOLS::Amplitude2_Tensor* prod_amps,
0169                                             std::string refsystem) const
0170   \brief Function determines the beta for the Lorentz transformation from the laboratory frame to the desired reference
0171          frame refsystem
0172 
0173   Beta() returns a zero four-vector if the "RestFrames" frame, the laboratory frame or an undefined frame is
0174   chosen, the calculated beta depends on momenta, not on particle velocities according to the beta input required in the
0175   Poincare class;
0176   if new reference frames with the same beta for all particles should be supported by Sherpa, they can be
0177   implemented here by introducing a new keyword and the corresponding beta.
0178   \param signalblob (pointer to) the signalblob describing the production of the particles whose polarization
0179     should be investigated
0180   \param prod_amps (pointer to) the Amplitude2_Tensor containing the production matrix elements of the particles
0181     of interest, it should contain the amplitudes of all polarization combinations of the matrix
0182     element and its complex conjugate.
0183     Polarization indexes of particles different than the particles of interest should be summed up.
0184   \param refsystem specifies the desired reference frame
0185   \return beta for the Lorentz transformation from the laboratory frame to the desired reference frame refsystem depending on
0186     particle momenta
0187   */
0188   /*!
0189   \fn Polarized_CrossSections_Handler::Calculation(ATOOLS::Blob* signalblob, const METOOLS::Amplitude2_Tensor* prod_amps,
0190                                                    std::vector<METOOLS::Decay_Matrix> decay_matrices,
0191                                                    std::map<int, METOOLS::Polarization_Vector>& default_polarization_vectors,
0192                                                    std::map<int, SpinorType>& default_spinors, ATOOLS::Vec4D beta,
0193                                                    std::string refsystem) const
0194   \brief Method steers the transformation of the matrix element objects, calculates the actual polarized matrix elements
0195          is case of intermediate particles and generates a new PolWeights_Map from the results containing the labeled
0196          polarization fractions
0197 
0198   To support particles different than massive intermediate spin 1 particles the according calculation of the polarization
0199   objects and the corresponding transformations need to be implemented and then called from here
0200   \param signalblob (pointer to) the signalblob describing the production of the particles whose polarization
0201     should be investigated
0202   \param prod_amps (pointer to) the Amplitude2_Tensor containing the production matrix elements of the particles
0203     of interest, it should contain the amplitudes of all polarization combinations of the matrix
0204     element and its complex conjugate.
0205     Polarization indexes of particles different than the particles of interest should be summed up.
0206   \param decay_matrices Vector containing the decay matrices of all particles of interest in case they are
0207     unstable, they are calculated during the spin correlation algorithm in the
0208     Decay_Handler_Base
0209   \param default_polarization_vectors Reference of a map containing the polarization vectors calculated in the
0210     default polarization basis (basis, in which the matrix elements
0211     were calculated) can be empty, in that case the necessary polarization
0212     vectors will be calculated; map key = particle number according to
0213     Sherpa's internal particle numbering
0214   \param default_spinors Reference of a map containing the spinors calculated in the default polarization basis,
0215     (basis, in which the matrix elements were calculated), can be empty, in that
0216     case, the necessary spinors will be calculated; map key = particle number according to
0217     Sherpa's internal particle numbering
0218   \param beta beta for the Lorentz transformation from the laboratory frame to the desired reference frame
0219     refsystem depending on particle momenta instead of velocities according to the beta required by
0220     the Poincare class
0221   \param refsystem specifies the desired reference frame
0222   \return (pointer to) PolWeight_Map
0223   */
0224   /*!
0225   \fn Polarized_CrossSections_Handler::Tests(const METOOLS::Amplitude2_Tensor* amps,
0226                                              const METOOLS::Amplitude2_Tensor* trafo_pol_amps) const
0227   \brief Method to test the transformed results
0228   \param amps (pointer to) the Amplitude2_Tensor after contraction with the decay matrices in the polarization
0229     basis used for matrix element generation
0230   \param trafo_pol_amps (pointer to the) Amplitude2_Tensor containing the polarized matrix elements of the
0231     particles whose polarization should be investigated, it should contain the amplitudes of
0232     all polarization combinations of the matrix element and its complex conjugate.
0233     Polarization indexes of particles different than the particles of interest should be
0234     summed up. For intermediate particles, trafo_pol_amps should contain the product of
0235     production and decay matrix elements
0236   */
0237 }
0238 
0239 #endif