From 675550fa72fe0440699b9984353dd0b016abc16a Mon Sep 17 00:00:00 2001 From: AdrianoDee Date: Mon, 11 Nov 2024 13:56:05 +0100 Subject: [PATCH] Allowing Cluster Splitting with HLT vertices --- .../EventContent/python/EventContent_cff.py | 6 ++ .../python/hltClusterSplitting_cff.py | 8 +++ .../python/upgradeWorkflowComponents.py | 68 +++++++++++++++++++ .../python/InitialStepPreSplitting_cff.py | 25 +++++++ .../RecoTrack/python/TrackValidation_cff.py | 14 +++- 5 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 Configuration/ProcessModifiers/python/hltClusterSplitting_cff.py diff --git a/Configuration/EventContent/python/EventContent_cff.py b/Configuration/EventContent/python/EventContent_cff.py index 396b424cd3da2..59653a9b73828 100644 --- a/Configuration/EventContent/python/EventContent_cff.py +++ b/Configuration/EventContent/python/EventContent_cff.py @@ -670,6 +670,12 @@ def SwapKeepAndDrop(l): FEVTDEBUGHLTEventContent.outputCommands.append('keep *_*_StripDigiSimLink_*') FEVTDEBUGHLTEventContent.outputCommands.append('keep *_*_PixelDigiSimLink_*') +from Configuration.ProcessModifiers.hltClusterSplitting_cff import hltClusterSplitting +hltClusterSplitting.toModify(FEVTDEBUGHLTEventContent, + outputCommands = FEVTDEBUGHLTEventContent.outputCommands+[ + 'keep *_hltPixelVertices_*_*' + ]) + approxSiStripClusters.toModify(FEVTDEBUGHLTEventContent, outputCommands = FEVTDEBUGHLTEventContent.outputCommands+[ 'keep *_hltSiStripClusters2ApproxClusters_*_*', diff --git a/Configuration/ProcessModifiers/python/hltClusterSplitting_cff.py b/Configuration/ProcessModifiers/python/hltClusterSplitting_cff.py new file mode 100644 index 0000000000000..131354edc54eb --- /dev/null +++ b/Configuration/ProcessModifiers/python/hltClusterSplitting_cff.py @@ -0,0 +1,8 @@ +import FWCore.ParameterSet.Config as cms + +# This modifier enables +# - saving trimmed pixel vertices at HLT; +# - using those vertices in input for the cluster splitting and ak4CaloJets; + +hltClusterSplitting = cms.Modifier() + diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index fbfd6b28801aa..59b28e469532e 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -2500,6 +2500,74 @@ def condition(self, fragment, stepList, key, hasHarvest): offset = 0.19002, ) +class UpgradeWorkflow_SplittingFromHLT(UpgradeWorkflow): + def setup_(self, step, stepName, stepDict, k, properties): + stepDict[stepName][k] = merge([{'--procModifiers': 'hltClusterSplitting'}, stepDict[step][k]]) + # if step in ["Digi","HLTOnly","DigiTrigger"]: + # stepDict[stepName][k] = merge([{'--customise': 'RecoLocalTracker/SubCollectionProducers/customizeSplittingFromHLT.customiseSplittingFromHLT'}, stepDict[stepName][k]]) + def condition(self, fragment, stepList, key, hasHarvest): + return '2025' in key and fragment=="TTbar_14TeV" + +upgradeWFs['SplittingFromHLT'] = UpgradeWorkflow_SplittingFromHLT( + steps = [ + 'DigiTrigger', + 'Digi', + 'HLTOnly', + 'RecoLocal', + 'Reco', + 'RecoFakeHLT', + 'RecoGlobal', + ], + PU = [ + 'DigiTrigger', + 'Digi', + 'HLTOnly', + 'RecoLocal', + 'Reco', + 'RecoFakeHLT', + 'RecoGlobal', + ], + suffix = '_SplittingFromHLT', + offset = 0.19003, +) + +class UpgradeWorkflow_SplittingProdLike(UpgradeWorkflow_ProdLike): + def __init__(self, suffix, offset,steps, PU): + super(UpgradeWorkflow_SplittingProdLike, self).__init__(steps, PU, suffix, offset) + + def setup_(self, step, stepName, stepDict, k, properties): + # copy steps, then apply specializations + stepDict[stepName][k] = merge([{'--procModifiers': 'hltClusterSplitting'}, stepDict[step][k]]) + + def condition(self, fragment, stepList, key, hasHarvest): + return '2025' in key and fragment=="TTbar_14TeV" + +upgradeWFs['SplittingFromHLTProdLike'] = UpgradeWorkflow_SplittingProdLike( + steps = [ + ], + PU = [ + 'GenSimHLBeamSpot14', + 'Digi', + 'DigiTrigger', + 'HLTOnly', + 'Reco', + 'RecoFakeHLT', + 'RecoGlobal', + 'RecoNano', + 'RecoNanoFakeHLT', + 'HARVEST', + 'HARVESTFakeHLT', + 'HARVESTGlobal', + 'HARVESTNano', + 'HARVESTNanoFakeHLT', + 'MiniAOD', + 'ALCA', + 'Nano', + ], + suffix = '_SplittingFromHLTProdLike', + offset = 0.1900321, +) + # # Simulates Bias Rail in Phase-2 OT PS modules and X% random bad Strips # in PS-s and SS sensors diff --git a/RecoTracker/IterativeTracking/python/InitialStepPreSplitting_cff.py b/RecoTracker/IterativeTracking/python/InitialStepPreSplitting_cff.py index a28f1a80d4389..6380b46c95666 100644 --- a/RecoTracker/IterativeTracking/python/InitialStepPreSplitting_cff.py +++ b/RecoTracker/IterativeTracking/python/InitialStepPreSplitting_cff.py @@ -221,6 +221,12 @@ src = 'caloTowerForTrkPreSplitting', srcPVs = 'firstStepPrimaryVerticesPreSplitting' ) + +from Configuration.ProcessModifiers.hltClusterSplitting_cff import hltClusterSplitting +hltClusterSplitting.toModify(ak4CaloJetsForTrkPreSplitting, + srcPVs = 'hltPixelVertices' +) + jetsForCoreTrackingPreSplitting = jetsForCoreTracking.clone( src = 'ak4CaloJetsForTrkPreSplitting' ) @@ -233,6 +239,8 @@ cores = 'jetsForCoreTrackingPreSplitting' ) + + # Final sequence from RecoLocalTracker.SiPixelRecHits.SiPixelRecHits_cfi import siPixelRecHits from RecoTracker.MeasurementDet.MeasurementTrackerEventProducer_cfi import MeasurementTrackerEvent @@ -254,6 +262,23 @@ siPixelRecHits, MeasurementTrackerEvent, siPixelClusterShapeCache) + +hltClusterSplitting.toModify(siPixelClusters, + vertices = cms.InputTag("hltPixelVertices") + # hltPoint = cms.InputTag("hltTrimmedPixelVertices"), + # usePVFromRaw = cms.bool(True), +) + +InitialStepPreSplittingFromHLTTask = cms.Task( + caloTowerForTrkPreSplitting, + ak4CaloJetsForTrkPreSplitting, + jetsForCoreTrackingPreSplitting, + siPixelClusters, + siPixelRecHits, + MeasurementTrackerEvent, + siPixelClusterShapeCache) +hltClusterSplitting.toReplaceWith(InitialStepPreSplittingTask, InitialStepPreSplittingFromHLTTask) + InitialStepPreSplitting = cms.Sequence(InitialStepPreSplittingTask) _InitialStepPreSplittingTask_trackingPhase1 = InitialStepPreSplittingTask.copy() _InitialStepPreSplittingTask_trackingPhase1.replace(initialStepHitTripletsPreSplitting, cms.Task(initialStepHitTripletsPreSplitting,initialStepHitQuadrupletsPreSplitting)) diff --git a/Validation/RecoTrack/python/TrackValidation_cff.py b/Validation/RecoTrack/python/TrackValidation_cff.py index 268e83f743db2..d2155c7b17beb 100644 --- a/Validation/RecoTrack/python/TrackValidation_cff.py +++ b/Validation/RecoTrack/python/TrackValidation_cff.py @@ -21,6 +21,7 @@ import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg import RecoTracker.IterativeTracking.iterativeTkUtils as _utils from Configuration.Eras.Modifier_fastSim_cff import fastSim +from Configuration.ProcessModifiers.hltClusterSplitting_cff import hltClusterSplitting ### First define the stuff for the standard validation sequence ## Track selectors @@ -48,8 +49,8 @@ "displacedRegionalStepSeeds", "muonSeededSeedsInOut", "muonSeededSeedsOutIn"] - _seedProducers_fastSim = [ x for x in _seedProducers if x not in _removeForFastSimSeedProducers] +_seedProducers_hltSplit = [ x for x in _seedProducers if x not in ["initialStepSeedsPreSplitting"]] _removeForFastTrackProducers = ["initialStepTracksPreSplitting", "jetCoreRegionalStepTracks", @@ -57,6 +58,7 @@ "muonSeededTracksInOut", "muonSeededTracksOutIn"] _trackProducers_fastSim = [ x for x in _trackProducers if x not in _removeForFastTrackProducers] +_trackProducers_hltSplit = [ x for x in _trackProducers if x not in ["initialStepTracksPreSplitting"]] def _algoToSelector(algo): sel = "" @@ -814,6 +816,10 @@ def _uniqueFirstLayers(layerList): trackValidatorGsfTracks, ])) +hltClusterSplitting.toReplaceWith(tracksValidation, tracksValidation.copyAndExclude([ + trackValidatorBuildingPreSplitting, +])) + ### Then define stuff for standalone mode (i.e. MTV with RECO+DIGI input) # Select by originalAlgo and algoMask @@ -1017,6 +1023,12 @@ def _uniqueFirstLayers(layerList): trackValidatorConversionTrackingOnly, trackValidatorBHadronTrackingOnly ])) + +hltClusterSplitting.toReplaceWith(trackValidatorsTrackingOnly, trackValidatorsTrackingOnly.copyAndExclude([ + trackValidatorBuildingPreSplitting, + trackValidatorSeedingPreSplittingTrackingOnly, +])) + tracksValidationTrackingOnly = cms.Sequence( trackValidatorsTrackingOnly, tracksPreValidationTrackingOnly,