Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef BEAM_Main_Kinematics_Base_H
0002 #define BEAM_Main_Kinematics_Base_H
0003 
0004 #include "BEAM/Main/Beam_Base.H"
0005 #include "ATOOLS/Org/Info_Key.H"
0006 #include "ATOOLS/Math/Vector.H"
0007 #include "ATOOLS/Math/Poincare.H"
0008 #include <map>
0009 #include <array>
0010 
0011 namespace BEAM {
0012   class Kinematics_Base {
0013   protected:
0014     std::array<Beam_Base *, 2> p_beams;
0015     bool        m_on;
0016     std::string m_keyid;
0017     std::array<double, 2> m_m, m_m2, m_exponent;
0018     /*!
0019       The energy fractions the outgoing bunches have w.r.t. the corresponding
0020       incoming beams.
0021     */
0022     std::array<double, 2> m_x;
0023     double m_smin, m_smax, m_sminPS, m_smaxPS, m_S;
0024 
0025     ATOOLS::Vec4D    m_Plab;
0026     /*!
0027       A boost from the c.m. system of the incoming beams to the c.m. system of the
0028       outgoing bunches.
0029     */
0030     ATOOLS::Poincare m_CMSBoost;
0031     /*!
0032       A boost from the lab system of the incoming beams to their c.m. system.
0033     */
0034     ATOOLS::Poincare m_LabBoost;
0035     virtual void InitIntegration()=0;
0036   public:
0037     Kinematics_Base(std::array<Beam_Base *, 2> p_beams);
0038     virtual ~Kinematics_Base();
0039 
0040     virtual bool operator()(ATOOLS::Vec4D_Vector& moms)           = 0;
0041     virtual void AssignKeys(ATOOLS::Integration_Info *const info) = 0;
0042     virtual void SetLimits()                                      = 0;
0043     virtual inline void SetSprimeMin(const double & smin) { m_sminPS = ATOOLS::Max(smin, m_sminPS); }
0044     virtual inline void SetSprimeMax(const double & smax) { m_smaxPS = smax; }
0045     virtual inline const double & SprimeMin() const { return ATOOLS::Max(m_smin, m_sminPS); }
0046     virtual inline const double & SprimeMax() const { return ATOOLS::Min(m_smax, m_smaxPS); }
0047     virtual inline const double   Sprime()          { return m_S; }
0048     virtual inline const double   Y()               { return 0.; }
0049 
0050     virtual inline std::array<Beam_Base *, 2> GetBeams() { return p_beams; }
0051 
0052     virtual inline const bool     On()                 const { return m_on; }
0053     virtual inline const std::string & KeyId()         const { return m_keyid; }
0054     /**
0055      * @brief Gets the mass of one of the incoming particles.
0056      * @param i Which particle to get
0057      * @return the mass
0058      */
0059     virtual inline const double & m(const size_t & i)  const { return m_m[i]; }
0060     /**
0061      * @brief Gets the square of the mass of one of the incoming particles.
0062      * @param i Which particle to get
0063      * @return the mass
0064      */
0065     virtual inline const double & m2(const size_t & i) const { return m_m2[i]; }
0066     /*!
0067       Characteristic exponents used for the integration. This is mainly a service for better
0068       performance of the phase space integration.
0069     */
0070     virtual inline const double & Exponent(const size_t & i) const {
0071       return m_exponent[i];
0072     }
0073     virtual inline void BoostInCMS(ATOOLS::Vec4D & p) { m_CMSBoost.Boost(p); }
0074     virtual inline void BoostInCMS(ATOOLS::Vec4D_Vector& p) {
0075       for (auto& mom : p) m_CMSBoost.Boost(mom);
0076     }
0077     virtual inline void BoostInLab(ATOOLS::Vec4D & p) { m_LabBoost.Boost(p); }
0078     virtual inline void BoostInLab(ATOOLS::Vec4D_Vector& p) {
0079       for (auto& mom : p) m_LabBoost.Boost(mom);
0080     }
0081     virtual inline void BoostBackCMS(ATOOLS::Vec4D & p) { m_CMSBoost.BoostBack(p); }
0082     virtual inline void BoostBackCMS(ATOOLS::Vec4D_Vector& p) {
0083       for (auto& mom : p) m_CMSBoost.BoostBack(mom);
0084     }
0085     virtual inline void BoostBackLab(ATOOLS::Vec4D & p) { m_LabBoost.BoostBack(p); }
0086     virtual inline void BoostBackLab(ATOOLS::Vec4D_Vector& p) {
0087       for (auto& mom : p) m_LabBoost.BoostBack(mom);
0088     }
0089   };
0090 }
0091 #endif