From 115a9c4e3808d25daad8e1e0256d7d23a683df3d Mon Sep 17 00:00:00 2001 From: Adinda de Wit Date: Wed, 21 Feb 2024 17:17:17 +0100 Subject: [PATCH 1/2] Spellcheck printouts remaining files in python directory --- python/QuasiDegenerate.py | 18 +++++++++--------- python/RooAddPdfFixer.py | 2 +- python/STXSModels.py | 4 ++-- python/STXStoEFTModel.py | 2 +- python/STXStoSMEFTModel.py | 6 +++--- python/ShapeTools.py | 24 ++++++++++++------------ python/SingleTopModels.py | 4 ++-- python/SpinZeroStructure.py | 4 ++-- python/TagAndProbeModel.py | 2 +- python/TrilinearCouplingModels.py | 4 ++-- python/TwoHiggsModels.py | 22 +++++++++++----------- python/VEVandEpsilon.py | 26 +++++++++++++------------- 12 files changed, 59 insertions(+), 59 deletions(-) diff --git a/python/QuasiDegenerate.py b/python/QuasiDegenerate.py index eaf56bab146..9330e08475d 100644 --- a/python/QuasiDegenerate.py +++ b/python/QuasiDegenerate.py @@ -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") @@ -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="): @@ -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="): @@ -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 = "" diff --git a/python/RooAddPdfFixer.py b/python/RooAddPdfFixer.py index 3c337e248c6..6cb709262e4 100644 --- a/python/RooAddPdfFixer.py +++ b/python/RooAddPdfFixer.py @@ -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.") diff --git a/python/STXSModels.py b/python/STXSModels.py index 30a15d5977e..77bfa2732cc 100644 --- a/python/STXSModels.py +++ b/python/STXSModels.py @@ -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: diff --git a/python/STXStoEFTModel.py b/python/STXStoEFTModel.py index b3d44ed0887..a061cddc6a2 100644 --- a/python/STXStoEFTModel.py +++ b/python/STXStoEFTModel.py @@ -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", diff --git a/python/STXStoSMEFTModel.py b/python/STXStoSMEFTModel.py index 63daf71b636..fc43a71de97 100644 --- a/python/STXStoSMEFTModel.py +++ b/python/STXStoSMEFTModel.py @@ -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) @@ -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="): @@ -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) diff --git a/python/ShapeTools.py b/python/ShapeTools.py index a4ee6922c79..4297aeadfec 100644 --- a/python/ShapeTools.py +++ b/python/ShapeTools.py @@ -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) @@ -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 @@ -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): @@ -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() @@ -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]] @@ -736,7 +736,7 @@ 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"): @@ -940,7 +940,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 @@ -1052,9 +1052,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), @@ -1067,9 +1067,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), @@ -1324,7 +1324,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) ) diff --git a/python/SingleTopModels.py b/python/SingleTopModels.py index bd53af14b78..f397b427e49 100644 --- a/python/SingleTopModels.py +++ b/python/SingleTopModels.py @@ -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): diff --git a/python/SpinZeroStructure.py b/python/SpinZeroStructure.py index b4c6b217f09..e31d0500589 100644 --- a/python/SpinZeroStructure.py +++ b/python/SpinZeroStructure.py @@ -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 @@ -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: diff --git a/python/TagAndProbeModel.py b/python/TagAndProbeModel.py index 5c5a3574403..49e42394e64 100644 --- a/python/TagAndProbeModel.py +++ b/python/TagAndProbeModel.py @@ -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" diff --git a/python/TrilinearCouplingModels.py b/python/TrilinearCouplingModels.py index f1faa888b0e..5d2d02606b7 100644 --- a/python/TrilinearCouplingModels.py +++ b/python/TrilinearCouplingModels.py @@ -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) @@ -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) diff --git a/python/TwoHiggsModels.py b/python/TwoHiggsModels.py index 9b0253f9141..c233e62ce93 100644 --- a/python/TwoHiggsModels.py +++ b/python/TwoHiggsModels.py @@ -43,23 +43,23 @@ def setPhysicsOptionsBase(self, physOptions): if po.startswith("higgsMassSM="): self.mHSM = float((po.replace("higgsMassSM=", "").split(","))[0]) # without index, this will try to case list as a float ! if po == "mHAsPOI": - print("Will consider the mass of the second Higgs as a parameter of interest") + print("Will consider the mass of the second Higgs boson as a parameter of interest") self.mHAsPOI = True if po == "mHSMAsPOI": - print("Will consider the mass of the SM Higgs as a parameter of interest") + print("Will consider the mass of the SM Higgs boson as a parameter of interest") self.mHSMAsPOI = True if po.startswith("higgsMassRange="): self.mHRange = po.replace("higgsMassRange=", "").split(",") 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 boson mass range defined with inverterd order. Second must be larger than the first") if po.startswith("higgsMassRangeSM="): self.mHSMRange = po.replace("higgsMassRangeSM=", "").split(",") if len(self.mHSMRange) != 2: - raise RuntimeError("SM Higgs mass range definition requires two extrema") + raise RuntimeError("SM Higgs boson mass range definition requires two extrema") elif float(self.mHSMRange[0]) >= float(self.mHSMRange[1]): - raise RuntimeError("Extrema for SM Higgs mass range defined with inverterd order. Second must be larger the first") + raise RuntimeError("Extrema for SM Higgs mass range defined with inverterd order. Second must be larger than the first") def doMasses(self): """Create mass variables, return a postfix to the POIs if needed""" @@ -172,12 +172,12 @@ def setPhysicsOptions(self, physOptions): self.setPhysicsOptionsBase(physOptions) for po in physOptions: if po == "muSMAsPOI": - print("Will consider the signal strength of the SM Higgs as a parameter of interest") + print("Will consider the signal strength of the SM Higgs boson as a parameter of interest") self.muSMAsPOI = True self.muSMFloating = True if po == "muSMFloating": print( - "Will consider the signal strength of the SM Higgs as a floating parameter (as a parameter of interest if --PO muAsPOI is specified, as a nuisance otherwise)" + "Will consider the signal strength of the SM Higgs boson as a floating parameter (as a parameter of interest if --PO muAsPOI is specified, as a nuisance otherwise)" ) self.muSMFloating = True @@ -205,7 +205,7 @@ class SingletMixing(TwoHiggsBase): - default: r r_SM := 1 - r - with BSM: r*(1-BR_BSM) r_SM := 1 - r - BSM & Visible mu: r r_SM := 1 - r/(1-BR_BSM) - note that in the third case there's no way to enforce at model level that r/(1-BR_BSM) <= 1 + note that in the third case there is no way to enforce at model level that r/(1-BR_BSM) <= 1 """ def __init__(self): @@ -250,7 +250,7 @@ def doParametersOfInterest(self): class SingletMixingForExclusion(TwoHiggsBase): """The prediction for this model is mu + mu' == 1 (or <= 1) - So we just go probing mu+mu'""" + So we just probe mu+mu'""" def __init__(self): TwoHiggsBase.__init__(self) @@ -302,13 +302,13 @@ def setPhysicsOptions(self, physOptions): if len(self.cVRange) != 2: raise RuntimeError("cV signal strength range requires minimal and maximal value") elif float(self.cVRange[0]) >= float(self.cVRange[1]): - raise RuntimeError("minimal and maximal range swapped. Second value must be larger first one") + raise RuntimeError("Minimal and maximal range swapped. Second value must be larger than the first one") if po.startswith("cFRange="): self.cFRange = po.replace("cFRange=", "").split(":") if len(self.cFRange) != 2: raise RuntimeError("cF signal strength range requires minimal and maximal value") elif float(self.cFRange[0]) >= float(self.cFRange[1]): - raise RuntimeError("minimal and maximal range swapped. Second value must be larger first one") + raise RuntimeError("Minimal and maximal range swapped. Second value must be larger than the first one") def doParametersOfInterest(self): """Create POI and other parameters, and define the POI set.""" diff --git a/python/VEVandEpsilon.py b/python/VEVandEpsilon.py index 211dfdd0f59..885597bccc3 100644 --- a/python/VEVandEpsilon.py +++ b/python/VEVandEpsilon.py @@ -10,7 +10,7 @@ class MepsHiggs(SMLikeHiggsModel): - "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): SMLikeHiggsModel.__init__(self) # not using 'super(x,self).__init__' since I don't understand it @@ -23,23 +23,23 @@ 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.") + raise RuntimeError("Higgs boson 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("MRange="): self.MRange = po.replace("MRange=", "").split(":") if len(self.MRange) != 2: raise RuntimeError("M range requires minimal and maximal value") elif float(self.MRange[0]) >= float(self.MRange[1]): - raise RuntimeError("minimal and maximal range swapped. Second value must be larger first one") + raise RuntimeError("Minimal and maximal range swapped. Second value must be larger than the first one") if po.startswith("epsRange="): self.epsRange = po.replace("epsRange=", "").split(":") if len(self.epsRange) != 2: raise RuntimeError("epsilon range requires minimal and maximal value") elif float(self.epsRange[0]) >= float(self.epsRange[1]): - raise RuntimeError("minimal and maximal range swapped. Second value must be larger first one") + raise RuntimeError("Minimal and maximal range swapped. Second value must be larger than the first one") def doParametersOfInterest(self): """Create POI out of signal strength and MH""" @@ -163,7 +163,7 @@ def getHiggsSignalYieldScale(self, production, decay, energy): if production == "VH": print( "WARNING: You are trying to use a VH production mode in a model that needs WH and ZH separately. " - "The best I can do is to scale [%(production)s, %(decay)s, %(energy)s] with the decay BR only but this is wrong..." % locals() + "The best I can do is to scale [%(production)s, %(decay)s, %(energy)s] with the decay BR only, but this is incorrect..." % locals() ) self.modelBuilder.factory_('expr::%(name)s("1.0*@0", Meps_BRscal_%(decay)s)' % locals()) return name @@ -177,7 +177,7 @@ def getHiggsSignalYieldScale(self, production, decay, energy): class ResolvedC6(SMLikeHiggsModel): - "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): SMLikeHiggsModel.__init__(self) # not using 'super(x,self).__init__' since I don't understand it @@ -189,17 +189,17 @@ 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.") + raise RuntimeError("Higgs boson 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 boson mass range defined with inverterd order. Second must be larger than the first.") if po.startswith("MRange="): self.MRange = po.replace("MRange=", "").split(":") if len(self.MRange) != 2: raise RuntimeError("M range requires minimal and maximal value") elif float(self.MRange[0]) >= float(self.MRange[1]): - raise RuntimeError("minimal and maximal range swapped. Second value must be larger first one") + raise RuntimeError("Minimal and maximal range swapped. Second value must be larger than the first one") def doParametersOfInterest(self): """Create POI out of signal strength and MH""" @@ -298,7 +298,7 @@ def getHiggsSignalYieldScale(self, production, decay, energy): if production == "VH": print( "WARNING: You are trying to use a VH production mode in a model that needs WH and ZH separately. " - "The best I can do is to scale [%(production)s, %(decay)s, %(energy)s] with the decay BR only but this is wrong..." % locals() + "The best I can do is to scale [%(production)s, %(decay)s, %(energy)s] with the decay BR only, but this is incorrect..." % locals() ) self.modelBuilder.factory_('expr::%(name)s("1.0*@0", wztbtm_BRscal_%(decay)s)' % locals()) return name From 3398d29a42c9af73db8ee15892527dcc861c21c8 Mon Sep 17 00:00:00 2001 From: Adinda de Wit Date: Thu, 22 Feb 2024 10:44:05 +0100 Subject: [PATCH 2/2] Fix linter error in ShapeTools --- python/ShapeTools.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/ShapeTools.py b/python/ShapeTools.py index 4297aeadfec..f6fad3e57f9 100644 --- a/python/ShapeTools.py +++ b/python/ShapeTools.py @@ -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 is neither a dataset 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"):