From 29962399c42a8c925ed91d87f874ef04d21e93c3 Mon Sep 17 00:00:00 2001 From: Lucas Corcodilos Date: Wed, 4 Aug 2021 13:51:35 -0500 Subject: [PATCH] Add flag instead of commented code --- .../python/TrackingRecHitProducer_cfi.py | 51 +++++++++++-------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py b/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py index 9a51c04969a63..f6202d373dee3 100644 --- a/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py @@ -2,37 +2,44 @@ import FWCore.ParameterSet.Config as cms +ULresolutionHistograms = False # Load the detailed configurations of pixel plugins. # NB: for any new detector geometry (e.g. Phase 2 varians), we should write a new plugin # config file, and import it here, and below use its own Era to load it. # -from FastSimulation.TrackingRecHitProducer.PixelPluginsPhase0_cfi import pixelPluginsPhase0 -from FastSimulation.TrackingRecHitProducer.PixelPluginsPhase1_cfi import pixelPluginsPhase1 -from FastSimulation.TrackingRecHitProducer.PixelPluginsPhase2_cfi import pixelPluginsPhase2 -# from FastSimulation.TrackingRecHitProducer.PixelPluginsUL_cfi import pixelPlugins2016UL, pixelPlugins2017UL, pixelPlugins2018UL +if ULresolutionHistograms: + from FastSimulation.TrackingRecHitProducer.PixelPluginsUL_cfi import pixelPlugins2016UL, pixelPlugins2017UL, pixelPlugins2018UL + fastTrackerRecHits = cms.EDProducer("TrackingRecHitProducer", + simHits = cms.InputTag("fastSimProducer","TrackerHits"), + plugins = pixelPlugins2016UL + ) -# The default is (for better of worse) Phase 0: -# -fastTrackerRecHits = cms.EDProducer("TrackingRecHitProducer", - simHits = cms.InputTag("fastSimProducer","TrackerHits"), - plugins = pixelPluginsPhase0 - # plugins = pixelPlugins2016UL -) + # Modify 2017 and 2018 eras directly + from Configuration.Eras.Era_Run2_2017_FastSim_cff import Run2_2017_FastSim + Run2_2017_FastSim.toModify(fastTrackerRecHits, plugins = pixelPlugins2017UL) + + from Configuration.Eras.Era_Run2_2018_FastSim_cff import Run2_2018_FastSim + Run2_2018_FastSim.toModify(fastTrackerRecHits, plugins = pixelPlugins2018UL) + +else: + from FastSimulation.TrackingRecHitProducer.PixelPluginsPhase0_cfi import pixelPluginsPhase0 + from FastSimulation.TrackingRecHitProducer.PixelPluginsPhase1_cfi import pixelPluginsPhase1 + from FastSimulation.TrackingRecHitProducer.PixelPluginsPhase2_cfi import pixelPluginsPhase2 -# Phase 1 Era: replace plugins by Phase 1 plugins -from Configuration.Eras.Modifier_phase1Pixel_cff import phase1Pixel -phase1Pixel.toModify(fastTrackerRecHits, plugins = pixelPluginsPhase1) + # The default is (for better of worse) Phase 0: + fastTrackerRecHits = cms.EDProducer("TrackingRecHitProducer", + simHits = cms.InputTag("fastSimProducer","TrackerHits"), + plugins = pixelPluginsPhase0 + ) -# Modify 2017 and 2018 eras directly -# from Configuration.Eras.Era_Run2_2017_FastSim_cff import Run2_2017_FastSim -# Run2_2017_FastSim.toModify(fastTrackerRecHits, plugins = pixelPlugins2017UL) -# from Configuration.Eras.Era_Run2_2018_FastSim_cff import Run2_2018_FastSim -# Run2_2018_FastSim.toModify(fastTrackerRecHits, plugins = pixelPlugins2018UL) + # Phase 1 Era: replace plugins by Phase 1 plugins + from Configuration.Eras.Modifier_phase1Pixel_cff import phase1Pixel + phase1Pixel.toModify(fastTrackerRecHits, plugins = pixelPluginsPhase1) -# Phase 2 Era: replace plugins by Phase 2 plugins, etc... -from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker -phase2_tracker.toModify(fastTrackerRecHits, plugins = pixelPluginsPhase2) + # Phase 2 Era: replace plugins by Phase 2 plugins, etc... + from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker + phase2_tracker.toModify(fastTrackerRecHits, plugins = pixelPluginsPhase2) # Configure strip tracker Gaussian-smearing plugins: trackerStripGaussianResolutions={