Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spellcheck printouts remaining files in python directory #907

Merged
merged 2 commits into from
Feb 22, 2024
Merged
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
18 changes: 9 additions & 9 deletions python/QuasiDegenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ def setPhysicsOptions(self, physOptions):
for po in physOptions:
if po.startswith("higgsMassRange="):
self.mHRange = po.replace("higgsMassRange=", "").split(",")
print("The Higgs mass range:", self.mHRange)
print("Chosen Higgs boson mass range:", self.mHRange)
if len(self.mHRange) != 2:
raise RuntimeError("Higgs mass range definition requires two extrema")
elif float(self.mHRange[0]) >= float(self.mHRange[1]):
raise RuntimeError("Extrema for Higgs mass range defined with inverterd order. Second must be larger the first")
raise RuntimeError("Extrema for Higgs mass range defined with inverterd order. Second must be larger than the first")
if po.startswith("DMHRange="):
self.DMHRange = po.replace("DMHRange=", "").split(",")
print("The Higgs mass range:", self.DMHRange)
print("Chosen Higgs boson mass range:", self.DMHRange)
if len(self.DMHRange) != 2:
raise RuntimeError("DMH range definition requires two extrema")
elif float(self.DMHRange[0]) >= float(self.DMHRange[1]):
raise RuntimeError("Extrema for DMH range defined with inverterd order. Second must be larger the first")
raise RuntimeError("Extrema for DMH range defined with inverterd order. Second must be larger than the first")

if po == "muAsPOI":
print("Will consider the signal strength as a parameter of interest")
Expand All @@ -52,9 +52,9 @@ def setPhysicsOptions(self, physOptions):
self.floatMu = False
self.muAsPOI = False
self.mu = po.replace("fixMu=", "")
print("will set mu to be %s" % self.mu)
print("wWll set the signal strength (mu) to be %s" % self.mu)
if po == "mHAsPOI":
print("Will consider the mass 1 as a parameter of interest")
print("Will consider the Higgs boson mass as a parameter of interest")
self.mHAsPOI = True
self.floatMH = True
if po.startswith("fixMH="):
Expand All @@ -64,7 +64,7 @@ def setPhysicsOptions(self, physOptions):
print("will set mH to be %s" % self.mH)

if po == "DMHAsPOI":
print("Will consider the DMH as a parameter of interest")
print("Will consider the DMH as a parameter of interest")
self.DMHAsPOI = True
self.floatDMH = True
if po.startswith("fixDMH="):
Expand All @@ -74,14 +74,14 @@ def setPhysicsOptions(self, physOptions):
print("will set DMH to be %s" % self.DMH)

if po == "fracAsPOI":
print("Will consider the frac as a parameter of interest")
print("Will consider the fraction as a parameter of interest")
self.fracAsPOI = True
self.floatFrac = True
if po.startswith("fixFrac="):
self.floatFrac = False
self.fracAsPOI = False
self.frac = po.replace("fixFrac=", "")
print("will set frac to be %s" % self.frac)
print("Will set frac to be %s" % self.frac)

def doParametersOfInterest(self):
poi = ""
Expand Down
2 changes: 1 addition & 1 deletion python/RooAddPdfFixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


def FixAll(workspace):
raise RuntimeError("Since CMSSW_11_2_X, this utility is unnecessary. It will be removed in future releases")
raise RuntimeError("Since CMSSW_11_2_X, this utility is unnecessary. It will be removed in a future release.")
4 changes: 2 additions & 2 deletions python/STXSModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ def setPhysicsOptions(self, physOptions):
if po.startswith("higgsMassRange="):
self.floatMass = True
self.mHRange = po.replace("higgsMassRange=", "").split(",")
print("The Higgs mass range:", self.mHRange)
print("The Higgs boson mass range:", self.mHRange)
if len(self.mHRange) != 2:
raise RuntimeError("Higgs mass range definition requires two extrema")
elif float(self.mHRange[0]) >= float(self.mHRange[1]):
raise RuntimeError("Extrama for Higgs mass range defined with inverterd order. Second must be larger the first")
raise RuntimeError("Extrama for Higgs mass range defined with inverterd order. Second must be larger than the first")

