Skip to content

Commit

Permalink
Make left label read COM energy (#510)
Browse files Browse the repository at this point in the history
Previously, only right-side experimental labels actually
read the COM energy. This commit makes the left-side labels
do the same. The default remains at 13 TeV if no COM energy
is supplied.
  • Loading branch information
Benkendorfer authored Aug 7, 2024
1 parent 09c27ce commit a3d7956
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mplhep/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,18 @@ def exp_label(
units="inches",
fig=ax.figure,
)

if com is not None:
_com_label = r"\mathrm{" + str(com) + r"\ TeV}"
else:
_com_label = r"\mathrm{13\ TeV}"

if lumi is not None:
_lumi = (
r"$\sqrt{s} = \mathrm{13\ TeV}, " + str(lumi) + r"\ \mathrm{fb}^{-1}$"
r"$\sqrt{s} = " + _com_label + ", " + str(lumi) + r"\ \mathrm{fb}^{-1}$"
)
else:
_lumi = r"$\sqrt{s} = \mathrm{13\ TeV}$"
_lumi = r"$\sqrt{s} = " + _com_label + "$"
explumi = ExpSuffix(
*exptext.get_position(),
text=rlabel if rlabel is not None else _lumi,
Expand Down

0 comments on commit a3d7956

Please sign in to comment.