Beispiel #1
0
double qqNLO::fxn(void)
{

  initialize();
  double xwgt=0.0;
  switch ( evt ) {
      case NLO :
             xwgtLO=wgtLO()*jacob0;
             xwgtV=wgtV()*jacob0;
             xwgtVplus=wgtVplus()*jacob;
             xwgtVa=wgtVa()*jacob;
             xwgtVb=wgtVb()*jacob;
             xwgtSa=wgtSa()*jacob;
             xwgtSb=wgtSb()*jacob;
             xwgtR=wgtR()*jacob;
             xwgtSf=wgtSf()*jacob;
             xwgtVf=wgtVf()*jacob;
             if (!cc->cut(k10,k20))   { xwgt+= xwgtLO+xwgtV+xwgtVplus; }
             if (!cc->cut(k1A,k2A))   { xwgt+= xwgtSa+xwgtVa; }
             if (!cc->cut(k1B,k2B))   { xwgt+= xwgtSb+xwgtVb; }
             if (!cc->cut(k11,k21,p1)) { xwgt+= xwgtR; }
             if (!cc->cut(k1f,k2f,pf)) { xwgt+= xwgtSf+xwgtVf; }

             break;
      case HARDNLO :
             xwgtSa=wgtSa()*jacob;
             xwgtSb=wgtSb()*jacob;
             xwgtR=wgtR()*jacob;
             xwgtSf=wgtSf()*jacob;
             if (!cc->cut(k1A,k2A))   { xwgt+= xwgtSa; }
             if (!cc->cut(k1B,k2B))   { xwgt+= xwgtSb; }
             if (!cc->cut(k11,k21,p1)) { xwgt+= xwgtR; }
             if (!cc->cut(k1f,k2f,pf)) { xwgt+= xwgtSf; }
             break;
      case LO :
             xwgtLO=wgtLO()*jacob0;
             if (!cc->cut(k10,k20))   { xwgt+= xwgtLO; }
             break;
      case EASYNLO :
             xwgtLO=wgtLO()*jacob0;
             xwgtV=wgtV()*jacob0;
             xwgtVplus=wgtVplus()*jacob;
             xwgtVa=wgtVa()*jacob;
             xwgtVb=wgtVb()*jacob;
             xwgtVf=wgtVf()*jacob;
             if (!cc->cut(k10,k20))   { xwgt+= xwgtLO+xwgtV+xwgtVplus; }
             if (!cc->cut(k1A,k2A))   { xwgt+= xwgtVa; }
             if (!cc->cut(k1B,k2B))   { xwgt+= xwgtVb; }
             if (!cc->cut(k1f,k2f,pf)) { xwgt+= xwgtVf; }
             break;
  };
  return wgtnorm()*xwgt;    
}
  void createBasicVector(
    std::vector<const scalar_t *> &entries,  std::vector<int> &entryStride,
    std::vector<const scalar_t *> &weights, std::vector<int> &weightStrides)
  {
    typedef StridedData<lno_t,scalar_t> input_t;

    if (numIds_){
      int stride = 1;
      entries_ = arcp(new input_t[numEntriesPerID_], 0, numEntriesPerID_, true);
      for (int v=0; v < numEntriesPerID_; v++) {
        if (entryStride.size()) stride = entryStride[v];
        ArrayRCP<const scalar_t> eltV(entries[v], 0, stride*numIds_, false);
        entries_[v] = input_t(eltV, stride);
      }
    }

    if (numWeights_) {
      int stride = 1;
      weights_ = arcp(new input_t [numWeights_], 0, numWeights_, true);
      for (int w=0; w < numWeights_; w++){
        if (weightStrides.size()) stride = weightStrides[w];
        ArrayRCP<const scalar_t> wgtV(weights[w], 0, stride*numIds_, false);
        weights_[w] = input_t(wgtV, stride);
      }
    }
  }
  BasicIdentifierAdapter<User>::BasicIdentifierAdapter(
    lno_t numIds, const gno_t *idPtr,
    std::vector<const scalar_t *> &weights, std::vector<int> &weightStrides):
      numIds_(numIds), idList_(idPtr), weights_()
{
  typedef StridedData<lno_t,scalar_t> input_t;
  size_t numWeights = weights.size();

  if (numWeights > 0){
    weights_ = arcp(new input_t [numWeights], 0, numWeights, true);

    if (numIds > 0){
      for (size_t i=0; i < numWeights; i++){
        int stride = weightStrides.size() ? weightStrides[i] : 1;
        ArrayRCP<const scalar_t> wgtV(weights[i], 0, stride*numIds, false);
        weights_[i] = input_t(wgtV, stride);
      }
    }
  }
}