Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef AMEGIC_Amplitude_Zfunctions_Basic_Func_H
0002 #define AMEGIC_Amplitude_Zfunctions_Basic_Func_H
0003 
0004 #include "ATOOLS/Math/Kabbala.H"
0005 #include "AMEGIC++/Amplitude/Zfunctions/Basic_Sfuncs.H"
0006  
0007 namespace AMEGIC {
0008 
0009   class Pfunc;
0010   class Virtual_String_Generator;
0011 
0012   class Spinor {
0013   public:
0014     enum code {None = 0,
0015                u    = 1,
0016            ubar = 2,
0017                v    = 3,
0018                vbar = 4, 
0019                Unnown=99
0020     };
0021   };
0022 
0023   class Direction {
0024   public:
0025     enum code {None     =  0,
0026            Incoming = -1,
0027                Outgoing =  1,
0028                Unknown  = 99
0029     };
0030   }; 
0031 
0032   class Argument {
0033   public:
0034     kf_code        kfcode;
0035     Spinor::code    spinortype;
0036     Direction::code direction;
0037     int             numb;
0038     bool            maped;
0039     Argument() {
0040       spinortype = Spinor::None;
0041       direction  = Direction::Outgoing;
0042       numb       = -99;
0043       maped      = false;
0044     }   
0045   };
0046 
0047   inline bool operator==(const Argument& a, const Argument& b) 
0048   {
0049     if (a.spinortype!=b.spinortype) return false;
0050     if (a.direction!=b.direction) return false;
0051     if (a.numb!=b.numb) return false;
0052 
0053     return true;
0054   }
0055 
0056   inline bool operator!=(const Argument& a, const Argument& b) {return !(a==b);}
0057 
0058 
0059   class Basic_Func {
0060   public:
0061     int*                      arg;
0062     Complex*                  coupl;
0063     Argument*                 ps;
0064     int                       pn;
0065     Pfunc_List*               pl;
0066     Virtual_String_Generator* sgen;
0067     Basic_Sfuncs*             BS;
0068 
0069     Basic_Func(Virtual_String_Generator* _sgen,Basic_Sfuncs* _BS) : sgen(_sgen), BS(_BS) {}
0070     virtual ~Basic_Func();
0071 
0072     virtual ATOOLS::Kabbala X(const int,const int,const int);
0073     virtual ATOOLS::Kabbala V(const int,const int);
0074     virtual ATOOLS::Kabbala Vcplx(const int,const int,const int s=1);
0075 
0076     void SetArgCouplProp(int,int*,Complex*,int,Argument*,Pfunc_List*);
0077     void Map(int&);
0078     void Map(int&,bool&);
0079     double GetPMass(int,int);
0080   };
0081 
0082   class Basic_Yfunc : public virtual Basic_Func {
0083   public:
0084     Basic_Yfunc(Virtual_String_Generator* _sgen,Basic_Sfuncs* _BS) : Basic_Func(_sgen,_BS)  {}    
0085 
0086     ATOOLS::Kabbala Y(const int);
0087     Complex Ycalc(const int,const int,const int,const int,const Complex&,const Complex&);
0088 
0089     template <int,int>
0090     inline Complex YT(const int,const int,const Complex&,const Complex&);
0091   };
0092 
0093   class Basic_Zfunc : public virtual Basic_Func {
0094   public:
0095     Basic_Zfunc(Virtual_String_Generator* _sgen,Basic_Sfuncs* _BS) : Basic_Func(_sgen,_BS)  {}    
0096     ATOOLS::Kabbala Z(const int,const int);
0097     Complex Zcalc(const int,const int,const int,const int,
0098           const int,const int,const int,const int,
0099           const Complex&,const Complex&,const Complex&,const Complex&);
0100 
0101     int Zmassless(const int,const int,const int,const int,
0102           const int,const int,const int,const int,
0103           const Complex&,const Complex&,const Complex&,const Complex&);
0104     template <int,int,int,int>
0105     inline Complex ZT(const int,const int,
0106               const int,const int,
0107               const Complex&,const Complex&,
0108               const Complex&,const Complex&);
0109 
0110     template <int,int,int,int>
0111     inline Complex ZTM(const int,const int,
0112                const int,const int,
0113                const Complex&,const Complex&,
0114                const Complex&,const Complex&);
0115   };
0116 
0117   class Basic_Xfunc : public virtual Basic_Func {
0118   public:
0119     Basic_Xfunc(Virtual_String_Generator* _sgen,Basic_Sfuncs* _BS) : Basic_Func(_sgen,_BS)  {}    
0120     ATOOLS::Kabbala X(const int,const int);
0121     ATOOLS::Kabbala X(const int,const int,const int);
0122     Complex Xcalc(const int,const int,const int,
0123           const int,const int,
0124           const Complex&,const Complex&);
0125 
0126     template <int,int>
0127     inline Complex XT(const int,const int,const int,
0128               const Complex&,const Complex&);
0129   };
0130 
0131   class Basic_Mfunc : public virtual Basic_Func {
0132   public:
0133     Basic_Mfunc(Virtual_String_Generator* _sgen,Basic_Sfuncs* _BS) : Basic_Func(_sgen,_BS)  {}    
0134     ATOOLS::Kabbala M(const int);
0135   };
0136 
0137   class Basic_MassTermfunc : public virtual Basic_Func {
0138   public:
0139     Basic_MassTermfunc(Virtual_String_Generator* _sgen,Basic_Sfuncs* _BS) : Basic_Func(_sgen,_BS)  {}    
0140     ATOOLS::Kabbala MassTerm(int);
0141     Complex MassTermCalc(int,int);
0142     Complex MassTermCalc(int,ATOOLS::Flavour);
0143   };
0144 
0145   class Basic_Vfunc : public virtual Basic_Func {
0146   public:
0147     Basic_Vfunc(Virtual_String_Generator* _sgen,Basic_Sfuncs* _BS) : Basic_Func(_sgen,_BS)  {}    
0148     ATOOLS::Kabbala V(const int,const int);
0149     Complex Vcalc(const int,const int);
0150     ATOOLS::Kabbala Vcplx(const int a,const int b,const int s=1);
0151     Complex Vcplxcalc(const int,const int);
0152   };
0153 
0154   class Basic_Pfunc : public virtual Basic_Func {
0155     Complex Ifunc(double,int);
0156     double IEfunc(double,int);
0157     Complex KKProp(double);
0158   public:
0159     Basic_Pfunc(Virtual_String_Generator* _sgen,Basic_Sfuncs* _BS) : Basic_Func(_sgen,_BS)  {} 
0160     Complex Propagator(double,ATOOLS::Flavour);
0161     Complex Pcalc(const int,const int);
0162     Complex Pcalc(const ATOOLS::Flavour&,const int);
0163     ATOOLS::Kabbala P(Pfunc*);
0164   };
0165 
0166   class Basic_Epsilonfunc : public virtual Basic_Func {
0167   public:
0168     double EC(const ATOOLS::Vec4D*,const ATOOLS::Vec4D*,const ATOOLS::Vec4D*,const ATOOLS::Vec4D*);
0169   public:
0170     Basic_Epsilonfunc(Virtual_String_Generator* _sgen,Basic_Sfuncs* _BS) : Basic_Func(_sgen,_BS)  {}    
0171     ATOOLS::Kabbala Epsilon(const int,const int,const int,const int,int=1);
0172     Complex EpsCalc(const int,const int,const int,const int,const int);
0173     template <int> Complex EpsCalc(const int,const int,const int,const int);
0174   };
0175   template <> Complex Basic_Epsilonfunc::EpsCalc<0>(const int,const int,const int,const int);
0176   template <> Complex Basic_Epsilonfunc::EpsCalc<1>(const int,const int,const int,const int);
0177   template <> Complex Basic_Epsilonfunc::EpsCalc<2>(const int,const int,const int,const int);
0178   template <> Complex Basic_Epsilonfunc::EpsCalc<3>(const int,const int,const int,const int);
0179   template <> Complex Basic_Epsilonfunc::EpsCalc<4>(const int,const int,const int,const int);
0180 
0181   class Unitarityfunc : public virtual Basic_Func {
0182     double m_n,m_m,m_lambda2,m_n3,m_n4,m_m3,m_m4,m_lambda2_3,m_lambda2_4;
0183   public:
0184     Unitarityfunc(Virtual_String_Generator* _sgen,Basic_Sfuncs* _BS);
0185     Complex Ucalc(const int & n);
0186     ATOOLS::Kabbala U(const int & n=3);
0187   };
0188 
0189 
0190   /*!
0191     \class Basic_Func
0192     The mother class of all basic functions and calculator funtions.
0193   */
0194   /*!
0195     \fn void Basic_Func::SetArgCouplProp(int,int*,Complex*,int,Argument*,Pfunc_List*)
0196     Copies a pointer to arrays of coupling constants, arguments and propagator lists,
0197     to be used by the derived classes.
0198   */
0199   /*!
0200     \fn void Basic_Func::Map(int&)
0201     Maps arguments from amplitude labels to the position of the corresponding vector
0202     in Basic_Sfuncs::Momlist.
0203   */
0204   /*!
0205     \fn void Basic_Func::Map(int&,bool&)
0206     Maps propagators from amplitude labels to the position of the corresponding vector
0207     in Basic_Sfuncs::Momlist and ensures no double mapping.
0208   */
0209   /*!
0210     \fn double Basic_Func::GetPMass(int a,int sign)
0211     Determines the particle mass of propagator with label a, if sign has the mt code for
0212     a scalar polarization, otherwise 0.
0213   */
0214 
0215 
0216   /*!
0217     \class Basic_Xfunc
0218     \brief A basic structure within the helicity formalism.
0219 
0220     The definition for the basic X function is
0221     \f[
0222     X(p_1,\lambda_1;p_2;p_3,\lambda_3;c_L,c_R) = 
0223     \bar u(p_1,\lambda_1) p\!\!\!/_2[c_LP_L+c_RP_R]u(p_3,\lambda_3).
0224     \f]
0225     
0226     Using a spinor basis, the results reads 
0227     <table border>
0228       <tr>
0229         <td> \f$\lambda_1\lambda_3\f$ </td>
0230         <td> \f$X(p_1,\lambda_1;p_2;p_3,\lambda_3;c_L,c_R)\f$ </td>
0231       </tr>
0232       <tr>
0233         <td> \f$++\f$ </td>
0234     <td> \f$ \mu_1\mu_3\eta_2^2c_L+\mu_2^2\eta_1\eta_3c_R 
0235     +c_RS(+;p_1,p_2)S(-;p_2,p_3)\f$ </td>
0236       </tr>
0237       <tr>
0238         <td> \f$+-\f$ </td>
0239     <td> \f$c_L\mu_1\eta_2S(+;p_2,p_3)+c_R\mu_3\eta_2S(+;p_1,p_2)\f$ </td>
0240       </tr>
0241     </table>
0242 
0243     Missing combinations can be obtained through the 
0244     replacements \f$+ \leftrightarrow -\f$ and \f$L \leftrightarrow R\f$.
0245     
0246     For the definition of \f$\eta\,,\mu\f$ and S functions see class Basic_Sfuncs.
0247   */
0248   /*!
0249     \fn ATOOLS::Kabbala Basic_Xfunc::X(const int a,const int b)
0250     This method is usually called from calculator classes (Zfunc_Calc).
0251     a is an index for the argument array Basic_Func::arg, 
0252     b of the propagator array Basic_Func::ps.
0253 
0254     The method calls the String_Generator and Basic_Xfunc::Xcalc for the numerics.
0255   */
0256   /*!
0257     \fn ATOOLS::Kabbala Basic_Xfunc::X(const int a,const int b,const int m)
0258     This method is usually called from Basic_Zfuncs, if there is the dummy 99 in the argument 
0259     list to indicate an explicit polarization vector.
0260 
0261     Calls Basic_Xfunc::Xcalc with the polarization vector in  \f$p_2\f$.
0262   */
0263   /*!
0264     \fn Complex Basic_Xfunc::Xcalc(const int t1,const int s1,const int t2,const int t3,const int s2,const Complex& cR,const Complex& cL)
0265     Performs the numerical calculation as in the table in the class description.
0266     t1,t2,t3 are indices for Basic_Sfuncs::Momlist and refer to p; s1,s3 refer to \f$\lambda\f$.
0267   */  
0268 
0269   /*!
0270     \class Basic_Yfunc
0271     \brief A basic structure within the helicity formalism.
0272 
0273     The definition for the basic Y function is
0274     \f[
0275     Y(p_1,\lambda_1;p_2,\lambda_2;{c_R,c_L}) \equiv
0276     \bar u(p_1,\lambda_1)\left[c_R P_R + c_L P_L\right]u(p_2,\lambda_2)
0277     \f]
0278     
0279     Using a spinor basis, the results reads 
0280     <table border>
0281       <tr>
0282         <td> \f$\lambda_1\lambda_2\f$ </td>
0283         <td> \f$Y(p_1,\lambda_1;p_2,\lambda_2;c_L,c_R)\f$ </td>
0284       </tr>
0285       <tr>
0286         <td> \f$++\f$ </td>
0287     <td> \f$ c_R\mu_1\eta_2 + c_L\mu_2\eta_1\f$ </td>
0288       </tr>
0289       <tr>
0290         <td> \f$+-\f$ </td>
0291     <td> \f$ c_LS(+;p_1,p_2)\f$ </td>
0292       </tr>
0293     </table>
0294 
0295     Missing combinations can be obtained through the 
0296     replacements \f$+ \leftrightarrow -\f$ and \f$L \leftrightarrow R\f$.
0297     
0298     For the definition of \f$\eta\,,\mu\f$ and S functions see class Basic_Sfuncs.
0299   */
0300   /*!
0301     \fn ATOOLS::Kabbala Basic_Yfunc::Y(const int a)
0302     This method is usually called from calculator classes (Zfunc_Calc).
0303     a is an index of the argument array Basic_Func::arg.
0304 
0305     The method calls the String_Generator and Basic_Yfunc::Ycalc for the numerics.
0306   */
0307   /*!
0308     \fn Complex Basic_Yfunc::Ycalc(const int t1,const int s1,const int t2,const int s2,const Complex& cR,const Complex& cL)
0309     Performs the numerical calculation as in the table in the class description.
0310     t1,t2 are indices for Basic_Sfuncs::Momlist and refer to p; s1,s2 refer to \f$\lambda\f$.
0311   */  
0312 
0313   /*!
0314     \class Basic_Zfunc
0315     \brief A basic structure within the helicity formalism.
0316 
0317     The definition for the basic Z function is
0318     \f[
0319     Z(p_1,\lambda_1;p_2,\lambda_2; p_3,\lambda_3;p_4,\lambda_4;
0320     c_L^{12},c_R^{12};c_L^{34},c_R^{34}) =
0321     \bar u(p_1,\lambda_1)\gamma^\mu [c_L^{12}P_L+c_R^{12}P_R]u(p_2,\lambda_2)
0322     \bar u(p_3,\lambda_3)\gamma_\mu [c_L^{34}P_L+c_R^{34}P_R]u(p_4,\lambda_4)    
0323     \f]
0324     
0325     Using a spinor basis, the results reads 
0326     <table border>
0327       <tr>
0328         <td> \f$\lambda_1\lambda_2\lambda_3\lambda_4\f$ </td>
0329         <td> \f$Z(p_1,\lambda_1;p_2,\lambda_2;
0330             p_3,\lambda_3;p_4,\lambda_4; c_L^{12},c_R^{12};c_L^{34},c_R^{34})\f$ </td>
0331       </tr>
0332       <tr>
0333         <td> \f$++++\f$ </td>
0334     <td> \f$2\left[S(+;p_3,p_1)S(-;p_2,p_4)c_R^{12}c_R^{34}+ \mu_1\mu_2\eta_3
0335             \eta_4c_L^{12}c_R^{34}+ \mu_3\mu_4\eta_1\eta_2c_R^{12}c_L^{34}\right]\f$ </td>
0336       </tr>
0337       <tr>
0338         <td> \f$+++-\f$ </td>
0339     <td> \f$2\eta_2c_R^{12}\left[S(+;p_1,p_4)\mu_3c_L^{34} +S(+;p_1,p_3)
0340          \mu_4c_R^{34}\right]\f$ </td>
0341       </tr>
0342       <tr>
0343         <td> \f$++-+\f$ </td>
0344     <td> \f$2\eta_1c_R^{12}\left[S(-;p_3,p_2)\mu_4c_L^{34} q +S(-;p_4,p_2)
0345          \mu_3c_R^{34}\right]\f$ </td>
0346       </tr>
0347       <tr>
0348         <td> \f$++--\f$ </td>
0349     <td> \f$2\left[S(+;p_4,p_1)S(-;p_2,p_3)c_R^{12}c_L^{34}+ \mu_1\mu_2\eta_3
0350             \eta_4c_L^{12}c_L^{34}+ \mu_3\mu_4\eta_1\eta_2c_R^{12}c_R^{34}\right]\f$ </td>
0351       </tr>
0352       <tr>
0353         <td> \f$+-++\f$ </td>
0354     <td> \f$2\eta_4c_R^{34}\left[S(+;p_1,p_3)\mu_2c_R^{12} +S(+;p_2,p_3)
0355             \mu_1c_L^{12}\right]\f$ </td>
0356       </tr>
0357       <tr>
0358         <td> \f$+-+-\f$ </td>
0359     <td> 0 </td>
0360       </tr>
0361       <tr>
0362         <td> \f$+--+\f$ </td>
0363     <td> \f$-2\left[ \mu_1\mu_4\eta_2\eta_3c_L^{12}c_L^{34} +\mu_2\mu_3
0364             \eta_1\eta_4c_R^{12}c_R^{34} -\mu_1\mu_3\eta_2\eta_4c_L^{12}c_R^{34}
0365             -\mu_2\mu_4\eta_1\eta_3c_R^{12}c_L^{34}\right]\f$ </td>
0366       </tr>
0367       <tr>
0368         <td> \f$+---\f$ </td>
0369     <td> \f$2\eta_3c_L^{34}\left[S(+;p_4,p_2)\mu_1c_L^{12} +S(+;p_1,p_4)
0370             \mu_2c_R^{12}\right]\f$ </td>
0371       </tr>
0372     </table>
0373 
0374     Missing combinations can be obtained through the 
0375     replacements \f$+ \leftrightarrow -\f$ and \f$L \leftrightarrow R\f$.
0376     
0377     For the definition of \f$\eta\,,\mu\f$ and S functions see class Basic_Sfuncs.
0378   */
0379   /*!
0380     \fn ATOOLS::Kabbala Basic_Zfunc::Z(const int a, const int b)
0381     This method is usually called from calculator classes (Zfunc_Calc).
0382     a,b are indices of the argument array Basic_Func::arg.
0383 
0384     The method calls the String_Generator and Basic_Zfunc::Zcalc for the numerics.
0385   */
0386   /*!
0387     \fn Complex Basic_Zfunc::Zcalc(const int t1,const int s1,const int t2,const int s2,const int t3,const int s3,const int t4,const int s4,const Complex& cR1,const Complex& cL1,const Complex& cR2,const Complex& cL2)
0388     Performs the numerical calculation as in the table in the class description.
0389     t1-t4 are indices for Basic_Sfuncs::Momlist and refer to p; s1-s4 refer to \f$\lambda\f$.
0390   */  
0391 
0392   /*!
0393     \class Basic_Vfunc
0394     A basic function to calculate a scalar product of four-vectors 
0395   */
0396   /*!
0397     \fn ATOOLS::Kabbala Basic_Vfunc::V(const int a,const int b)
0398     This method is usually called from calculator classes (Zfunc_Calc).
0399     a,b are indices of the propagator array Basic_Func::ps.
0400 
0401     The method calls the String_Generator and Basic_Vfunc::Vcalc for the numerics.
0402   */
0403   /*!
0404     \fn Complex Basic_Vfunc::Vcalc(const int a,const int b)
0405     Numerical calculation of the scalar product.
0406     a,b are indices for Basic_Sfuncs::Momlist.
0407   */  
0408   /*!
0409     \fn ATOOLS::Kabbala Basic_Vfunc::Vcplx(const int a,const int b,const int s)
0410     Polarization vectors may be complex. This method checks the type of a vector
0411     and calculates it using Basic_Vfunc::Vcalc or Basic_Vfunc::Vcplxcalc respectively.
0412     a,b are indices for Basic_Sfuncs::Momlist.
0413 
0414     The method calls the String_Generator and Basic_Vfunc::Vcalc for the numerics.
0415   */
0416   /*!
0417     \fn Complex Basic_Vfunc::Vcplxcalc(const int a,const int b)
0418     Numerical calculation for a complex scalar product.
0419     a,b are indices for Basic_Sfuncs::Momlist.
0420   */  
0421 
0422   /*!
0423     \class Basic_Mfunc
0424     Basic function to determine the mass term in massive propagators.
0425   */
0426   /*!
0427     \fn ATOOLS::Kabbala Basic_Mfunc::M(const int a)
0428     Returns \f$\frac{1}{\rm{Mass}^2}\f$ for the propagator with index a in Basic_Func::ps.
0429     If the propagator is massless 0 is returned.
0430   */
0431 
0432   /*!
0433     \class Basic_Pfunc
0434     Basic function to calculate the propagator factors. 
0435   */
0436 }
0437 
0438 #include "Basic_Func.icc"
0439 //#include "AMEGIC++/String/String_Generator.H"
0440 
0441 
0442 #endif