Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef HADRONS_ME_Library_HD_ME_Base_H
0002 #define HADRONS_ME_Library_HD_ME_Base_H
0003 
0004 #include "ATOOLS/Phys/Flavour.H"
0005 #include "ATOOLS/Math/Vector.H"
0006 #include <string>
0007 #include <utility>
0008 #include "METOOLS/Main/Spin_Structure.H"
0009 #include "HADRONS++/Main/Tools.H"
0010 #include "ATOOLS/Org/Getter_Function.H"
0011 #include "ATOOLS/Org/Scoped_Settings.H"
0012 
0013 #define DEFINE_ME_GETTER(CLASS,TAG)                    \
0014   DECLARE_GETTER(CLASS,TAG,HADRONS::HD_ME_Base,HADRONS::ME_Parameters);            \
0015   HD_ME_Base* ATOOLS::Getter<HADRONS::HD_ME_Base,HADRONS::ME_Parameters,CLASS>::           \
0016   operator()(const HADRONS::ME_Parameters &parameters) const               \
0017   { return new CLASS(parameters.flavs, parameters.indices,TAG); }
0018 
0019 namespace HADRONS {
0020 
0021   /** 
0022    * Represents an amplitude for a decay process.
0023    * To store its calculated values for each helicity combination, it inherits
0024    * from METOOLS::Spin_Amplitudes.
0025    * Each class derived from this has to implement the HD_ME_Base::Calculate
0026    * method for the actual amplitude calculation.
0027    */
0028   class HD_ME_Base : public METOOLS::Spin_Amplitudes {
0029   protected:
0030     /// Name of the amplitude, e.g. B_Bpi_pwave
0031     std::string       m_name;
0032     /// Reference to flavours involved in the decay (in external order)
0033     const ATOOLS::Flavour_Vector& m_flavs;
0034     /// Array of masses of the external particles
0035     double          * p_masses,* p_masses2;
0036     /// Index mapping from external flavours/momenta to amplitude internal ones
0037     std::vector<int>  p_i;
0038 
0039     virtual double lambdaNorm(const double,const double,const double);
0040   public:
0041     /** 
0042      * Constructor which initialises all fields of the class.
0043      * 
0044      * @param flavs Flavours involved in the decay (in external order)
0045      * @param decayindices Index mapping from external flavours/momenta to
0046      * amplitude internal ones (cf. HD_ME_Base::p_i)
0047      * @param name Name of the amplitude
0048      */
0049     HD_ME_Base(const ATOOLS::Flavour_Vector& flavs,
0050                const std::vector<int>& decayindices,
0051                const std::string& name);
0052     virtual ~HD_ME_Base();
0053 
0054     /** 
0055      * Pure virtual function, which requires the implementation of the
0056      * amplitude calculation in all derived classes.
0057      * When implementing such a calculation, one has to use HD_ME_Base::Insert
0058      * to store the calculated values for all helicities combination.
0059      * 
0060      * @param momenta Momenta in external order
0061      * @param anti Whether to consider the charge conjugated process
0062      */
0063     virtual void Calculate(const ATOOLS::Vec4D_Vector& momenta,bool anti)=0;
0064 
0065     /** 
0066      * This method sets the parameters for the decay amplitude.
0067      * Every subclass of HD_ME_Base \b must have this method if it needs
0068      * parameters that are written in the decay data.
0069      * 
0070      * @param s Settings scoped to the ME's scope within the decay data
0071      */
0072     virtual void   SetModelParameters(ATOOLS::Scoped_Settings& s);
0073     virtual void   SetModelParameters( GeneralModel _md ) {};
0074 
0075     /** 
0076      * Tries to set the color flow for the particles given. This can be needed
0077      * for partonic decay channels, where the color flow is not trivial.
0078      * 
0079      * @param outparts Particles to set color flow for
0080      * @param n_q Number of gluons in outparts
0081      * @param n_g Number of quarks in outparts
0082      * @param anti Set the color flow for the charge conjugated decay.
0083      * 
0084      * @return true if setting the color flow succeeded, false if not.
0085      */
0086     virtual bool   SetColorFlow(std::vector<ATOOLS::Particle*> outparts,
0087                                 int n_q, int n_g, bool anti);
0088 
0089     //@{
0090     /// Getter/setter method.
0091     virtual std::string Name() { return m_name; }
0092     //@}
0093   };
0094 
0095   typedef ATOOLS::Getter_Function<HD_ME_Base,ME_Parameters>
0096   HD_ME_Getter_Function;
0097 }
0098 
0099 
0100 #endif