Skip to content

Commit

Permalink
Update cmsstyle.py (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttedeschi authored Jun 25, 2024
1 parent 1d5c512 commit c10c5c7
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/cmsstyle/cmsstyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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.
Expand All @@ -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

Expand Down

0 comments on commit c10c5c7

Please sign in to comment.