Ejemplo n.º 1
0
void BlackHat_Virtual::Calc(const Vec4D_Vector& momenta) {
  std::vector<std::vector<double> > moms(momenta.size(), std::vector<double>(4, 0.0));
  for (size_t i=0; i<momenta.size(); ++i) {
    for (size_t j=0; j<4; ++j) {
      moms[i][j]=momenta[i][j];
    }
  }
  s_interface->set("alpha_S",AlphaQCD());
  s_interface->set("alpha_QED",AlphaQED());
  BH::BHinput input(moms, sqrt(m_mur2));
  s_interface->operator()(input);

#ifdef VIRTUAL_PREFACTOR
  m_res.Finite() = p_ampl->get_finite()*0.5/VIRTUAL_PREFACTOR;
#else
  m_res.Finite() = p_ampl->get_finite();
#endif
  m_res.IR()     = p_ampl->get_single_pole();
  m_res.IR2()    = p_ampl->get_double_pole();
#ifdef INCLUDE_COUPLINGS_IN_VIRTUAL
  double norm=AlphaQCD()/(2.0*M_PI);
  m_res.Finite()/=norm;
  m_res.IR()/=norm;
  m_res.IR2()/=norm;
  m_born=p_ampl->get_born();
#endif
}
Ejemplo n.º 2
0
  void Recola_Interface::EvaluateLoop(int id, const Vec4D_Vector& momenta, double& bornres, METOOLS::DivArrD& virt)
  {
    vector<double> pp(4*momenta.size());
    
    const int NN = momenta.size();
    double fpp[NN][4];
    
    for (int i=0; i<NN; i++){
      for (int mu=0; mu<4; mu++){
	fpp[i][mu] = momenta[i][mu];
      }
    }
    double fA2[2]={0.0};
    
//    compute_process_rcl(id,fpp,NN,"NLO",fA2);
    compute_process_rcl(id,fpp,"NLO",fA2); // Change discussed in meeting. Mathieu 12/04/2017
    int procIndex(id);
    PHASIC::Process_Info pi(m_procmap[id]);
    
    get_squared_amplitude_rcl(id,pi.m_maxcpl[0]-(pi.m_fi.m_nloqcdtype==nlo_type::loop),"LO",fA2[0]);
    get_squared_amplitude_rcl(id,pi.m_maxcpl[0],"NLO",fA2[1]);
 
    bornres = fA2[0];
    virt.Finite()=fA2[1];
  }
