Skip to content

Commit

Permalink
Better handling of scaling and normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
fcatalan92 authored and fgrosa committed Feb 1, 2021
1 parent 41fddf6 commit 14c4f3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion comparisons/CompareGraphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@
if 'TH' in objType:
hToCompare[iFile].SetDirectory(0)
hToCompare[iFile].SetStats(0)
hToCompare[iFile].Scale(scale)
if normalize:
if scale != 1.:
print('WARNING: you are both scaling and normalizing the histogram, check if it makes sense!')
hToCompare[iFile].Scale(1. / hToCompare[iFile].Integral())
hToCompare[iFile].Scale(scale)
else:
ScaleGraph(hToCompare[iFile], scale)
if doRatio:
Expand Down

0 comments on commit 14c4f3c

Please sign in to comment.