Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:10:14

0001 #ifndef SHERPA_Single_Events_Decay_Handler_Base_H
0002 #define SHERPA_Single_Events_Decay_Handler_Base_H
0003 
0004 #include "ATOOLS/Math/Vector.H"
0005 #include "ATOOLS/Phys/Particle.H"
0006 #include "ATOOLS/Phys/Momenta_Stretcher.H"
0007 #include "METOOLS/SpinCorrelations/Decay_Matrix.H"
0008 #include "METOOLS/SpinCorrelations/Polarized_CrossSections_Handler.H"
0009 
0010 namespace ATOOLS {
0011   class Blob_List;
0012   class Blob;
0013   class Cluster_Amplitude;
0014   template<typename Scalar>
0015   class Lorentz_Ten2;
0016   typedef Lorentz_Ten2<double>  Lorentz_Ten2D;
0017 }
0018 
0019 namespace PHASIC {
0020   class Decay_Map;
0021   class Decay_Table;
0022 }
0023 
0024 namespace METOOLS {
0025   class Spin_Density;
0026   class Decay_Matrix;
0027   class Amplitude2_Tensor;
0028 }
0029 
0030 namespace SHERPA {
0031   class Soft_Photon_Handler;
0032 
0033   class Decay_Handler_Base : public ATOOLS::Mass_Selector {
0034   protected:
0035     SHERPA::Soft_Photon_Handler * p_softphotons;
0036     METOOLS::Polarized_CrossSections_Handler* p_polarization_handler;
0037     PHASIC::Decay_Map           * p_decaymap;
0038     ATOOLS::Blob_List           * p_bloblist;
0039     ATOOLS::Cluster_Amplitude   * p_ampl;
0040     ATOOLS::Momenta_Stretcher     m_stretcher;
0041     std::vector<METOOLS::Decay_Matrix> m_decaymatrices;
0042     bool m_spincorr, m_decaychainend, m_cluster, m_polcrosssec;
0043     /*!
0044       \brief Switch to turn mass smearing on and off.
0045 
0046       Can be set by the "SOFT_MASS_SMEARING = [0,1]" variable in Fragmentation.dat
0047     */
0048     int m_mass_smearing;
0049     size_t m_qedmode;
0050     unsigned long int m_oserrors;
0051     bool m_specialtauspincorr;
0052     bool DoSpecialDecayTauSC(ATOOLS::Particle* part);
0053   public:
0054     Decay_Handler_Base();
0055     ~Decay_Handler_Base();
0056     /*!
0057       \brief Uses the appropriate decay handler for each outparticle to
0058       generate its destination mass, potentially using the information attached
0059       in the \c CreateDecayBlob method. The generated masses are stored in the
0060       \c FinalMass() property of each particle.
0061       */
0062     void SetMasses(ATOOLS::Blob* blob, bool usefinalmass);
0063     /*!
0064       \brief  This method does multiple things with a CMS & on-shell blob:
0065       1. set inparticle momentum off-shell to the labmom mass (== FinalMass())
0066       2. set the outparticle momenta off-shell to their FinalMass()
0067       3. boost the blob into the lab as defined by labmom
0068     */
0069     void BoostAndStretch(ATOOLS::Blob* blob, const ATOOLS::Vec4D& labmom);
0070 
0071     // have to reimplement for hadrons, lund:
0072     virtual void TreatInitialBlob(ATOOLS::Blob* blob,
0073                                   METOOLS::Amplitude2_Tensor* amps,
0074                                   const ATOOLS::Particle_Vector& origparts);
0075     // have to reimplement for lund:
0076     virtual bool DiceMass(ATOOLS::Particle* part, double max);
0077     virtual METOOLS::Amplitude2_Tensor*
0078     FillOnshellDecay(ATOOLS::Blob* blob, METOOLS::Spin_Density* sigma);
0079     virtual METOOLS::Decay_Matrix*
0080     FillDecayTree(ATOOLS::Blob * blob, METOOLS::Spin_Density* s0);
0081     /*!
0082       \brief Chooses the appropriate decay handler for <var>inpart</var>
0083       to create the decay blob for inpart. The decay blob is only a stub
0084       so far without kinematics and without outparticles.
0085     */
0086     virtual void CreateDecayBlob(ATOOLS::Particle* inpart)=0;
0087     virtual bool AttachExtraQED(ATOOLS::Blob* blob,size_t mode=0);
0088     virtual bool AttachExtraQEDToProductionBlob(ATOOLS::Blob* blob);
0089     virtual bool AttachExtraQEDRecursively(ATOOLS::Blob* blob, bool aa=false);
0090     virtual void UpdateDecayBlob(ATOOLS::Blob* blob);
0091     virtual bool CheckOnshellness(ATOOLS::Blob* blob);
0092     virtual void CleanUp();
0093     ATOOLS::Cluster_Amplitude* ClusterConfiguration(ATOOLS::Blob*const);
0094 
0095     inline void SetBlobList(ATOOLS::Blob_List* bl) { p_bloblist=bl; }
0096     inline std::vector<METOOLS::Decay_Matrix> GetDecayMatrices() { return m_decaymatrices; }
0097     inline bool SpinCorr() { return m_spincorr; }
0098     inline bool PolCrossSec(){ return  m_polcrosssec; }
0099     inline METOOLS::Polarized_CrossSections_Handler* GetPolarizationHandler() { return p_polarization_handler; }
0100     virtual bool Decays(const ATOOLS::Flavour& flav);
0101     virtual bool CanDecay(const ATOOLS::Flavour& flav);
0102     inline PHASIC::Decay_Map* DecayMap() { return p_decaymap; }
0103 
0104     inline void SetSoftPhotonHandler(Soft_Photon_Handler* sph)
0105     {  p_softphotons=sph; }
0106     inline Soft_Photon_Handler* GetSoftPhotonHandler()
0107     { return p_softphotons; }
0108   };
0109 
0110 
0111 }
0112 
0113 #endif