From c10c5c7a676f57d06a68a9cca4f888f4fd5da2c6 Mon Sep 17 00:00:00 2001 From: Tommaso Tedeschi Date: Tue, 25 Jun 2024 10:43:10 +0200 Subject: [PATCH] Update cmsstyle.py (#46) --- src/cmsstyle/cmsstyle.py | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/cmsstyle/cmsstyle.py b/src/cmsstyle/cmsstyle.py index 38c694a..7e0e331 100644 --- a/src/cmsstyle/cmsstyle.py +++ b/src/cmsstyle/cmsstyle.py @@ -43,6 +43,16 @@ def SetLumi(lumi, unit="fb", round_lumi=False): cmsText = "CMS" extraText = "Preliminary" +def SetCmsText(text): + """ + Function that allows to edit the default + "CMS" string + + Args: + text (str): The CMS text. + """ + global cmsText + cmsText = text def SetExtraText(text): """ @@ -62,6 +72,28 @@ def SetExtraText(text): additionalInfoFont = 42 additionalInfo = [] # For extra info +def SetCmsTextFont(font): + """ + Function that allows to edit th default font of the + "CMS" string + + Args: + font (int): The CMS text font code. + """ + global cmsTextFont + cmsTextFont = font + +def SetExtraTextFont(font): + """ + Function that allows to edit the default font + of extra text string (printed after "CMS" by default) + + Args: + font (int): The extra text font code. + """ + global extraTextFont + extraTextFont = font + def ResetAdditionalInfo(): """ Reset the additional information to be displayed. @@ -85,6 +117,17 @@ def AppendAdditionalInfo(text): cmsTextSize = 0.75 cmsTextOffset = 0.1 +def SetCmsTextSize(size): + """ + Function that allows to edit th default fontsize of the + "CMS" string + + Args: + size (int): The CMS text font size. + """ + global cmsTextSize + cmsTextSize = size + # ratio of 'CMS' and extra text size extraOverCmsTextSize = 0.76