From 789aab664f8f7c9e0049b0bbee7797d6a951046f Mon Sep 17 00:00:00 2001 From: Antonio Vagnerini Date: Mon, 16 May 2022 15:41:10 +0200 Subject: [PATCH] fixing minHieraParPerConstr and python3 compatibility for validation output scripts --- .../python/MillePedeAlignmentAlgorithm_cfi.py | 2 +- .../python/mpsvalidate/subModule.py | 8 ++++---- .../MillePedeAlignmentAlgorithm/scripts/mps_check.py | 1 + Alignment/MillePedeAlignmentAlgorithm/scripts/mps_fire.py | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Alignment/MillePedeAlignmentAlgorithm/python/MillePedeAlignmentAlgorithm_cfi.py b/Alignment/MillePedeAlignmentAlgorithm/python/MillePedeAlignmentAlgorithm_cfi.py index 95909f808a32e..c7db386378c18 100644 --- a/Alignment/MillePedeAlignmentAlgorithm/python/MillePedeAlignmentAlgorithm_cfi.py +++ b/Alignment/MillePedeAlignmentAlgorithm/python/MillePedeAlignmentAlgorithm_cfi.py @@ -69,7 +69,7 @@ # AlignmentProducer.ParameterBuilder.Selector, cf. Twiki page SWGuideMillepedeIIAlgorithm. Presigmas = cms.VPSet(), minHieraConstrCoeff = cms.double(1.e-10), # min abs value of coeff. in hierarchy constr. - minHieraParPerConstr = cms.uint32(2), # ignore hierarchy constraints with less params + minHieraParPerConstr = cms.uint32(1), # ignore hierarchy constraints with less params constrPrecision = cms.uint32(10), # precision for writing constraints to text file. Default is 6 and can be setup with constrPrecision = cms.uint32(0) # specify additional steering files additionalSteerFiles = cms.vstring(), # obsolete - can be given as entries in 'options' diff --git a/Alignment/MillePedeAlignmentAlgorithm/python/mpsvalidate/subModule.py b/Alignment/MillePedeAlignmentAlgorithm/python/mpsvalidate/subModule.py index d3d543f9eaa96..b49ff056f2971 100644 --- a/Alignment/MillePedeAlignmentAlgorithm/python/mpsvalidate/subModule.py +++ b/Alignment/MillePedeAlignmentAlgorithm/python/mpsvalidate/subModule.py @@ -102,10 +102,10 @@ def plot(MillePedeUser, alignables, mode, struct, parentPlot, config): # count entries which are not shown anymore # bin 1 to begin of histogram - for j in range(1, numberOfBins / 2 - binShift): + for j in range(1, numberOfBins // 2 - binShift): plot.hiddenEntries[i] += plot.histo[i].GetBinContent(j) # from the end of shown bins to the end of histogram - for j in range(numberOfBins / 2 + binShift, plot.histo[i].GetNbinsX()): + for j in range(numberOfBins // 2 + binShift, plot.histo[i].GetNbinsX()): plot.hiddenEntries[i] += plot.histo[i].GetBinContent(j) # merge bins, ca. 100 should be visible in the resulting plot @@ -128,8 +128,8 @@ def plot(MillePedeUser, alignables, mode, struct, parentPlot, config): # set view range. it is important to note that the number of bins have changed with the rebinning # the total number and the number of shift must be # corrected with / mergeNumberBins - plot.histo[i].GetXaxis().SetRange(int(numberOfBins / (2 * mergeNumberBins) - binShift / - mergeNumberBins), int(numberOfBins / (2 * mergeNumberBins) + binShift / mergeNumberBins)) + plot.histo[i].GetXaxis().SetRange(int(numberOfBins // (2 * mergeNumberBins) - binShift / + mergeNumberBins), int(numberOfBins // (2 * mergeNumberBins) + binShift / mergeNumberBins)) # save copy plots[subStructNumber] = plot diff --git a/Alignment/MillePedeAlignmentAlgorithm/scripts/mps_check.py b/Alignment/MillePedeAlignmentAlgorithm/scripts/mps_check.py index 072564c83cd30..05efad22085dc 100755 --- a/Alignment/MillePedeAlignmentAlgorithm/scripts/mps_check.py +++ b/Alignment/MillePedeAlignmentAlgorithm/scripts/mps_check.py @@ -239,6 +239,7 @@ #$mOutSize = `nsls -l $mssDir | grep $milleOut | head -1 | awk '{print \$5}'`; #$mOutSize = `cmsLs -l $mssDir | grep $milleOut | head -1 | awk '{print \$2}'`; mOutSize = 0 + #print(">>>eoslsoutput:", eoslsoutput, " \ttype(eoslsoutput):", type(eoslsoutput)) for line in eoslsoutput: if milleOut in line: columns = line.split() diff --git a/Alignment/MillePedeAlignmentAlgorithm/scripts/mps_fire.py b/Alignment/MillePedeAlignmentAlgorithm/scripts/mps_fire.py index 5a7d1caf5b39e..a5ac4e778c83f 100755 --- a/Alignment/MillePedeAlignmentAlgorithm/scripts/mps_fire.py +++ b/Alignment/MillePedeAlignmentAlgorithm/scripts/mps_fire.py @@ -313,6 +313,7 @@ def write_HTCondor_submit_file_mille(path, script, lib, proxy_path=None): shell=True).decode() except subprocess.CalledProcessError as e: result = "" # -> check for successful job submission will fail + #print(' '+result, end=' ') print(result) result = result.strip()