Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef HADRONS_Main_Tools_H
0002 #define HADRONS_Main_Tools_H
0003 
0004 #ifndef SQRT_05
0005 #define SQRT_05 0.70710678118654757
0006 #endif
0007 
0008 #include <map>
0009 #include <iostream>
0010 #include "ATOOLS/Math/MyComplex.H"
0011 #include "ATOOLS/Phys/Flavour.H"
0012 #include "ATOOLS/Math/Vector.H"
0013 #include "ATOOLS/Math/Matrix.H"
0014 #include "PHASIC++/Decays/Decay_Table.H"
0015 #include "ATOOLS/Org/Scoped_Settings.H"
0016 
0017 namespace HADRONS
0018 {
0019 
0020   /** 
0021    * Object containing all parameters needed to initialise a HD_ME_Base
0022    * or Current_Base. This is necessary as argument for the Getter_Function
0023    * of these objects.
0024    */
0025   struct ME_Parameters {
0026     const ATOOLS::Flavour_Vector& flavs;
0027     const std::vector<int>& indices;
0028     ME_Parameters(const ATOOLS::Flavour_Vector& _flavs,
0029                   const std::vector<int>& _indices) :
0030       flavs(_flavs), indices(_indices)
0031     {}
0032   };
0033 
0034   /**
0035    * A map with all relevant parameters for a certain decay amplitude.
0036    * It is a map that both contains the name of the parameter (as it is written
0037    * in the decay channel file) and its (double precision) value.
0038    */
0039   struct GeneralModel: public std::map<std::string,double> {
0040     
0041   public:
0042     /** 
0043      * Returns the value of the parameter with the name <var>tag</var>.
0044      * If such a parameter does not exist, it returns the default value given
0045      * by <var>def</var>.
0046      */
0047     inline double operator()(const std::string &tag,const double &def) const 
0048     {
0049       std::map<std::string,double>::const_iterator fit(find(tag));
0050       return fit!=end()?fit->second:def;
0051     }
0052 
0053   };
0054 
0055   /** 
0056    * Utility class providing some regularly needed tools. They are all
0057    * implemented as static objects, such that they can be used without
0058    * instantiation.
0059    */
0060   class Tools {
0061   public:
0062     static PHASIC::Decay_Table * partonic_b, * partonic_c;
0063     
0064     static std::map<kf_code, kf_code> aliases;
0065 
0066     /** 
0067      * Phase space function \f$\lambda = (a-b-c)^2-4bc\f$;
0068      * 
0069      * @param a 
0070      * @param b 
0071      * @param c 
0072      * 
0073      * @return \f$ \lambda \f$
0074      */
0075     static double   Lambda(double a,double b,double c);
0076     static Complex  BreitWigner( double s, double Mass2, double MassWidth );
0077     static Complex  BreitWignerFix( double s, double Mass2, double MassWidth );
0078     
0079     static double   OffShellMassWidth( double s, double Mass2, 
0080                        double Width, double ms );
0081     static double   OffShellMassWidth( double s, double Mass2, 
0082                        double Width, double ms1, double ms2 );
0083 
0084     /** 
0085      * Extracts the kfcodes from a string like {-211,111,22}
0086      * 
0087      * @param kfc The returned kfcodes will be inserted here.
0088      * @param tag The string to be parsed.
0089      * 
0090      * @return bool indicating whether parsing succeeded.
0091      */
0092     static bool     ExtractFlavours(std::vector<int>& kfc,std::string tag);
0093 
0094     //@{
0095     /** CKM matrix element. */
0096     static const double Vud;
0097     static const double Vus;
0098     static const double Vub;
0099     static const double Vcd;
0100     static const double Vcs;
0101     static const double Vcb;
0102     static const double Vtd;
0103     static const double Vts;
0104     static const double Vtb;
0105     //@}
0106 
0107     static const double GF;
0108   }; 
0109 }
0110 
0111 #endif