void Meson_Capture_Off_Shell(Particle &daughter1, Particle &daughter2, Particle &mediator, double theta){ double thetad = mediator.Theta(); double phid = mediator.Phi(); mediator.Rotate_y(-phid); mediator.Rotate_z(-thetad); TwoBodyDecay(mediator, daughter1, daughter2, theta); mediator.Rotate_z(thetad); mediator.Rotate_y(phid); daughter1.Rotate_z(thetad); daughter1.Rotate_y(phid); daughter2.Rotate_z(thetad); daughter2.Rotate_y(phid); Link_Particles(mediator,daughter1); Link_Particles(mediator,daughter2); }
void Nucleon_Scatter::scatterevent (Particle &DM, Particle &Nucleon, std::function<double(double)> Xsec, Linear_Interpolation& Xmax){ double EDMMax = scatmax(DM.E); double EDMMin = scatmin(DM.E, DM.m, Nucleon.m); double dsigmax = std::max(Xsec(EDMMax),Xmax.Interpolate(DM.E)); double xe,thetaN,phiN,pN; while(true){ xe = Random::Flat(0,1)*(EDMMax-EDMMin)+EDMMin; if(Xsec(xe)/dsigmax > Random::Flat(0,1)){ thetaN = Ef_to_N_Theta(DM.E,xe,DM.m,Nucleon.m); phiN = Random::Flat(0,1)*2*pi; pN = sqrt(pow(DM.E+Nucleon.m-xe,2)-pow(Nucleon.m,2)); Nucleon.ThreeMomentum(pN*sin(thetaN)*cos(phiN),pN*sin(thetaN)*sin(phiN),cos(thetaN)*pN); Nucleon.Rotate_y(DM.Theta()); Nucleon.Rotate_z(DM.Phi()); break; } } }