def doMH(self):
if self.floatMass:
Expand Down
2 changes: 1 addition & 1 deletion python/STXStoEFTModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def setPhysicsOptionsBase(self, physOptions):
if len(self.mHRange) != 2:
raise RuntimeError("Higgs mass range definition requires two extrema")
elif float(self.mHRange[0]) >= float(self.mHRange[1]):
raise RuntimeError("Extrema for Higgs mass range defined with inverterd order. Second must be larger the first")
raise RuntimeError("Extrema for Higgs mass range defined with inverterd order. Second must be larger than the first")
if po.startswith("BRU="):
self.doBRU = po.replace("BRU=", "") in [
"yes",
Expand Down
6 changes: 3 additions & 3 deletions python/STXStoSMEFTModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def getProcessInfo(bin, process):
foundSTXSBin = foundSTXSBin.split("_")[0]

if not matchedDecayString:
raise RuntimeError("Validation Error: no supported decay found in process")
raise RuntimeError("Validation error: no supported decay found in process")

return (foundRecoCategory, foundSTXSBin, foundDecay, foundEnergy)

Expand Down Expand Up @@ -126,7 +126,7 @@ def setPhysicsOptionsBase(self, physOptions):
if len(self.mHRange) != 2:
raise RuntimeError("Higgs mass range definition requires two extrema")
elif float(self.mHRange[0]) >= float(self.mHRange[1]):
raise RuntimeError("Extrema for Higgs mass range defined with inverterd order. Second must be larger the first")
raise RuntimeError("Extrema for Higgs mass range defined with inverterd order. Second must be larger than the first")
if po.startswith("fixProcesses="):
self.fixProcesses = (po.replace("fixProcesses=", "")).split(",")
if po.startswith("stage0="):
Expand All @@ -145,7 +145,7 @@ def setPhysicsOptionsBase(self, physOptions):
self.expand_equations = po.replace("expand_equations=", "") in ["yes", "1", "Yes", "True", "true"]

# Output options to screen
print(" --> [STXStoSMEFT] Using (%s) parametrisation" % self.parametrisation)
print(" --> [STXStoSMEFT] Using (%s) parametrization" % self.parametrisation)
if len(self.fixProcesses) > 0:
print(" --> [STXStoSMEFT] Fixing following processes to SM: %s" % self.fixProcesses)

Expand Down
26 changes: 14 additions & 12 deletions python/ShapeTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ShapeBuilder(ModelBuilder):
def __init__(self, datacard, options):
ModelBuilder.__init__(self, datacard, options)
if not datacard.hasShapes:
raise RuntimeError("You're using a ShapeBuilder for a model that has no shapes")
raise RuntimeError("You are using a ShapeBuilder for a model that has no shapes.")
if options.libs:
for lib in options.libs:
ROOT.gSystem.Load(lib)
Expand All @@ -82,7 +82,7 @@ def __init__(self, datacard, options):
## ------------------------------------------
def doObservables(self):
if self.options.verbose > 2:
stderr.write("Using shapes: qui si parra' la tua nobilitate\n")
stderr.write("Using shapes. \n")
self.prepareAllShapes()
if len(self.DC.bins) > 1 or not self.options.forceNonSimPdf:
## start with just a few channels
Expand Down Expand Up @@ -538,7 +538,7 @@ def prepareAllShapes(self):
elif shape.InheritsFrom("CMSHistFunc"):
shapeTypes.append("CMSHistFunc")
else:
raise RuntimeError("Currently supporting only TH1s, RooDataHist and RooAbsPdfs")
raise RuntimeError("This method currently supports only TH1s, RooDataHists and RooAbsPdfs")
if norm != 0:
if p == self.options.dataname:
if len(self.DC.obs):
Expand All @@ -559,7 +559,7 @@ def prepareAllShapes(self):
if len(databins) > 0:
for i in six.iterkeys(databins):
if i not in bgbins:
stderr.write("Channel %s has bin %d fill in data but empty in all backgrounds\n" % (b, i))
stderr.write("Channel %s has bin %d filled in data but empty in all backgrounds\n" % (b, i))
if shapeTypes.count("TH1"):
self.TH1Observables = {}
self.out.binVars = ROOT.RooArgSet()
Expand Down Expand Up @@ -700,7 +700,7 @@ def getShape(self, channel, process, syst="", _cache={}, allowNoSyst=False):
if len(names) == 2:
if allowNoSyst:
return None
raise RuntimeError("Can't find systematic " + syst + " for process '%s', channel '%s'" % (process, channel))
raise RuntimeError("Cannot find systematic " + syst + " for process '%s', channel '%s'" % (process, channel))
names = [names[0], names[2]]
else:
names = [names[0], names[1]]
Expand Down Expand Up @@ -736,7 +736,9 @@ def getShape(self, channel, process, syst="", _cache={}, allowNoSyst=False):
if not ret:
if allowNoSyst:
return None
raise RuntimeError("Object %s in workspace %s in file %s does not exist or it's neither a data nor a pdf" % (oname, wname, finalNames[0]))
raise RuntimeError(
"Object %s in workspace %s in file %s does not exist, or it is neither a dataset nor a pdf" % (oname, wname, finalNames[0])
)
# Fix the fact that more than one entry can refer to the same object
ret = ret.Clone("shape%s_%s_%s%s" % (postFix, process, channel, "_" + syst if syst else ""))
if self.options.removeMultiPdf and ret.InheritsFrom("RooMultiPdf"):
Expand Down Expand Up @@ -940,7 +942,7 @@ def getPdf(self, channel, process, _cache={}):
if shapeAlgo == "shape":
shapeAlgo = self.options.defMorph
if "shapeL" in shapeAlgo:
raise RuntimeError("No algorithm shapeL - this mode is depricated")
raise RuntimeError("No algorithm shapeL - this mode is deprecated")
# qrange = 0;
elif "shapeN" in shapeAlgo:
qalgo = -1
Expand Down Expand Up @@ -1052,9 +1054,9 @@ def getPdf(self, channel, process, _cache={}):

if "2a" in shapeAlgo: # old shape2
if not nominalPdf.InheritsFrom("RooHistPdf"):
raise RuntimeError("Algorithms 'shape2', 'shapeN2' only work with histogram templates")
raise RuntimeError("Algorithms 'shape2' and 'shapeN2' only work with histogram templates")
if nominalPdf.dataHist().get().getSize() != 1:
raise RuntimeError("Algorithms 'shape2', 'shapeN2' only work in one dimension")
raise RuntimeError("Algorithms 'shape2' and 'shapeN2' only work in one dimension")
xvar = nominalPdf.dataHist().get().first()
_cache[(channel, process)] = ROOT.VerticalInterpHistPdf(
"shape%s_%s_%s_morph" % (postFix, channel, process),
Expand All @@ -1067,9 +1069,9 @@ def getPdf(self, channel, process, _cache={}):
)
elif "2" in shapeAlgo: # new faster shape2
if not nominalPdf.InheritsFrom("RooHistPdf"):
raise RuntimeError("Algorithms 'shape2', 'shapeN2' only work with histogram templates")
raise RuntimeError("Algorithms 'shape2' and 'shapeN2' only work with histogram templates")
if nominalPdf.dataHist().get().getSize() != 1:
raise RuntimeError("Algorithms 'shape2', 'shapeN2' only work in one dimension")
raise RuntimeError("Algorithms 'shape2' and 'shapeN2' only work in one dimension")
xvar = nominalPdf.dataHist().get().first()
_cache[(channel, process)] = ROOT.FastVerticalInterpHistPdf(
"shape%s_%s_%s_morph" % (postFix, channel, process),
Expand Down Expand Up @@ -1324,7 +1326,7 @@ def checkRooAddPdf(self, channel, process, pdf):
sum += coeflist.at(i).getVal()
if abs(sum - 1.0) > 1e-4:
raise RuntimeError(
"Error in channel %s, process %s: RooAddPdf %s has coefficients that sum up to %g, and not to unity. This is not supported (but it could be supported on request).\n"
"Error in channel %s, process %s: RooAddPdf %s has coefficients that sum up to %g, and not to unity. This is not supported.\n"
% (channel, process, pdf.GetName(), sum)
)

Expand Down
4 changes: 2 additions & 2 deletions python/SingleTopModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

class KappaVKappaT(LHCHCGBaseModel):
"""
Copy of Kappas model with a combined kappa_V (for kappa_W and kappa_Z),
Copy of Kappa model with a combined kappa_V (for kappa_W and kappa_Z),
and where hcc is independent of kappa_t.

For tHq multilepton analysis (HIG-17-005)

NOTE - Do not use this model for a generic analysis,
instead use the LHCHCGModels:K3 or K7 models and freeze POIs accordingly
instead use the LHCHCGModels:K3 or K7 models and freeze POIs accordingly
"""

def __init__(self, resolved=True, BRU=True, addInvisible=False, coupleTopTau=False):
Expand Down
4 changes: 2 additions & 2 deletions python/SpinZeroStructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def processPhysicsOptions(self, physOptions):
raise ValueError("Specified both muFixed and muAsPOI!")

if not self.muAsPOI and not self.fai1POI and not self.fai2POI and not self.phiai1POI and not self.phiai2POI:
print("No POIs detected: Switching to default configuration: Floating nuisance mu, floating POI fai1, eveything else fixed")
print("No POIs detected, switching to default configuration: Floating nuisance mu, floating POI fai1, eveything else fixed")
self.muFloating = True
self.muAsPOI = False
self.fai1Floating = True
Expand Down Expand Up @@ -335,7 +335,7 @@ def processPhysicsOptions(self, physOptions):
raise ValueError("can't specify both uservoverrf and scalemuvmuftogether")

if self.sqrts is None:
raise ValueError("PhysicsOption sqrts=?? is mandatory. example: sqrts=7,8,13")
raise ValueError("PhysicsOption sqrts=?? is mandatory. Example: sqrts=7,8,13")

if self.scaledifferentsqrtsseparately and self.scalemuvfseparately:
if self.uservoverrf:
Expand Down
2 changes: 1 addition & 1 deletion python/TagAndProbeModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def doParametersOfInterest(self):
self.modelBuilder.factory_('expr::fail_scale("(%f+%f-(%f*@0))/%f", SF)' % (exp_pass, exp_fail, exp_pass, exp_fail))

def getYieldScale(self, bin, process):
"Return the name of a RooAbsReal to scale this yield by or the two special values 1 and 0 (don't scale, and set to zero)"
"Return the name of a RooAbsReal to scale this yield by, or the two special values 1 and 0 (do not scale, and set to zero)"
if self.DC.isSignal[process]:
if re.search("pass", bin):
return "SF"
Expand Down
4 changes: 2 additions & 2 deletions python/TrilinearCouplingModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


class TrilinearHiggsKappaVKappaF(LHCHCGBaseModel):
"assume the SM coupling but let the Higgs mass to float"
"Assume the SM coupling but leave the Higgs boson mass floating."

def __init__(self, BRU=True):
LHCHCGBaseModel.__init__(self)
Expand Down Expand Up @@ -396,7 +396,7 @@ def getHiggsSignalYieldScale(self, production, decay, energy):


class TrilinearHiggsKappaVKappaFSTXS12(LHCHCGBaseModel):
"assume the SM coupling but let the Higgs mass to float"
"Assume the SM coupling but leave the Higgs boson mass floating"

def __init__(self, BRU=False):
LHCHCGBaseModel.__init__(self)
Expand Down
Loading
Loading