8 #include "Utilities/func/MathUtil.h" 15 const std::vector<const IFitVar*>&
vars,
21 Result(
double c,
const Seed&
p) : chisq(c),
pt(p) {}
23 bool operator<(
const Result&
r)
const {
return chisq < r.chisq;}
27 auto a =
pt.GetVals();
52 std::map<const IFitVar*, double> valmap;
53 for(
const IFitVar*
v: vars) valmap[
v] =
v->GetValue(calc);
54 results.emplace_back(chi, valmap);
58 std::sort(results.begin(), results.end());
60 const double bestChisq = results[0].chisq;
64 std::vector<Seed>
ret;
65 for(
const Result&
result: results){
67 if(dchisq_max > 0 &&
result.chisq > bestChisq + dchisq_max)
break;
70 for(
const Seed& already: ret){
74 if(
result.Distance(already) < 1
e-3){
79 if(ok) ret.push_back(
result.pt);
virtual _IOscCalcAdjustable< T > * Copy() const =0
Cuts and Vars for the 2020 FD DiF Study.
const std::vector< Seed > & GetSeeds() const
double Distance(double x1, double y1, double x2, double y2)
const std::map< const IFitVar *, double > GetVals() const
T sqr(T x)
More efficient square function than pow(x,2)
virtual std::unique_ptr< IFitSummary > Fit(osc::IOscCalcAdjustable *seed, SystShifts &bestSysts=junkShifts, const SeedList &seedPts=SeedList(), const std::vector< SystShifts > &systSeedPts={}, Verbosity verb=kVerbose) const
Master fitting method. Depends on FitHelper and FitHelperSeeded.
bool operator<(StanConfig::Verbosity a, StanConfig::Verbosity b)
Allow for comparing them, since kQuiet is definitely "less" verbose than kVerbose.
Base class defining interface for experiments.
Interface definition for fittable variables.
SeedList RefineSeeds(const SeedList &seeds, const IExperiment *expt, const std::vector< const IFitVar * > &vars, const osc::IOscCalcAdjustable *calc0, double dchisq_max)
Refine an initial list of seeds by exploring stats-only fits.
Perform MINUIT fits in one or two dimensions.