From 8d7f61740212a4cb285c828a15247e41a5202423 Mon Sep 17 00:00:00 2001 From: Gaelle Date: Mon, 19 Oct 2015 04:52:37 +0200 Subject: [PATCH 1/2] configuring flat BS + DQM GUI --- .../python/MatrixInjector.py | 2 +- .../Configuration/python/combinedCustoms.py | 43 +++++++++++++++---- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/MatrixInjector.py b/Configuration/PyReleaseValidation/python/MatrixInjector.py index 9c009fa6ce9fe..7258d0dcd9fcd 100644 --- a/Configuration/PyReleaseValidation/python/MatrixInjector.py +++ b/Configuration/PyReleaseValidation/python/MatrixInjector.py @@ -57,7 +57,7 @@ def __init__(self,opt,mode='init',options=''): self.wmagent = 'cmsweb.cern.ch' if not self.dqmgui: - self.dqmgui="https://cmsweb.cern.ch/dqm/relval;https://cmsweb-testbed.cern.ch/dqm/relval" + self.dqmgui="https://cmsweb.cern.ch/dqm/relval" #couch stuff self.couch = 'https://'+self.wmagent+'/couchdb' # self.couchDB = 'reqmgr_config_cache' diff --git a/SLHCUpgradeSimulations/Configuration/python/combinedCustoms.py b/SLHCUpgradeSimulations/Configuration/python/combinedCustoms.py index 9673a306cf1ed..2b0dfd21afd41 100644 --- a/SLHCUpgradeSimulations/Configuration/python/combinedCustoms.py +++ b/SLHCUpgradeSimulations/Configuration/python/combinedCustoms.py @@ -858,49 +858,74 @@ def fastsimDefault(process): def fastsimPhase2(process): return fastCustomisePhase2(process) -def bsStudyStep1(process): - process.VtxSmeared.MaxZ = 11.0 - process.VtxSmeared.MinZ = -11.0 +def bsStudyStep1(process,length): + process.VtxSmeared.MaxZ = length + process.VtxSmeared.MinZ = -length return process -def bsStudyStep2(process): +def bsStudyStep2(process,length): process.initialStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( precise = cms.bool(True), originRadius = cms.double(0.02), - originHalfLength = cms.double(11.0),#nSigmaZ = cms.double(4.0), + originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), beamSpot = cms.InputTag("offlineBeamSpot"), ptMin = cms.double(0.7) ) process.highPtTripletStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( precise = cms.bool(True), originRadius = cms.double(0.02), - originHalfLength = cms.double(11.0),#nSigmaZ = cms.double(4.0), + originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), beamSpot = cms.InputTag("offlineBeamSpot"), ptMin = cms.double(0.7) ) process.lowPtQuadStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( precise = cms.bool(True), originRadius = cms.double(0.02), - originHalfLength = cms.double(11.0),#nSigmaZ = cms.double(4.0), + originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), beamSpot = cms.InputTag("offlineBeamSpot"), ptMin = cms.double(0.2) ) process.lowPtTripletStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( precise = cms.bool(True), originRadius = cms.double(0.015), - originHalfLength = cms.double(11.0),#nSigmaZ = cms.double(4.0), + originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), beamSpot = cms.InputTag("offlineBeamSpot"), ptMin = cms.double(0.35) ) process.detachedQuadStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( precise = cms.bool(True), originRadius = cms.double(0.5), - originHalfLength = cms.double(11.0),#nSigmaZ = cms.double(4.0), + originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), beamSpot = cms.InputTag("offlineBeamSpot"), ptMin = cms.double(0.3) ) return process +def customise_bsStudyStep1_11(process): + process=bsStudyStep1(process,11.0) + return process + +def customise_bsStudyStep2_11(process): + process=bsStudyStep2(process,11.0) + return process + +def customise_bsStudyStep1_15(process): + process=bsStudyStep1(process,15.0) + return process + +def customise_bsStudyStep2_15(process): + process=bsStudyStep2(process,15.0) + return process + +def customise_bsStudyStep1_20(process): + process=bsStudyStep1(process,20.0) + return process + +def customise_bsStudyStep2_20(process): + process=bsStudyStep2(process,20.0) + return process + + def customise_noPixelDataloss(process): return cNoPixDataloss(process) From 6472d4dbe2cc1c845f4a684759e286867eeacec0 Mon Sep 17 00:00:00 2001 From: Mark Grimes Date: Tue, 20 Oct 2015 18:55:24 +0200 Subject: [PATCH 2/2] Combine bsStudyStep1 and bsStudyStep2 into one function with "hasattr" guards --- .../Configuration/python/combinedCustoms.py | 113 +++++++++--------- 1 file changed, 54 insertions(+), 59 deletions(-) diff --git a/SLHCUpgradeSimulations/Configuration/python/combinedCustoms.py b/SLHCUpgradeSimulations/Configuration/python/combinedCustoms.py index 2b0dfd21afd41..4eacf09f21fc7 100644 --- a/SLHCUpgradeSimulations/Configuration/python/combinedCustoms.py +++ b/SLHCUpgradeSimulations/Configuration/python/combinedCustoms.py @@ -858,71 +858,66 @@ def fastsimDefault(process): def fastsimPhase2(process): return fastCustomisePhase2(process) -def bsStudyStep1(process,length): - process.VtxSmeared.MaxZ = length - process.VtxSmeared.MinZ = -length - return process - -def bsStudyStep2(process,length): - process.initialStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( - precise = cms.bool(True), - originRadius = cms.double(0.02), - originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), - beamSpot = cms.InputTag("offlineBeamSpot"), - ptMin = cms.double(0.7) - ) - process.highPtTripletStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( - precise = cms.bool(True), - originRadius = cms.double(0.02), - originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), - beamSpot = cms.InputTag("offlineBeamSpot"), - ptMin = cms.double(0.7) - ) - process.lowPtQuadStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( - precise = cms.bool(True), - originRadius = cms.double(0.02), - originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), - beamSpot = cms.InputTag("offlineBeamSpot"), - ptMin = cms.double(0.2) - ) - process.lowPtTripletStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( - precise = cms.bool(True), - originRadius = cms.double(0.015), - originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), - beamSpot = cms.InputTag("offlineBeamSpot"), - ptMin = cms.double(0.35) - ) - process.detachedQuadStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( - precise = cms.bool(True), - originRadius = cms.double(0.5), - originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), - beamSpot = cms.InputTag("offlineBeamSpot"), - ptMin = cms.double(0.3) - ) - return process - -def customise_bsStudyStep1_11(process): - process=bsStudyStep1(process,11.0) - return process - -def customise_bsStudyStep2_11(process): - process=bsStudyStep2(process,11.0) +def bsStudy(process,length): + if hasattr(process,"VtxSmeared") : + try: + process.VtxSmeared.MaxZ = length + process.VtxSmeared.MinZ = -length + except TypeError as error: + raise TypeError( str(error)+". Are you using '--beamspot Flat'? This customisation only works the Flat beamspot." ) + + if hasattr(process,"initialStepSeeds") : + process.initialStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( + precise = cms.bool(True), + originRadius = cms.double(0.02), + originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), + beamSpot = cms.InputTag("offlineBeamSpot"), + ptMin = cms.double(0.7) + ) + if hasattr(process,"highPtTripletStepSeeds") : + process.highPtTripletStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( + precise = cms.bool(True), + originRadius = cms.double(0.02), + originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), + beamSpot = cms.InputTag("offlineBeamSpot"), + ptMin = cms.double(0.7) + ) + if hasattr(process,"lowPtQuadStepSeeds") : + process.lowPtQuadStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( + precise = cms.bool(True), + originRadius = cms.double(0.02), + originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), + beamSpot = cms.InputTag("offlineBeamSpot"), + ptMin = cms.double(0.2) + ) + if hasattr(process,"lowPtTripletStepSeeds") : + process.lowPtTripletStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( + precise = cms.bool(True), + originRadius = cms.double(0.015), + originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), + beamSpot = cms.InputTag("offlineBeamSpot"), + ptMin = cms.double(0.35) + ) + if hasattr(process,"detachedQuadStepSeeds") : + process.detachedQuadStepSeeds.RegionFactoryPSet.RegionPSet = cms.PSet( + precise = cms.bool(True), + originRadius = cms.double(0.5), + originHalfLength = cms.double(length),#nSigmaZ = cms.double(4.0), + beamSpot = cms.InputTag("offlineBeamSpot"), + ptMin = cms.double(0.3) + ) return process -def customise_bsStudyStep1_15(process): - process=bsStudyStep1(process,15.0) +def customise_bsStudy_11(process): + process=bsStudy(process,11.0) return process -def customise_bsStudyStep2_15(process): - process=bsStudyStep2(process,15.0) - return process - -def customise_bsStudyStep1_20(process): - process=bsStudyStep1(process,20.0) +def customise_bsStudy_15(process): + process=bsStudy(process,15.0) return process -def customise_bsStudyStep2_20(process): - process=bsStudyStep2(process,20.0) +def customise_bsStudy_20(process): + process=bsStudy(process,20.0) return process