120 {
121
122
123
124
125
128
129
130
131
134
135 double f1 = func1Integ->
evaluate(integLower,integUpper) - theFunc2->
getCoeff(1,2)*func2Integ->
evaluate(integLower,integUpper);
138 double f2 = func1Integ->
evaluate(integLower,integUpper) - theFunc2->
getCoeff(1,2)*func2Integ->
evaluate(integLower,integUpper);
139
140 double xLower = 0.0, xUpper = 0.0;
142
144 report(
WARNING,
"EvtGen") <<
"EvtBtoXsgammaRootFinder: No root in specified range !"<<endl;
145 return false;
146 }
147
148
149 if (fabs(
f1) < precision) {
152 }
153 if (fabs(f2) < precision) {
156 }
157
158
160 xLower = lowerValue;
161 xUpper = upperValue;
162 } else {
163 xLower = upperValue;
164 xUpper = lowerValue;
165 }
166
167 double rootGuess = 0.5*(lowerValue + upperValue);
168 double dxold = fabs(upperValue - lowerValue);
169 double dx = dxold;
170
173 double f = func1Integ->
evaluate(integLower,integUpper) - theFunc2->
getCoeff(1,2)*func2Integ->
evaluate(integLower,integUpper);
174
176
177 dxold = dx;
178 dx = 0.5*(xUpper-xLower);
179 rootGuess = xLower+dx;
180
181
182 if (fabs(xLower - rootGuess) < precision) {
185 }
186
190
192 xLower = rootGuess;
193 } else {
194 xUpper = rootGuess;
195 }
196
197 }
198
199 report(
WARNING,
"EvtGen") <<
"EvtBtoXsgammaRootFinder: Maximum number of iterations "
200 <<"in EvtBtoXsgammaRootFinder::foundRoot exceeded!"
201 <<" Returning false."<<endl;
202 return 0;
203
204}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
ostream & report(Severity severity, const char *facility)
#define EVTITGROOTFINDER_MAXIT
virtual double getCoeff(int, int)=0
virtual void setCoeff(int, int, double)=0
double evaluate(double lower, double upper) const