Skip to content

Commit 1be2c72

Browse files
committed
Don't use facade functions in MnMigrad to modify parameter state
These functions will go away and the parameter state object should be modified directly.
1 parent 1a09f40 commit 1be2c72

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

RecoVertex/BeamSpotProducer/src/PVFitter.cc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,16 @@ bool PVFitter::runFitter() {
404404
upar.Add("ez", 1., 0.1, 0., 30.); // 8
405405
upar.Add("scale", errorScale_, errorScale_ / 10., errorScale_ / 2., errorScale_ * 2.); // 9
406406
MnMigrad migrad(fcn, upar);
407+
// const_cast to be compatible with ROOT before 6.38
408+
auto& state = const_cast<MnUserParameterState&>(migrad.State());
409+
407410
//
408411
// first iteration without correlations
409412
//
410-
migrad.Fix(4);
411-
migrad.Fix(6);
412-
migrad.Fix(7);
413-
migrad.Fix(9);
413+
state.Fix(4);
414+
state.Fix(6);
415+
state.Fix(7);
416+
state.Fix(9);
414417
FunctionMinimum ierr = migrad(0, 1.);
415418
if (!ierr.IsValid()) {
416419
edm::LogWarning("PVFitter") << "3D beam spot fit failed in 1st iteration" << std::endl;
@@ -439,9 +442,9 @@ bool PVFitter::runFitter() {
439442
//
440443
// refit with correlations
441444
//
442-
migrad.Release(4);
443-
migrad.Release(6);
444-
migrad.Release(7);
445+
state.Release(4);
446+
state.Release(6);
447+
state.Release(7);
445448
ierr = migrad(0, 1.);
446449
if (!ierr.IsValid()) {
447450
edm::LogWarning("PVFitter") << "3D beam spot fit failed in 3rd iteration" << std::endl;

0 commit comments

Comments
 (0)