Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RF] Fixup to parameter index calculation in ParamHistFunc #10989

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions roofit/histfactory/src/ParamHistFunc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,13 @@ RooAbsReal& ParamHistFunc::getParameter( Int_t index ) const {
_numBinsPerDim = getNumBinsPerDim(_dataVars);
}

int i = index / n.yz ;
int j = (index % n.y) / n.z;
int k = index % (n.yz);
// Unravel the index to 3D coordinates. We can't use the index directly,
// because in the parameter set the dimensions are ordered in reverse order
// compared to the RooDataHist (for historical reasons).
const int i = index / n.yz;
const int tmp = index % n.yz;
const int j = tmp / n.z;
const int k = tmp % n.z;

return static_cast<RooAbsReal&>(_paramSet[i + j * n.x + k * n.xy]);
}
Expand Down