Ejemplo n.º 3
0
void BH_Sherpa_Interface::Calc(const Vec4D_Vector& mom)
{
  std::vector<std::vector<double> > moms(mom.size(), std::vector<double>(4, 0.0));
  for (size_t i=0; i<mom.size(); ++i) {
    for (size_t j=0; j<4; ++j) {
      moms[i][j]=mom[i][j];
    }
  }
  BH::BHinput input(moms, sqrt(m_mur2));
  bhf->operator()(input);

  m_res.Finite() = p_BH->get_finite();
  m_res.IR()     = p_BH->get_single_pole();
  m_res.IR2()    = p_BH->get_double_pole();
}
Ejemplo n.º 4
0
void MCFM_qqb_v::Calc(const Vec4D_Vector &p)
{
    scale_.musq=m_mur2;
    scale_.scale=sqrt(scale_.musq);
    double corrfactor(m_normcorr);
    if (m_njets>0) {
        //msg_Out()<<"   QCD factor: "<<pow((*p_as)(m_mur2)/qcdcouple_.as,m_njets)
        //	     <<"."<<std::endl;
        corrfactor *= pow((*p_as)(m_mur2)/qcdcouple_.as,m_njets);
    }
    for (int n(0); n<2; ++n)           GetMom(p_p,n,-p[n]);
    for (size_t n(2); n<p.size(); ++n) GetMom(p_p,n,p[n]);
    long int i(m_flavs[0]), j(m_flavs[1]);
    if (i==21) {
        i=0;
        corrfactor *= 8./3.;
    }
    if (j==21) {
        j=0;
        corrfactor *= 8./3.;
    }


    epinv_.epinv=epinv2_.epinv2=0.0;
    double res(CallMCFM(i,j)  * corrfactor);
    epinv_.epinv=1.0;
    double res1(CallMCFM(i,j) * corrfactor);
    epinv2_.epinv2=1.0;
    double res2(CallMCFM(i,j) * corrfactor);
    m_res.Finite() = res;
    m_res.IR()     = (res1-res);
    m_res.IR2()    = (res2-res1);
}
Ejemplo n.º 5
0
void MCFM_gg_hg::Calc(const Vec4D_Vector &p)
{
  double corrfactor(m_cplcorr*m_normcorr*(*p_as)(m_mur2)/qcdcouple_.as);
  double sh((m_pID==204)?
	    (p[2]+p[3]).Abs2() :
	    (p[2]+p[3]+p[4]+p[5]).Abs2());
  corrfactor *= 
    (sqr(sh-sqr(masses_.hmass))+
     sqr(masses_.hmass*masses_.hwidth))/
    (sqr(sh-m_mh2)+m_mh2*m_Gh2);
  if (m_pID==208 || m_pID==209) {
    double s1((p[2]+p[3]).Abs2()),s2((p[4]+p[5]).Abs2());
    if (m_pID==208) {
      corrfactor *= 
	(sqr(s1-sqr(masses_.wmass))+
	 sqr(masses_.wmass*masses_.wwidth))/
	(sqr(s1-m_mW2)+m_mW2*m_GW2);
      corrfactor *= 
	(sqr(s2-sqr(masses_.wmass))+
	 sqr(masses_.wmass*masses_.wwidth))/
	(sqr(s2-m_mW2)+m_mW2*m_GW2);
    }
    else {
      corrfactor *= 
	(sqr(s1-sqr(masses_.zmass))+
	 sqr(masses_.zmass*masses_.zwidth))/
	(sqr(s1-m_mZ2)+m_mZ2*m_GZ2);
      corrfactor *= 
	(sqr(s2-sqr(masses_.zmass))+
	 sqr(masses_.zmass*masses_.zwidth))/
	(sqr(s2-m_mZ2)+m_mZ2*m_GZ2);
    }
  }
  for (int n(0);n<2;++n)           GetMom(p_p,n,-p[n]);
  for (size_t n(2);n<p.size();++n) GetMom(p_p,n,p[n]);
  long int i(m_flavs[0]), j(m_flavs[1]);
  if (i==21) { i=0; corrfactor *= 8./3.; }
  if (j==21) { j=0; corrfactor *= 8./3.; }
  scale_.musq=m_mur2;
  scale_.scale=sqrt(scale_.musq);

  epinv_.epinv=epinv2_.epinv2=0.0;
  double res(CallMCFM(i,j)  * corrfactor);
  epinv_.epinv=1.0;
  double res1(CallMCFM(i,j) * corrfactor);
  epinv2_.epinv2=1.0;
  double res2(CallMCFM(i,j) * corrfactor);
  m_res.Finite() = res;
  m_res.IR()     = (res1-res);
  m_res.IR2()    = (res2-res1);

  //msg_Out()<<METHOD<<" yields "<<m_res.Finite()
  //	   <<" + 1/eps * "<<m_res.IR()
  //	   <<" + 1/eps^2 * "<<m_res.IR2()
  //	   <<" for mb = "<<masses_.mb
  //	   <<" and "<<nflav_.nflav<<" active flavours"
  //	   <<" in "<<scheme_.scheme<<" ...  .\n";
}
Ejemplo n.º 6
0
void Hard_Decay_Handler::AssignPhotons(const Particle_Vector& daughters,
                                       ParticlePair_Vector& photons)
{
  // for every photon, find charged particle that's closest
  // ignore radiation off charged resonance for now
  if (photons.size()) {
    Particle_Vector cdaughters;
    for (size_t i(0);i<daughters.size();++i)
      if (daughters[i]->Flav().Charge()) cdaughters.push_back(daughters[i]);
    if (cdaughters.size()==1) {
      for (size_t i(0);i<photons.size();++i)
        photons[i].second=cdaughters[0];
    }
    else {
      Vec4D cmom(0.,0.,0.,0.);
      Vec4D_Vector cmoms;
      for (size_t i(0);i<cdaughters.size();++i) {
        cmoms.push_back(cdaughters[i]->Momentum());
        cmom+=cmoms[i];
      }
      Poincare ccms(cmom);
      for (size_t i(0);i<cdaughters.size();++i) ccms.Boost(cmoms[i]);
      for (size_t i(0);i<photons.size();++i){
        Vec4D pmom(photons[i].first->Momentum());
        ccms.Boost(pmom);
        size_t id(0);
        double dR(pmom.DR(cmoms[0]));
        for (size_t j(1);j<cmoms.size();++j) {
          double dRj(pmom.DR(cmoms[j]));
          if (dRj<dR) { id=j; dR=dRj; }
        }
        photons[i].second=cdaughters[id];
      }
    }
    for (size_t i(0);i<photons.size();++i) {
      if (photons[i].first==photons[i].second)
        THROW(fatal_error,"Photon has not been assigned.");
      msg_Debugging()<<photons[i].first->Flav()<<" "
                     <<photons[i].first->Momentum()
                     <<" assigned to "<<photons[i].second->Flav()<<std::endl;
    }
  }
}
Ejemplo n.º 7
0
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 = "<<rn[0]<<", z = "<<rn[1]
                 <<", phi = "<<rn[2]<<"\n";
  if (!m_massive) {
    m_rn[0]=Channel_Basics::PeakedDist(0.0,m_yexp,m_amin,1.0,1,rn[0]);
    m_rn[1]=Channel_Basics::PeakedDist(0.0,m_zexp,0.0,1.0,1,rn[1]);
  }
  else {
    double Q2((p[m_ijt]+p[m_kt]).Abs2());
    double eps(Q2-m_mi2-m_mj2-m_mk2);
    double ymin(Max(ymin,2.0*m_mi*m_mj/eps));
    double ymax(1.0-2.0*m_mk*(sqrt(Q2)-m_mk)/eps);
    m_rn[0]=Channel_Basics::PeakedDist(0.0,m_yexp,ymin,ymax,1,rn[0]);
    double viji(sqrt(sqr(eps*m_rn[0])-sqr(2.0*m_mi*m_mj))/
		(eps*m_rn[0]+2.0*m_mi2));
    double vijk(sqrt(sqr(2.0*m_mk2+eps*(1.0-m_rn[0]))-
		     4.0*m_mk2*Q2)/(eps*(1.0-m_rn[0])));
    double zc(0.5*(2.0*m_mi2+eps*m_rn[0])/
	      (m_mi2+m_mj2+eps*m_rn[0]));
    double zmin(zc*(1.0-viji*vijk)), zmax(zc*(1.0+viji*vijk));
    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()<<"y = "<<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 ff(m_rn[0],m_rn[1],m_rn[2]);
  if (ConstructFFDipole(m_mi2,m_mj2,m_mij2,m_mk2,p[m_ijt],p[m_kt],ff)<0)
    msg_Error()<<METHOD<<"(): Invalid kinematics."<<std::endl;
  pp[m_sub.m_i]=ff.m_pi;
  pp[m_sub.m_j]=ff.m_pj;
  pp[m_sub.m_k]=ff.m_pk;
  return pp;
}
Ejemplo n.º 8
0
double BlackHat_Tree::Calc(const Vec4D_Vector& momenta)
{
  std::vector<std::vector<double> > moms
    (momenta.size(), std::vector<double>(4, 0.0));
  for (size_t i=0; i<momenta.size(); ++i) {
    for (size_t j=0; j<4; ++j) {
      moms[i][j]=momenta[i][j];
    }
  }
  s_interface->set("alpha_S",AlphaQCD());
  s_interface->set("alpha_QED",AlphaQED());
  BH::BHinput input(moms,-1.0);
  s_interface->operator()(input);
  double res=p_ampl->get_born();
  if (m_mode) {
    res*=p_ampl->get_finite();
#ifndef INCLUDE_COUPLINGS_IN_VIRTUAL
    res*=2.0*sqr(AlphaQCD()/(4.0*M_PI));
#endif
  }
  return res;
}
Ejemplo n.º 9
0
void MCFM_qqb_QQb::Calc(const Vec4D_Vector &p)
{
  scale_.musq=m_mur2;
  scale_.scale=sqrt(scale_.musq);
  double corrfactor(m_normcpl);
  double as(MODEL::s_model->ScalarFunction(std::string("alpha_S"),m_mur2));
  if (!m_flavs[0].IsQuark()) {
    corrfactor *= 64./9.;
  }
  corrfactor *= pow(4.*M_PI*as/qcdcouple_.gsq,2);
  
  msg_Debugging()<<METHOD<<" with corr = "<<corrfactor<<" for "
	   <<m_flavs[0]<<" & "<<m_flavs[1]<<".\n";

  for (int n(0);n<2;++n) GetMom(p_p,n,-p[n]);
  if (m_pID==157) {
    for (size_t n(2);n<p.size();++n) GetMom(p_p,n,p[n]);
  }
  else {
    for (size_t n(2);n<p.size();++n) GetMom(p_p,n,p[n]);
  }

  long int i(m_flavs[0]), j(m_flavs[1]);
  if (i==21) { i=0; }
  if (j==21) { j=0; }

  epinv_.epinv=epinv2_.epinv2=0.0;
  double res(CallMCFM(i,j)  * corrfactor);
  epinv_.epinv=1.0;
  double res1(CallMCFM(i,j) * corrfactor);
  epinv2_.epinv2=1.0;
  double res2(CallMCFM(i,j) * corrfactor);

  msg_Debugging()<<"   --> "<<res<<" "<<res1<<" "<<res2<<" "
	   <<"for corrfactor/as = "<<corrfactor<<", "<<as<<".\n";
  m_res.Finite() = res;
  m_res.IR()     = (res1-res);
  m_res.IR2()    = (res2-res1);
}
Ejemplo n.º 10
0
double BlackHat_Tree::Calc(const Vec4D_Vector& momenta)
{
  std::vector<std::vector<double> > moms
    (momenta.size(), std::vector<double>(4, 0.0));
  for (size_t i=0; i<momenta.size(); ++i) {
    for (size_t j=0; j<4; ++j) {
      moms[i][j]=momenta[i][j];
    }
  }
#ifdef USING__Threading
  pthread_mutex_lock(&s_mtx);
#endif
  BH::BHinput input(moms,-1.0);
  s_interface->operator()(input);
  double res=p_ampl->get_born()*CouplingFactor(m_oqcd,m_oew);
  if (m_mode)
    res*=p_ampl->get_finite()*
      2.0*sqr(s_model->ScalarFunction("alpha_S")/(4.0*M_PI));
#ifdef USING__Threading
  pthread_mutex_unlock(&s_mtx);
#endif

  return res;
}
Ejemplo n.º 11
0
bool Fastjet_Finder::Trigger(const Vec4D_Vector &p)
{
  if (m_n<1) return true;

  std::vector<fastjet::PseudoJet> input,jets;
  for (size_t i(m_nin);i<p.size();++i) {
    if (Flavour(kf_jet).Includes(m_fl[i]) ||
	((m_nb>0 || m_nb2>0) && m_fl[i].Kfcode()==kf_b)) {
      input.push_back(MakePseudoJet(m_fl[i], p[i]));
    }
  }
  
  fastjet::ClusterSequence cs(input,*p_jdef);
  jets=fastjet::sorted_by_pt(cs.inclusive_jets());

  if (m_eekt) {
    int n(0);
    for (size_t i(0);i<input.size();++i)
      if (cs.exclusive_dmerge_max(i)>sqr(m_ptmin)) ++n;
    return (1-m_sel_log->Hit(1-(n>=m_n)));
  }

  int n(0), nb(0), nb2(0);
  for (size_t i(0);i<jets.size();++i) {
    Vec4D pj(jets[i].E(),jets[i].px(),jets[i].py(),jets[i].pz());
    if (pj.PPerp()>m_ptmin&&pj.EPerp()>m_etmin &&
	(m_eta==100 || dabs(pj.Eta())<m_eta) &&
	(m_y==100 || dabs(pj.Y())<m_y)) {
      n++;
      if (BTag(jets[i], 1)) nb++;
      if (BTag(jets[i], 2)) nb2++;
    }
  }

  bool trigger(true);
  if (n<m_n) trigger=false;
  if (nb<m_nb) trigger=false;
  if (nb2<m_nb2) trigger=false;

  return (1-m_sel_log->Hit(1-trigger));
}
Ejemplo n.º 12
0
void MCFM_qqb_WW::Calc(const Vec4D_Vector &p)
{
  double corrfactor(m_cplcorr*m_normcorr);

  for (int n(0);n<2;++n) GetMom(p_p,n,-p[n]);
  if (m_change_order){
    GetMom(p_p,2,p[4]);
    GetMom(p_p,3,p[5]);
    GetMom(p_p,4,p[2]);
    GetMom(p_p,5,p[3]);
  }
  else if (m_four_lepton)  {
    GetMom(p_p,2,p[3]);
    GetMom(p_p,3,p[4]);
    GetMom(p_p,4,p[2]);
    GetMom(p_p,5,p[5]); 
  }

  else
    for (size_t n(2);n<p.size();++n) GetMom(p_p,n,p[n]);
  
  long int i(m_flavs[0]), j(m_flavs[1]);
  if (i==21) { i=0; }
  if (j==21) { j=0; }
  scale_.musq=m_mur2;
  scale_.scale=sqrt(scale_.musq);

  epinv_.epinv=epinv2_.epinv2=0.0;
  double res(CallMCFM(i,j)  * corrfactor);
  epinv_.epinv=1.0;
  double res1(CallMCFM(i,j) * corrfactor);
  epinv2_.epinv2=1.0;
  double res2(CallMCFM(i,j) * corrfactor);

  m_res.Finite() = res;
  m_res.IR()     = (res1-res);
  m_res.IR2()    = (res2-res1);
}
Ejemplo n.º 13
0
double FF_Dipole::GenerateWeight(const 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 ff(ClusterFFDipole(m_mi2,m_mj2,m_mij2,m_mk2,
			      p[m_sub.m_i],p[m_sub.m_j],p[m_sub.m_k],1));
  if (ff.m_stat!=1) msg_Error()<<METHOD<<"(): Invalid kinematics"<<std::endl;
  m_rn[0]=ff.m_y;
  m_rn[1]=ff.m_z;
  m_rn[2]=ff.m_phi;
  pp[m_ijt]=ff.m_pi;
  pp[m_kt]=ff.m_pk;
  if (!ValidPoint(pp)) return m_weight=m_rbweight=0.0;
  if (m_bmcw) {
    p_fsmc->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 = "<<m_rn[0]<<", z = "<<m_rn[1]
                 <<", phi = "<<m_rn[2]<<"\n";
  if (m_rn[0]<m_amin) {
    m_rbweight=m_weight=0.0;
    return 0.0;
  }
  m_weight=(pp[m_ijt]+pp[m_kt]).Abs2()/(16.0*sqr(M_PI))*(1.0-m_rn[0]);
  m_weight*=pow(m_rn[0],m_yexp)*pow(m_rn[1],m_zexp);
  if (!m_massive) {
    m_weight*=Channel_Basics::PeakedWeight
      (0.0,m_yexp,m_amin,1.0,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 Q2((pp[m_ijt]+pp[m_kt]).Abs2());
    double eps(Q2-m_mi2-m_mj2-m_mk2);
    double ymin(Max(ymin,2.0*m_mi*m_mj/eps));
    double ymax(1.0-2.0*m_mk*(sqrt(Q2)-m_mk)/eps);
    double viji(sqrt(sqr(eps*m_rn[0])-sqr(2.0*m_mi*m_mj))/
		(eps*m_rn[0]+2.0*m_mi2));
    double vijk(sqrt(sqr(2.0*m_mk2+eps*(1.0-m_rn[0]))-
		     4.0*m_mk2*Q2)/(eps*(1.0-m_rn[0])));
    double zc(0.5*(2.0*m_mi2+eps*m_rn[0])/
	      (m_mi2+m_mj2+eps*m_rn[0]));
    double zmin(zc*(1.0-viji*vijk)), zmax(zc*(1.0+viji*vijk));
    m_weight*=eps*eps/Q2/sqrt(sqr(Q2-m_mij2-m_mk2)-4.0*m_mij2*m_mk2);
    m_weight*=Channel_Basics::PeakedWeight
      (0.0,m_yexp,ymin,ymax,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()<<"y = "<<m_rn[0]<<", z = "<<m_rn[1]
                 <<", phi = "<<m_rn[2]<<"\n";
  m_rbweight=m_weight*=p_vegas->GenerateWeight(m_rn);
  if (!m_bmcw) return m_weight;
  if (p_ismc) m_weight*=p_ismc->Weight();
  return m_weight*=p_fsmc->Weight();
}