From 1984de573bf3ccee971d9f31a01cba263019fde3 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Fri, 10 Dec 2021 20:45:14 +0100 Subject: [PATCH] Add early delete customisation for mkFit temporary data products --- .../python/earlyDeleteSettings_cff.py | 2 ++ .../python/customiseEarlyDeleteForMkFit.py | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 RecoTracker/Configuration/python/customiseEarlyDeleteForMkFit.py diff --git a/Configuration/StandardSequences/python/earlyDeleteSettings_cff.py b/Configuration/StandardSequences/python/earlyDeleteSettings_cff.py index ffa5e87fd7dff..e20571340f1da 100644 --- a/Configuration/StandardSequences/python/earlyDeleteSettings_cff.py +++ b/Configuration/StandardSequences/python/earlyDeleteSettings_cff.py @@ -5,6 +5,7 @@ import FWCore.ParameterSet.Config as cms from RecoTracker.Configuration.customiseEarlyDeleteForSeeding import customiseEarlyDeleteForSeeding +from RecoTracker.Configuration.customiseEarlyDeleteForMkFit import customiseEarlyDeleteForMkFit from CommonTools.ParticleFlow.Isolation.customiseEarlyDeleteForCandIsoDeposits import customiseEarlyDeleteForCandIsoDeposits def _hasInputTagModuleLabel(process, pset, psetModLabel, moduleLabels, result): @@ -43,6 +44,7 @@ def customiseEarlyDelete(process): products = collections.defaultdict(list) products = customiseEarlyDeleteForSeeding(process, products) + products = customiseEarlyDeleteForMkFit(process, products) products = customiseEarlyDeleteForCandIsoDeposits(process, products) diff --git a/RecoTracker/Configuration/python/customiseEarlyDeleteForMkFit.py b/RecoTracker/Configuration/python/customiseEarlyDeleteForMkFit.py new file mode 100644 index 0000000000000..1267748c1e3e0 --- /dev/null +++ b/RecoTracker/Configuration/python/customiseEarlyDeleteForMkFit.py @@ -0,0 +1,29 @@ +import FWCore.ParameterSet.Config as cms + +import collections + +def customiseEarlyDeleteForMkFit(process, products): + def _branchName(productType, moduleLabel, instanceLabel=""): + return "%s_%s_%s_%s" % (productType, moduleLabel, instanceLabel, process.name_()) + + for name, module in process.producers_().items(): + cppType = module.type_() + if cppType == "MkFitSiPixelHitConverter": + products[name].extend([ + _branchName("MkFitHitWrapper", name), + _branchName("MkFitClusterIndexToHit", name), + ]) + elif cppType == "MkFitSiStripHitConverter": + products[name].extend([ + _branchName("MkFitHitWrapper", name), + _branchName("MkFitClusterIndexToHit", name), + _branchName("floats", name) + ]) + elif cppType == "MkFitEventOfHitsProducer": + products[name].append(_branchName("MkFitEventOfHits", name)) + elif cppType == "MkFitSeedConverter": + products[name].append(_branchName("MkFitSeedWrapper", name)) + elif cppType == "MkFitProducer": + products[name].append(_branchName("MkFitOutputWrapper", name)) + + return products