#include "PHASIC++/Channels/CS_Dipoles.H" #include "PHASIC++/Channels/Multi_Channel.H" #include "PHASIC++/Channels/Vegas.H" #include "PHASIC++/Channels/Channel_Basics.H" #include "PHASIC++/Channels/CSS_Kinematics.H" #include "ATOOLS/Phys/NLO_Subevt.H" #include "ATOOLS/Math/MathTools.H" #include "ATOOLS/Math/Poincare.H" #include "ATOOLS/Math/Tensor.H" #include "ATOOLS/Org/Run_Parameter.H" #include "ATOOLS/Org/Exception.H" #include "ATOOLS/Org/Scoped_Settings.H" using namespace ATOOLS; using namespace PHASIC; FF_Dipole::FF_Dipole(NLO_subevt *const sub, Phase_Space_Handler *const psh,const bool bmcw): CS_Dipole(sub,psh,bmcw), m_mi(m_fli.Mass()), m_mj(m_flj.Mass()), m_mk(m_flk.Mass()), m_mi2(m_mi*m_mi), m_mj2(m_mj*m_mj), m_mij2(sqr(m_flij.Mass())), m_mk2(m_mk*m_mk), m_massive(m_mi||m_mj||m_mij2||m_mk) { Scoped_Settings s{ Settings::GetMainSettings()["EEG"] }; m_yexp = s["FF_Y_EXPONENT"].SetDefault(0.5).Get(); m_zexp = s["FF_Z_EXPONENT"].SetDefault(0.01).Get(); } FF_Dipole::~FF_Dipole() {} bool FF_Dipole::ValidPoint(const ATOOLS::Vec4D_Vector &p) { return m_on=2.0*p[m_ijt]*p[m_kt]>m_q2min; } Vec4D_Vector FF_Dipole::GeneratePoint (const Vec4D_Vector &p,Cut_Data *const cuts,const double *rns) { DEBUG_FUNC(""); double *rn(p_vegas->GeneratePoint(rns)); msg_Debugging()<<"vegased : "; msg_Debugging()<<"y = "<GenerateWeight(&pp.front(),cuts); if (p_ismc) { m_isrspkey[3]=(pp[0]+pp[1]).Abs2(); m_isrykey[2]=(pp[0]+pp[1]).Y(); p_ismc->GenerateWeight(m_isrmode); } } if (m_rn[2]<0.0) m_rn[2]+=2.0*M_PI; msg_Debugging()<<"again : "; msg_Debugging()<<"y = "<GenerateWeight(m_rn); if (!m_bmcw) return m_weight; if (p_ismc) m_weight*=p_ismc->Weight(); return m_weight*=p_fsmc->Weight(); } FI_Dipole::FI_Dipole(ATOOLS::NLO_subevt *const sub, Phase_Space_Handler *const psh,const bool bmcw): CS_Dipole(sub,psh,bmcw), m_mi(m_fli.Mass()), m_mj(m_flj.Mass()), m_mi2(m_mi*m_mi), m_mj2(m_mj*m_mj), m_mij2(sqr(m_flij.Mass())), m_massive(m_mi||m_mj||m_mij2) { Scoped_Settings s{ Settings::GetMainSettings()["EEG"] }; m_xexp = s["FI_X_EXPONENT"].SetDefault(0.5).Get(); m_zexp = s["FI_Z_EXPONENT"].SetDefault(0.01).Get(); } FI_Dipole::~FI_Dipole() {} bool FI_Dipole::ValidPoint(const ATOOLS::Vec4D_Vector &p) { if (p[m_ijt].PPerp2()0.0) xmin=p[m_kt].PPlus()/rpa->gen.PBeam(0).PPlus(); else xmin=p[m_kt].PMinus()/rpa->gen.PBeam(1).PMinus(); return m_on=xmin<1.0-m_amin; } ATOOLS::Vec4D_Vector FI_Dipole::GeneratePoint (const ATOOLS::Vec4D_Vector &p,Cut_Data *const cuts,const double *rns) { DEBUG_FUNC(""); double *rn(p_vegas->GeneratePoint(rns)); msg_Debugging()<<"vegased : "; if (p[m_kt][3]>0.0) m_xmin=p[m_kt].PPlus()/rpa->gen.PBeam(0).PPlus(); else m_xmin=p[m_kt].PMinus()/rpa->gen.PBeam(1).PMinus(); msg_Debugging()<<"x = "<1.0 && IsEqual(zmax,1.0)) zmax=1.0; m_rn[1]=Channel_Basics::PeakedDist(0.0,m_zexp,zmin,zmax,1,rn[1]); } m_rn[2]=rn[2]*2.0*M_PI; msg_Debugging()<<"transformed : "; msg_Debugging()<<"x = "<0.0) m_xmin=pp[m_kt].PPlus()/rpa->gen.PBeam(0).PPlus(); else m_xmin=pp[m_kt].PMinus()/rpa->gen.PBeam(1).PMinus(); msg_Debugging()<<"again : "; msg_Debugging()<<"x = "<1.0-m_amin) { m_rbweight=m_weight=0.0; return 0.0; } if (m_bmcw) { p_fsmc->GenerateWeight(&pp.front(),cuts); m_isrspkey[3]=(pp[0]+pp[1]).Abs2(); m_isrykey[2]=(pp[0]+pp[1]).Y(); p_ismc->GenerateWeight(m_isrmode); } m_weight=Q2/(16.0*sqr(M_PI))/sqr(m_rn[0]); m_weight*=pow(m_rn[0],m_xexp)*pow(m_rn[1],m_zexp); if (!m_massive) { m_weight*=Channel_Basics::PeakedWeight (0.0,m_xexp,m_xmin,1.0-m_amin,m_rn[0],1,m_rn[0]); m_weight*=Channel_Basics::PeakedWeight (0.0,m_zexp,0.0,1.0,m_rn[1],1,m_rn[1]); } else { double eps((1-m_rn[0])*Q2+m_rn[0]*(m_mij2+m_mi2-m_mj2)); double kap(sqrt(sqr(eps-2.0*m_rn[0]*m_mi2)-4.0*m_mi2*m_mj2)); double zmin(0.5*(eps-kap)/((1-m_rn[0])*Q2+m_rn[0]*m_mij2)); double zmax(0.5*(eps+kap)/((1-m_rn[0])*Q2+m_rn[0]*m_mij2)); if (zmax>1.0 && IsEqual(zmax,1.0)) zmax=1.0; m_weight*=Channel_Basics::PeakedWeight (0.0,m_xexp,m_xmin,1.0-m_amin,m_rn[0],1,m_rn[0]); m_weight*=Channel_Basics::PeakedWeight (0.0,m_zexp,zmin,zmax,m_rn[1],1,m_rn[1]); } m_rn[2]/=2.0*M_PI; msg_Debugging()<<"recovered : "; msg_Debugging()<<"x = "<GenerateWeight(m_rn); if (!m_bmcw) return m_weight; return m_weight*=p_fsmc->Weight()*p_ismc->Weight(); } IF_Dipole::IF_Dipole(ATOOLS::NLO_subevt *const sub, Phase_Space_Handler *const psh,const bool bmcw): CS_Dipole(sub,psh,bmcw), m_mk2(sqr(m_flk.Mass())) { Scoped_Settings s{ Settings::GetMainSettings()["EEG"] }; m_xexp = s["IF_X_EXPONENT"].SetDefault(0.5).Get(); m_uexp = s["IF_U_EXPONENT"].SetDefault(0.5).Get(); } IF_Dipole::~IF_Dipole() {} bool IF_Dipole::ValidPoint(const ATOOLS::Vec4D_Vector &p) { if (p[m_kt].PPerp2()0.0) xmin=p[m_ijt].PPlus()/rpa->gen.PBeam(0).PPlus(); else xmin=p[m_ijt].PMinus()/rpa->gen.PBeam(1).PMinus(); if (1.0-xminm_q2min; } ATOOLS::Vec4D_Vector IF_Dipole::GeneratePoint (const ATOOLS::Vec4D_Vector &p,Cut_Data *const cuts,const double *rns) { DEBUG_FUNC(""); double *rn(p_vegas->GeneratePoint(rns)); if (p[m_ijt][3]>0.0) m_xmin=p[m_ijt].PPlus()/rpa->gen.PBeam(0).PPlus(); else m_xmin=p[m_ijt].PMinus()/rpa->gen.PBeam(1).PMinus(); msg_Debugging()<<"vegased : "; msg_Debugging()<<"x = "<0.0) m_xmin=pp[m_ijt].PPlus()/rpa->gen.PBeam(0).PPlus(); else m_xmin=pp[m_ijt].PMinus()/rpa->gen.PBeam(1).PMinus(); msg_Debugging()<<"again : "; msg_Debugging()<<"x = "<GenerateWeight(&pp.front(),cuts); m_isrspkey[3]=(pp[0]+pp[1]).Abs2(); m_isrykey[2]=(pp[0]+pp[1]).Y(); p_ismc->GenerateWeight(m_isrmode); } double Q2(2.0*pp[m_ijt]*pp[m_kt]); m_weight=Q2/(16.0*sqr(M_PI))/sqr(m_rn[0]); m_weight*=pow(m_rn[1],m_uexp)*pow(m_rn[0],m_xexp); double umax((1.0-m_rn[0])/(1.0-m_rn[0]+m_rn[0]*m_mk2/Q2)); m_weight*=Channel_Basics::PeakedWeight (0.0,m_uexp,m_amin,umax,m_rn[1],1,m_rn[1]); m_weight*=Channel_Basics::PeakedWeight (0.0,m_xexp,m_xmin,1.0,m_rn[0],1,m_rn[0]); m_rn[2]/=2.0*M_PI; msg_Debugging()<<"recovered : "; msg_Debugging()<<"x = "<GenerateWeight(m_rn); if (!m_bmcw) return m_weight; return m_weight*=p_fsmc->Weight()*p_ismc->Weight(); } II_Dipole::II_Dipole(ATOOLS::NLO_subevt *const sub, Phase_Space_Handler *const psh,const bool bmcw): CS_Dipole(sub,psh,bmcw) { Scoped_Settings s{ Settings::GetMainSettings()["EEG"] }; m_xexp = s["II_X_EXPONENT"].SetDefault(0.5).Get(); m_vexp = s["II_V_EXPONENT"].SetDefault(0.5).Get(); } II_Dipole::~II_Dipole() {} bool II_Dipole::ValidPoint(const ATOOLS::Vec4D_Vector &p) { if (2.0*p[m_ijt]*p[m_kt]<=m_q2min) return m_on=false; double xmin(0.0); if (p[m_ijt][3]>0.0) xmin=p[m_ijt].PPlus()/rpa->gen.PBeam(0).PPlus(); else xmin=p[m_ijt].PMinus()/rpa->gen.PBeam(1).PMinus(); return m_on=xmin<1.0-m_amin; } ATOOLS::Vec4D_Vector II_Dipole::GeneratePoint (const ATOOLS::Vec4D_Vector &p,Cut_Data *const cuts,const double *rns) { DEBUG_FUNC(""); // massless x- and v-bounds so far double *rn(p_vegas->GeneratePoint(rns)); if (p[m_ijt][3]>0.0) m_xmin=p[m_ijt].PPlus()/rpa->gen.PBeam(0).PPlus(); else m_xmin=p[m_ijt].PMinus()/rpa->gen.PBeam(1).PMinus(); msg_Debugging()<<"vegased : "; msg_Debugging()<<"x = "<1.-m_rn[0]) { msg_Error()< 1-x, "<0.0) m_xmin=pp[m_ijt].PPlus()/rpa->gen.PBeam(0).PPlus(); else m_xmin=pp[m_ijt].PMinus()/rpa->gen.PBeam(1).PMinus(); msg_Debugging()<<"again : "; msg_Debugging()<<"x = "<1.0-m_amin || m_rn[1]1.0-m_rn[0]) { m_rbweight=m_weight=0.0; return 0.0; } if (m_bmcw) { p_fsmc->GenerateWeight(&pp.front(),cuts); m_isrspkey[3]=(pp[0]+pp[1]).Abs2(); m_isrykey[2]=(pp[0]+pp[1]).Y(); p_ismc->GenerateWeight(m_isrmode); } // 2(pa*pb)/16pi^2 m_weight=(p[m_sub.m_i]+p[m_sub.m_k]).Abs2()/ (16.0*sqr(M_PI))/m_rn[0]; m_weight*=pow(m_rn[1],m_vexp)*pow(m_rn[0],m_xexp); m_weight*=Channel_Basics::PeakedWeight (0.0,m_vexp,m_amin,1.0-m_rn[0],m_rn[1],1,m_rn[1]); m_weight*=Channel_Basics::PeakedWeight (0.0,m_xexp,m_xmin,1.0-m_amin,m_rn[0],1,m_rn[0]); m_rn[2]/=2.0*M_PI; msg_Debugging()<<"recovered : "; msg_Debugging()<<"x = "<GenerateWeight(m_rn); if (!m_bmcw) return m_weight; return m_weight*=p_fsmc->Weight()*p_ismc->Weight(); } void II_Dipole::Calculate (const ATOOLS::Vec4D &pi, const ATOOLS::Vec4D &pj, const ATOOLS::Vec4D &pk, const ATOOLS::Vec4D_Vector& kj, double &x, double &v, double &phi, ATOOLS::Vec4D &pijt, ATOOLS::Vec4D &pkt, ATOOLS::Vec4D_Vector& kjt) { double pipj(pi*pj), pipk(pi*pk), pjpk(pj*pk); x=(pipk-pipj-pjpk)/pipk; v=pipj/pipk; pijt=x*pi; pkt=pk; double kp(sqrt(2.*pipk*v*(1.-x-v))); Vec4D kperp(pj-(1.-x-v)/x*pijt-v*pkt); if ((kperp[1]>=0. && kperp[2]>=0.) || (kperp[1]>=0. && kperp[2]<0.)) phi=acos(kperp[2]/kp); else if ((kperp[1]<0. && kperp[2]<0.) || (kperp[1]<0. && kperp[2]>=0.)) phi=-acos(kperp[2]/kp)+2.*M_PI; else THROW(fatal_error,"Could not determine phi."); Vec4D K(pi-pj+pk), Kt(pijt+pkt); ATOOLS::Lorentz_Ten2D Lambda = MetricTensor() - 2./(K+Kt).Abs2()*BuildTensor(Kt+K,Kt+K) + 2./Kt.Abs2()*BuildTensor(Kt,K); for (size_t j(2), i(j);j ("< ("< ("< ("<