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 (m_ijt==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 = "<<rn[0]<<", v = "<<rn[1] <<", phi = "<<rn[2]<<", xmin = "<<m_xmin<<"\n"; m_rn[0]=Channel_Basics::PeakedDist(0.0,m_xexp,m_xmin,1.0-m_amin,1,rn[0]); m_rn[1]=Channel_Basics::PeakedDist(0.0,m_vexp,m_amin,1.0-m_rn[0],1,rn[1]); m_rn[2]=rn[2]*2.0*M_PI; msg_Debugging()<<"transformed : "; msg_Debugging()<<"x = "<<m_rn[0]<<", v = "<<m_rn[1] <<", phi = "<<m_rn[2]<<"\n"; Vec4D_Vector pp(p.size()+1); for (size_t i(0);i<p.size();++i) pp[m_brmap[i]]=p[i]; if (m_rn[1]>1.-m_rn[0]) { msg_Error()<<METHOD<<"(): v > 1-x, "<<m_rn[1] <<" vs. "<<1.0-m_rn[0]<<"\n"; m_rn[1]=(1.0-1.0e-6)*(1.0-m_rn[0]); } Construct(pp[m_sub.m_i],pp[m_sub.m_j],pp[m_sub.m_k],pp, m_rn[0],m_rn[1],m_rn[2],p[m_ijt],p[m_kt],p); return pp; }
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 (m_ijt==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 = "<<rn[0]<<", u = "<<rn[1] <<", phi = "<<rn[2]<<", xmin = "<<m_xmin<<"\n"; m_rn[0]=Channel_Basics::PeakedDist(0.0,m_xexp,m_xmin,1.0,1,rn[0]); double umax((1.0-m_rn[0])/(1.0-m_rn[0]+m_rn[0]*m_mk2/(2.0*p[m_ijt]*p[m_kt]))); m_rn[1]=Channel_Basics::PeakedDist(0.0,m_uexp,m_amin,umax,1,rn[1]); m_rn[2]=rn[2]*2.0*M_PI; msg_Debugging()<<"transformed : "; msg_Debugging()<<"x = "<<m_rn[0]<<", u = "<<m_rn[1] <<", phi = "<<m_rn[2]<<"\n"; Vec4D_Vector pp(p.size()+1); for (size_t i(0);i<p.size();++i) pp[m_brmap[i]]=p[i]; Kin_Args ifp(m_rn[1],m_rn[0],m_rn[2],1); if (ConstructIFDipole(0.0,0.0,0.0,m_mk2,0.0, p[m_ijt],p[m_kt],Vec4D(),ifp)<0) msg_Error()<<METHOD<<"(): Invalid kinematics"<<std::endl; pp[m_sub.m_i]=ifp.m_pi; pp[m_sub.m_j]=ifp.m_pj; pp[m_sub.m_k]=ifp.m_pk; if (m_ijt!=m_sub.m_i) { for (size_t i(0);i<pp.size();++i) pp[i]=Rotate(pp[i]); } return pp; }
double FI_Dipole::GenerateWeight (const ATOOLS::Vec4D_Vector &p,Cut_Data *const cuts) { Vec4D_Vector pp(p.size()-1); for (size_t i(0);i<p.size();++i) pp[m_rbmap[i]]=p[i]; Kin_Args fi(ClusterFIDipole(m_mi2,m_mj2,m_mij2,0.0, p[m_sub.m_i],p[m_sub.m_j],p[m_sub.m_k],1)); if (fi.m_stat!=1) msg_Error()<<METHOD<<"(): Invalid kinematics"<<std::endl; m_rn[0]=1.0-fi.m_y; m_rn[1]=fi.m_z; m_rn[2]=fi.m_phi; pp[m_ijt]=fi.m_pi; pp[m_kt]=fi.m_pk; double Q2(2.0*pp[m_ijt]*pp[m_kt]); if (!ValidPoint(pp)) return m_weight=m_rbweight=0.0; if (m_rn[2]<0.0) m_rn[2]+=2.0*M_PI; if (m_kt==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 = "<<m_rn[0]<<", z = "<<m_rn[1] <<", phi = "<<m_rn[2]<<"\n"; if (m_rn[0]<m_xmin || m_rn[0]>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 = "<<m_rn[0]<<", z = "<<m_rn[1] <<", phi = "<<m_rn[2]<<", xmin = "<<m_xmin<<"\n"; m_rbweight=m_weight*=p_vegas->GenerateWeight(m_rn); if (!m_bmcw) return m_weight; return m_weight*=p_fsmc->Weight()*p_ismc->Weight(); }
double AMEGIC::Single_Process_External::DSigma(const ATOOLS::Vec4D_Vector &_moms,bool lookup) { m_lastxs = 0.; if (p_partner == this) { m_lastxs = m_Norm * operator()((ATOOLS::Vec4D*)&_moms.front()); } else { if (lookup && p_partner->m_lookup) m_lastxs = p_partner->LastXS()*m_sfactor; else m_lastxs = m_Norm * p_partner->operator()((ATOOLS::Vec4D*)&_moms.front())*m_sfactor; } return m_lastxs; }
double Decay_Channel::Differential(ATOOLS::Vec4D_Vector& momenta, bool anti, METOOLS::Spin_Density* sigma, const std::vector<ATOOLS::Particle*>& p) { Poincare labboost(momenta[0]); labboost.Boost(momenta[0]); Channels()->GeneratePoint(&momenta.front(),NULL); Channels()->GenerateWeight(&momenta.front(),NULL); labboost.Invert(); for (size_t i(0); i<momenta.size(); ++i) labboost.Boost(momenta[i]); double dsigma_lab=ME2(momenta, anti, sigma, p); return dsigma_lab*Channels()->Weight(); }
void Comix1to3::Calculate(const ATOOLS::Vec4D_Vector& momenta, bool anti) { DEBUG_FUNC(momenta.size()); p_ci->GeneratePoint(); if (anti) { for (size_t i(0);i<m_anticur.size();++i) { m_anticur[i]->ConstructJ(i==0?-momenta[i]:momenta[i],0,p_ci->I()[i],p_ci->J()[i],0); m_anticur[i]->Print(); } m_antiscur->Evaluate(); m_antifcur->Evaluate(); } else { for (size_t i(0);i<m_cur.size();++i) { m_cur[i]->ConstructJ(i==0?-momenta[i]:momenta[i],0,p_ci->I()[i],p_ci->J()[i],0); m_cur[i]->Print(); } m_scur->Evaluate(); m_fcur->Evaluate(); } vector<int> fill(m_n,1); for (size_t i(0);i<m_n;++i) (*this)[i]=Complex(0.0,0.0); if (anti) { m_antifcur->Contract<double>(*m_anticur.front(),fill,*this,0); } else { m_fcur->Contract<double>(*m_cur.front(),fill,*this,0); } for (size_t i=0; i<size(); ++i) { (*this)[i] *= sqrt(p_ci->GlobalWeight()); } }
double AMEGIC::Single_Process_MHV::DSigma(const ATOOLS::Vec4D_Vector &_moms,bool lookup) { m_lastxs = 0.; if (m_nin==2) { for (size_t i=0;i<m_nin+m_nout;i++) { if (_moms[i][0]<m_flavs[i].Mass()) return 0.0; } } if (m_nin==1) { for (size_t i=m_nin;i<m_nin+m_nout;i++) { if (_moms[i][0]<m_flavs[i].Mass()) return 0.0; } } if (p_partner == this) { m_lastxs = m_Norm * operator()((ATOOLS::Vec4D*)&_moms.front()); } else { if (lookup && p_partner->m_lookup) m_lastxs = p_partner->LastXS()*m_sfactor; else m_lastxs = m_Norm * p_partner->operator()((ATOOLS::Vec4D*)&_moms.front())*m_sfactor; } return m_lastxs; }
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 (m_kt==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 = "<<rn[0]<<", z = "<<rn[1] <<", phi = "<<rn[2]<<", xmin = "<<m_xmin<<"\n"; if (!m_massive) { m_rn[0]=Channel_Basics::PeakedDist(0.0,m_xexp,m_xmin,1.0-m_amin,1,rn[0]); m_rn[1]=Channel_Basics::PeakedDist(0.0,m_zexp,0.0,1.0,1,rn[1]); } else { double Q2(2.0*p[m_ijt]*p[m_kt]); m_rn[0]=Channel_Basics::PeakedDist(0.0,m_xexp,m_xmin,1-m_amin,1,rn[0]); 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_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 = "<<m_rn[0]<<", z = "<<m_rn[1] <<", phi = "<<m_rn[2]<<"\n"; Vec4D_Vector pp(p.size()+1); for (size_t i(0);i<p.size();++i) pp[m_brmap[i]]=p[i]; Kin_Args fi(1.0-m_rn[0],m_rn[1],m_rn[2]); if (ConstructFIDipole(m_mi2,m_mj2,m_mij2,0.0,p[m_ijt],p[m_kt],fi)<0) msg_Error()<<METHOD<<"(): Invalid kinematics"<<std::endl; pp[m_sub.m_i]=fi.m_pi; pp[m_sub.m_j]=fi.m_pj; pp[m_sub.m_k]=fi.m_pk; return pp; }
void Decay_Channel:: GenerateKinematics(ATOOLS::Vec4D_Vector& momenta, bool anti, METOOLS::Spin_Density* sigma, const std::vector<ATOOLS::Particle*>& parts) { static std::string mname(METHOD); Return_Value::IncCall(mname); if(momenta.size()==2) { momenta[1]=momenta[0]; if (sigma) { if (p_amps) delete p_amps; p_amps=new Amplitude2_Tensor(parts, 0); } return; } double value(0.); int trials(0); do { if(trials>10000) { msg_Error()<<METHOD<<"("<<Name()<<"): " <<"Rejected decay kinematics 10000 times. " <<"This indicates a wrong maximum. " <<"Will accept kinematics." <<endl; Return_Value::IncRetryMethod(mname); break; } value = Differential(momenta,anti,sigma, parts); if(value/m_max>1.05 && m_max>1e-30) { if(value/m_max>1.3) { msg_Info()<<METHOD<<"("<<Name()<<") warning:"<<endl <<" d\\Gamma(x)="<<value<<" > max(d\\Gamma)="<<m_max <<std::endl; } m_max=value; Return_Value::IncRetryMethod(mname); break; } trials++; } while( ran->Get() > value/m_max ); }
double II_Dipole::GenerateWeight (const ATOOLS::Vec4D_Vector &p,Cut_Data *const cuts) { // massless x-/v-bounds and weight so far Vec4D_Vector pp(p.size()-1); Calculate(p[m_sub.m_i],p[m_sub.m_j],p[m_sub.m_k],p, m_rn[0],m_rn[1],m_rn[2],pp[m_ijt],pp[m_kt],pp); if (!ValidPoint(pp)) return m_weight=m_rbweight=0.0; if (m_rn[2]<0.0) m_rn[2]+=2.0*M_PI; if (m_ijt==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 = "<<m_rn[0]<<", v = "<<m_rn[1] <<", phi = "<<m_rn[2]<<"\n"; if (m_rn[0]<m_xmin || m_rn[0]>1.0-m_amin || m_rn[1]<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 = "<<m_rn[0]<<", v = "<<m_rn[1] <<", phi = "<<m_rn[2]<<", xmin = "<<m_xmin<<"\n"; m_rbweight=m_weight*=p_vegas->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); pijt=Rotate(pijt); pkt=Rotate(pkt); for (size_t j(2), i(j);j<kjt.size();++i,++j) { if (i==m_sub.m_j) ++i; kjt[m_rbmap[i]] = Rotate(Contraction(Lambda,2,kj[i])); msg_Debugging()<<"("<<i<<"):"<<kj[i] <<" -> ("<<m_rbmap[i]<<"):"<<kjt[m_rbmap[i]]<<std::endl; } }
void II_Dipole::Construct (ATOOLS::Vec4D &pi, ATOOLS::Vec4D &pj, ATOOLS::Vec4D &pk, ATOOLS::Vec4D_Vector& kj, const double &x, const double &v, const double &phi, const ATOOLS::Vec4D &ipijt, const ATOOLS::Vec4D &ipkt, const ATOOLS::Vec4D_Vector& kjt) { DEBUG_FUNC(""); Vec4D pijt=Rotate(ipijt); Vec4D pkt=Rotate(ipkt); pi=1./x*pijt; pk=pkt; double kp=sqrt(2.*pi*pk*v*(1.-x-v)); Vec4D kperp(0.,sin(phi)*kp,cos(phi)*kp,0.); pj=(1.-x-v)/x*pijt + v*pkt + kperp; msg_Debugging()<<"("<<m_ijt<<"):"<<pijt <<" -> ("<<m_sub.m_i<<"):"<<pi <<" ("<<m_sub.m_j<<"):"<<pj<<std::endl; msg_Debugging()<<"("<<m_kt<<"):"<<pkt <<" -> ("<<m_sub.m_k<<"):"<<pk<<std::endl; 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(K,Kt); for (size_t i(0);i<kjt.size();++i) { if (i!=m_ijt && i!=m_kt) { kj[m_brmap[i]] = Contraction(Lambda,2,Rotate(kjt[i])); msg_Debugging()<<"("<<i<<"):"<<kjt[i] <<" -> ("<<m_brmap[i]<<"):"<<kj[m_brmap[i]]<<std::endl; } } }
double IF_Dipole::GenerateWeight (const ATOOLS::Vec4D_Vector &p,Cut_Data *const cuts) { Vec4D_Vector pp(p.size()-1); for (size_t i(0);i<p.size();++i) pp[m_rbmap[i]]=p[i]; if (m_ijt==m_sub.m_i) { Kin_Args ifp(ClusterIFDipole (0.0,0.0,0.0,m_mk2,0.0, p[m_sub.m_i],p[m_sub.m_j],p[m_sub.m_k],Vec4D(),1|4)); if (ifp.m_stat!=1) msg_Error()<<METHOD<<"(): Invalid kinematics"<<std::endl; m_rn[0]=ifp.m_z; m_rn[1]=ifp.m_y; m_rn[2]=ifp.m_phi; pp[m_ijt]=ifp.m_pi; pp[m_kt]=ifp.m_pk; } else { for (size_t i(0);i<pp.size();++i) pp[i]=Rotate(pp[i]); Kin_Args ifp(ClusterIFDipole (0.0,0.0,0.0,m_mk2,0.0, Rotate(p[m_sub.m_i]),Rotate(p[m_sub.m_j]), Rotate(p[m_sub.m_k]),Vec4D(),1|4)); if (ifp.m_stat!=1) msg_Error()<<METHOD<<"(): Invalid kinematics"<<std::endl; m_rn[0]=ifp.m_z; m_rn[1]=ifp.m_y; m_rn[2]=ifp.m_phi; pp[m_ijt]=ifp.m_pi; pp[m_kt]=ifp.m_pk; } if (!ValidPoint(pp)) return m_weight=m_rbweight=0.0; if (m_rn[2]<0.0) m_rn[2]+=2.0*M_PI; if (m_ijt==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 = "<<m_rn[0]<<", u = "<<m_rn[1] <<", phi = "<<m_rn[2]<<"\n"; if (m_rn[0]<m_xmin || m_rn[1]<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); } 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 = "<<m_rn[0]<<", u = "<<m_rn[1] <<", phi = "<<m_rn[2]<<", xmin = "<<m_xmin<<"\n"; m_rbweight=m_weight*=p_vegas->GenerateWeight(m_rn); if (!m_bmcw) return m_weight; return m_weight*=p_fsmc->Weight()*p_ismc->Weight(); }