sherpa is hosted by Hepforge, IPPP Durham
close Warning: Can't synchronize with repository "(default)" (/hepforge/svn/sherpa does not appear to be a Subversion repository.). Look in the Trac log for more information.

Ticket #371: pdf_ratio.patch

File pdf_ratio.patch, 4.2 KB (added by Johannes Krause, 7 years ago)
  • SHERPA/PerturbativePhysics/Perturbative_Interface.C

     
    264264        mcnloproc->SetVariationWeights(p_localkfactorvarweights);
    265265        double K(mcnloproc->LocalKFactor(*ampl));
    266266        mcnloproc->SetVariationWeights(NULL);
    267         if (K==0.0 || dabs(K)>m_maxkfac) continue;
     267    //skip maximum treshold, hopefully covered by pdf ratio treatment
     268    //if (K==0.0 || dabs(K)>m_maxkfac) continue;
     269    if (K==0.0) continue;
    268270        m_weight*=K;
    269271        return true;
    270272      }
  • PHASIC++/Process/Single_Process.C

     
    103103                  <<x<<","<<sqrt(lmuf2)<<") = "<<fb<<" ). Skip.\n";
    104104    return 0.0;
    105105  }
     106
     107  //change: skip if ratio condition not fullfilled
     108  if (dabs(fb)<1.0e-4*log(1.0 - x)/log(1.0 - 1.0e-2)){
     109    msg_Debugging() << "Invalid pdf ratio, ct set to zero." << std::endl;
     110    return 0.0;
     111  }
     112
    106113  msg_Debugging()<<"Beam "<<i<<": z = "<<z<<", f_{"<<fl
    107114                 <<"}("<<x<<","<<sqrt(lmuf2)<<") = "<<fb<<" {\n";
    108115  for (size_t j(0);j<jet.Size();++j) {
     
    265272                                           currentQ2, currentQ2, f1, f2,
    266273                                           0));
    267274
     275
    268276        // new scale (note: for the core scale we use Q2 instead of ampl->MuF2
    269277        // because we might be reweighting and Q2 could have been multiplied
    270278        // by a scaling factor, whereas ampl->MuF2 would not reflect this)
    271279        double lastQ2=currentQ2;
    272280        currentQ2 = (ampl->Next() == NULL) ? Q2 : ampl->KT2();
    273281
     282          // change: skip when a scale is below a (quark) mass threshold, new scale
     283          if (currentQ2 < sqr(2.0 * f1.Mass(true)) || currentQ2 < sqr(2.0 * f2.Mass(true))) {
     284              msg_Debugging()<<"Skip. Quarks below threshold: t="<<currentQ2
     285                            <<" vs. "<<sqr(2.0*f1.Mass(true))
     286                           <<" / "<<sqr(2.0*f2.Mass(true))<<std::endl;
     287              continue;
     288          }
     289
     290
     291
    274292        // numerators
    275293        double wn1(p_int->ISR()->PDFWeight(2,
    276294                                           -ampl->Leg(0)->Mom(),
     
    283301                                           currentQ2, currentQ2, f1, f2,
    284302                                           0));
    285303
    286         // add weights
    287         if (!IsZero(wn1) && !IsZero(wd1)) csi.AddWeight(wn1 / wd1);
    288         if (!IsZero(wn2) && !IsZero(wd2)) csi.AddWeight(wn2 / wd2);
     304          double x1=p_int->ISR()->CalcX(-ampl->Leg(0)->Mom());
     305          double x2=p_int->ISR()->CalcX(-ampl->Leg(1)->Mom());
    289306
     307          // change: added pdf ratio condition
     308          if (!IsZero(wn1) && !IsZero(wd1) && !(dabs(wd1)<1.0e-4*log(1.0 - x1)/log(1.0 - 1.0e-2)) ) {
     309              csi.AddWeight(wn1 / wd1);
     310              } else {
     311              msg_Debugging() << "invalid pdf ratio in beam 0," << std::endl;
     312              msg_Debugging() << "skip weight." << std::endl;
     313          }
     314
     315          if (!IsZero(wn2) && !IsZero(wd2) && !(dabs(wd2)<1.0e-4*log(1.0 - x2)/log(1.0 - 1.0e-2)) ) {
     316              csi.AddWeight(wn2 / wd2);
     317              } else {
     318              msg_Debugging() << "invalid pdf ratio in beam 1," << std::endl;
     319              msg_Debugging() << "skip weight." << std::endl;
     320          }
     321
    290322        // book-keep PDF ratios excl.
    291323        //   a) first one correcting outer PDF from muF to t
    292324        //   b) last numerator taken at muF (this one is to be varied)
     
    327359            rn[0] = ran->Get();
    328360            rn[1] = ran->Get();
    329361          }
     362              //change: ratio condition added below
    330363          for (int i(0); i < 2; ++i) {
    331             if (i == 0 && (IsZero(wn1) || IsZero(wd1))) continue;
    332             if (i == 1 && (IsZero(wn2) || IsZero(wd2))) continue;
     364                  if (i == 0 && (IsZero(wn1) || IsZero(wd1) || (dabs(wd1)<1.0e-4*log(1.0 - x1)/log(1.0 - 1.0e-2)) )) continue;
     365                  if (i == 1 && (IsZero(wn2) || IsZero(wd2) || (dabs(wd2)<1.0e-4*log(1.0 - x2)/log(1.0 - 1.0e-2)) )) continue;
    333366            Vec4D p(-ampl->Leg(i)->Mom());
    334367            const double x(p_int->ISR()->CalcX(p));
    335368            double z(-1.0);