53 fMaxIter( maxIterations ),
54 fAbsTol ( absTolerance ),
75 Double_t fb = fMethod->GetValueForRoot(
b ) - refValue;
77 Log() << kWARNING <<
"<Root> initial interval w/o root: "
78 <<
"(a=" <<
a <<
", b=" <<
b <<
"),"
79 <<
" (Eff_a=" << fMethod->GetValueForRoot(
a )
80 <<
", Eff_b=" << fMethod->GetValueForRoot(
b ) <<
"), "
81 <<
"(fa=" << fa <<
", fb=" << fb <<
"), "
82 <<
"refValue = " << refValue <<
Endl;
89 for (
Int_t iter= 0; iter <= fMaxIter; iter++) {
90 if ((fb < 0 &&
fc < 0) || (fb > 0 &&
fc > 0)) {
101 fa = fb; fb =
fc;
fc = fa;
115 if (ac_equal) { p = 2 *
m * s;
q = 1 - s; }
118 p = s * (2 *
m *
q * (
q -
r) - (
b -
a) * (
r - 1));
119 q = (
q - 1) * (
r - 1) * (s - 1);
127 if (2 * p < (min1 < min2 ? min1 : min2)) {
131 else {
d =
m;
e =
m; }
137 else b += (
m > 0 ? +tol : -tol);
139 fb = fMethod->GetValueForRoot(
b ) - refValue;
144 Log() << kWARNING <<
"<Root> maximum iterations (" << fMaxIter
145 <<
") reached before convergence" <<
Endl;
static struct mg_connection * fc(struct mg_context *ctx)
Virtual base Class for all MVA method.
virtual Double_t GetValueForRoot(Double_t)
returns efficiency as function of cut
ostringstream derivative to redirect and format output
Root finding using Brents algorithm (translated from CERNLIB function RZERO)
virtual ~RootFinder(void)
destructor
Double_t Root(Double_t refValue)
Root finding using Brents algorithm; taken from CERNLIB function RZERO.
RootFinder(MethodBase *method, Double_t rootMin, Double_t rootMax, Int_t maxIterations=100, Double_t absTolerance=0.0)
constructor
MsgLogger & Endl(MsgLogger &ml)