Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions scripts/analysisTools/plotUtils/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ def drawCorrelationPlot(
invertPalette=False,
canvasSize="700,625",
passCanvas=None,
topMargin=0.1,
bottomMargin=0.1,
plotError=False,
plotRelativeError=False,
Expand Down Expand Up @@ -1074,6 +1075,7 @@ def drawCorrelationPlot(
canvas.SetTicky(1)
canvas.SetLeftMargin(leftMargin)
canvas.SetRightMargin(rightMargin)
canvas.SetTopMargin(topMargin)
canvas.SetBottomMargin(bottomMargin)
canvas.cd()

Expand Down
14 changes: 12 additions & 2 deletions scripts/plotting/makeDataMCStackPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
parser.add_argument(
"--fakeTransferCorrFileName",
type=str,
default="fakeTransferTemplates",
default="fakeTransferTemplates_smoothTF",
help="""
Name of pkl.lz4 file (without extension) with pTmu correction for the shape of data-driven fakes.
Currently used only when utAngleSign is a fakerate axis (detected automatically), since the shape
Expand Down Expand Up @@ -224,6 +224,12 @@
default=[],
help="Horizontal axis edges where to plot vertical lines",
)
parser.add_argument(
"--customXlabel",
type=str,
help="Set this label for the x axis (Latex format supported), otherwise it is inferred from the plotted axis.",
default=None,
)

subparsers = parser.add_subparsers(dest="variation")
variation = subparsers.add_parser(
Expand Down Expand Up @@ -605,6 +611,9 @@ def collapseSyst(h):
if groups.flavor in ["e", "ee"]:
xlabel = xlabel.replace(r"\mu", "e")

if args.customXlabel is not None:
xlabel = r"{args.customXlabel}"

fig = plot_tools.makeStackPlotWithRatio(
histInfo,
prednames,
Expand Down Expand Up @@ -646,8 +655,9 @@ def collapseSyst(h):
width_scale=(
args.customFigureWidth
if args.customFigureWidth
else 1.25 if len(h.split("-")) == 1 else 1
else 1.25 if len(h.split("-")) > 1 else 1
),
automatic_scale=args.customFigureWidth is None,
legPos=args.legPos,
leg_padding=args.legPadding,
lowerLeg=not args.noLowerLeg,
Expand Down
2 changes: 1 addition & 1 deletion scripts/rabbit/setupRabbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ def setup(
),
fakeTransferCorrFileName=args.fakeTransferCorrFileName,
histAxesRemovedBeforeFakes=(
[str(x[0]) for x in args.presel] if args.presel else []
[str(x[0].split(":")[0]) for x in args.presel] if args.presel else []
),
)
datagroups.set_histselectors(
Expand Down
Loading