Skip to content

Commit

Permalink
Merge pull request #995 from ajgilbert/fix-shapeN
Browse files Browse the repository at this point in the history
Fix bugs in shapeN + CMSHistFunc/Sum
  • Loading branch information
anigamova authored Jul 23, 2024
2 parents 1caeec0 + 4f45a14 commit 84c2bae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/CMSHistFunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ void CMSHistFunc::updateCache() const {
cache_.CopyValues(mcache_[idx].step2);
if (vtype_ == VerticalSetting::LogQuadLinear) {
cache_.Exp();
cache_.Scale(mcache_[idx].step1.Integral() / mcache_[idx].step2.Integral());
}
cache_.CropUnderflows();
if (enable_fast_vertical_) fast_vertical_ = true;
Expand Down
7 changes: 4 additions & 3 deletions src/CMSHistSum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ void CMSHistSum::updateMorphs() const {
compcache_[ip][ibin] *= extdata[ibin];
}
}
}
if (vtype_[ip] == CMSHistFunc::VerticalSetting::LogQuadLinear) {
compcache_[ip].Log();
if (vtype_[ip] == CMSHistFunc::VerticalSetting::LogQuadLinear) {
compcache_[ip].Log();
}
}
}
int n_morphs = vmorphpars_.size();
Expand Down Expand Up @@ -362,6 +362,7 @@ void CMSHistSum::updateCache() const {
staging_ = compcache_[i];
if (vtype_[i] == CMSHistFunc::VerticalSetting::LogQuadLinear) {
staging_.Exp();
staging_.Scale(storage_[process_fields_[i]].Integral() / staging_.Integral());
}
staging_.CropUnderflows();
vectorized::mul_add(valsum_.size(), coeffvals_[i], &(staging_[0]), &valsum_[0]);
Expand Down

0 comments on commit 84c2bae

Please sign in to comment.