Skip to content

Commit

Permalink
Allowing Cluster Splitting with HLT vertices
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianoDee committed Nov 13, 2024
1 parent e2471cd commit 675550f
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Configuration/EventContent/python/EventContent_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_*_*',
Expand Down
Original file line number Diff line number Diff line change
@@ -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()

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
Expand All @@ -233,6 +239,8 @@
cores = 'jetsForCoreTrackingPreSplitting'
)



# Final sequence
from RecoLocalTracker.SiPixelRecHits.SiPixelRecHits_cfi import siPixelRecHits
from RecoTracker.MeasurementDet.MeasurementTrackerEventProducer_cfi import MeasurementTrackerEvent
Expand All @@ -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))
Expand Down
14 changes: 13 additions & 1 deletion Validation/RecoTrack/python/TrackValidation_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -48,15 +49,16 @@
"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",
"displacedRegionalStepTracks",
"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 = ""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1017,6 +1023,12 @@ def _uniqueFirstLayers(layerList):
trackValidatorConversionTrackingOnly,
trackValidatorBHadronTrackingOnly
]))

hltClusterSplitting.toReplaceWith(trackValidatorsTrackingOnly, trackValidatorsTrackingOnly.copyAndExclude([
trackValidatorBuildingPreSplitting,
trackValidatorSeedingPreSplittingTrackingOnly,
]))

tracksValidationTrackingOnly = cms.Sequence(
trackValidatorsTrackingOnly,
tracksPreValidationTrackingOnly,
Expand Down

0 comments on commit 675550f

Please sign in to comment.