コード例 #1
0
  double mctt_332_Sq(const LorentzTransverseVector& a,  // 3 d.o.f. 
		     const LorentzTransverseVector& b,  // 3 d.o.f.
                     const TwoVector& utm) {

    const ResolvedLTV aResolved(a,utm);
    const ResolvedLTV bResolved(b,utm);

    return a.masssq() + b.masssq() + 2.0*(aResolved.perp()).contralinearDot(bResolved.perp());
  } 
コード例 #2
0
  double ChengHanBisect_Mt2_332_Calculator::mt2_332(const LorentzTransverseVector& visA, 
							       const LorentzTransverseVector& visB,
					      const TwoVector& ptmiss, 
					      const double mEachInvisible) {


    double pa[3] = { visA.mass(), visA.px(), visA.py() };
    double pb[3] = { visB.mass(), visB.px(), visB.py() };
    double pmiss[3] = { 0, ptmiss.px(), ptmiss.py() };
    double mn = mEachInvisible;

    mt2_bisect::mt2 mt2_event;

    mt2_event.set_momenta(pa,pb,pmiss);
    mt2_event.set_mn(mn);

    return mt2_event.get_mt2();
  }
コード例 #3
0
  double Basic_MCT2_332_Calculator::mct2_332_Sq(const LorentzTransverseVector& visA,
					       const LorentzTransverseVector& visB,
					       const TwoVector& ptmiss,
					       const double mEachInvisible){


    mCT2Fcn theFCN(ptmiss.px(),
	 	   ptmiss.py(),
		   mEachInvisible,
		   visA.px(),
		   visA.py(),
		   visA.mass(),
		   visB.px(),
		   visB.py(),
		   visB.mass());

    const double massScale = (
			      ptmiss.pt() +
			      mEachInvisible +
			      visA.pt()  +
			      visA.mass() +
			      visB.pt() +
			      visB.mass()
			      )/6.0;
    // DANG! Try to get rid of Minuit output:
    //std::ofstream    DANG_log("/dev/null");
    //std::streambuf * DANG_save = std::cerr.rdbuf();
    //if (DANG_log.is_open()) {
    //  std::cerr.rdbuf(DANG_log.rdbuf());
    // }

    double guessx = 0.5*(ptmiss.px());
    double guessy = 0.5*(ptmiss.py());
    
    MnUserParameters upar;
    upar.Add("etx", guessx, 0.02*massScale); 
    upar.Add("ety", guessy, 0.02*massScale);
    const int highQuality=2;    

    // Usually migrad produces the best minumum.
    // But when the minimum is in a fold, migrad can fail badly.
    // On the fold, simplex does well.  We therefore do both separately
    // and record the answer of the one that did best.
    
    // Further to the above notes, it now seems that by choosing the massScale sensibly, and by making the "tolerance" (the second argument to the call that extracts the FunctionMinimum below) much smaller, the simplex algorithm seems to work so well that we don't need the migrad algorithm.  This is good news, as the migrad algorithm produces lots of error output that we can't get rid of.

    MnSimplex simplex(theFCN, upar, highQuality);
    FunctionMinimum minS = simplex(0,massScale*0.000001);
    //const double etxAtMin = minS.UserState().Value("etx");
    //const double etyAtMin = minS.UserState().Value("ety");
    //MnMigrad migrad(theFCN, upar, highQuality);
    //FunctionMinimum minM = migrad(0,massScale*0.000001);
    //const double best = fmin(minS.Fval(), minM.Fval());
    const double best = minS.Fval();

    // DANG! Undoing our attempt to get rid of Minuit output:
    //if (DANG_log.is_open()) {
    //  std::cerr.rdbuf(DANG_save);
    //}

    return best;    
  }