Skip to content

Commit

Permalink
Avoid sequence expansion in customizeHLTTrackingForPhaseI2017
Browse files Browse the repository at this point in the history
Expanding sequences containing the modules/sequences modified here
causes the changes not to propagate everywhere (the expansion is done
before the modification).
  • Loading branch information
makortel committed Feb 2, 2017
1 parent 76f0b45 commit 4ded3bc
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ def modifyHLTPhaseIPixelGeom(process):

# modify the HLT configuration to run the Phase I tracking in the particle flow sequence
def customizeHLTForPFTrackingPhaseI2017(process):
# Bit of a hack to replace a module/sequence with another without
# expanding the sequences containing it, but works
#
# In principle setattr(process) can be used to replace a
# module/sequence too, but it expands the sequences making life
# more complex
modifier = cms.Modifier()
modifier._setChosen()


process.hltPixelLayerTriplets.layerList = cms.vstring(
'BPix1+BPix2+BPix3',
Expand Down Expand Up @@ -115,7 +124,7 @@ def customizeHLTForPFTrackingPhaseI2017(process):

process.hltPixelTracks.SeedingHitSets = "hltPixelTracksHitQuadruplets"

process.HLTDoRecoPixelTracksSequence = cms.Sequence(
process.HLTDoRecoPixelTracksSequence = cms.Sequence( # this sequence doesn't exist, but why to add it?
process.hltPixelLayerQuadruplets +
process.hltPixelTracksTrackingRegions +
process.hltPixelTracksHitDoublets +
Expand All @@ -129,7 +138,7 @@ def customizeHLTForPFTrackingPhaseI2017(process):
process.hltIter0PFlowTrackCutClassifier.mva.min3DLayers = cms.vint32( 0, 3, 4 )
process.hltIter0PFlowTrackCutClassifier.mva.minPixelHits = cms.vint32( 0, 3, 4 )

process.hltIter1PixelLayerTriplets = cms.EDProducer( "SeedingLayersEDProducer",
modifier.toReplaceWith(process.hltIter1PixelLayerTriplets, cms.EDProducer( "SeedingLayersEDProducer",
layerList = cms.vstring(
'BPix1+BPix2+BPix3',
'BPix1+BPix2+FPix1_pos',
Expand Down Expand Up @@ -161,7 +170,7 @@ def customizeHLTForPFTrackingPhaseI2017(process):
hitErrorRPhi = cms.double( 0.0027 )
),
TIB = cms.PSet( )
)
))

process.HLTIter1PSetTrajectoryFilterIT = cms.PSet(
ComponentType = cms.string('CkfBaseTrajectoryFilter'),
Expand Down Expand Up @@ -226,7 +235,7 @@ def customizeHLTForPFTrackingPhaseI2017(process):
useSameTrajFilter = cms.bool(False) # new ! other iteration should have it set to True
)

process.HLTIterativeTrackingIteration1 = cms.Sequence( process.hltIter1ClustersRefRemoval + process.hltIter1MaskedMeasurementTrackerEvent + process.hltIter1PixelLayerTriplets + process.hltIter1PFlowPixelTrackingRegions + process.hltIter1PFlowPixelClusterCheck + process.hltIter1PFlowPixelHitDoublets + process.hltIter1PFlowPixelHitTriplets + process.hltIter1PFlowPixelSeeds + process.hltIter1PFlowCkfTrackCandidates + process.hltIter1PFlowCtfWithMaterialTracks + process.hltIter1PFlowTrackCutClassifierPrompt + process.hltIter1PFlowTrackCutClassifierDetached + process.hltIter1PFlowTrackCutClassifierMerged + process.hltIter1PFlowTrackSelectionHighPurity )
modifier.toReplaceWith(process.HLTIterativeTrackingIteration1, cms.Sequence( process.hltIter1ClustersRefRemoval + process.hltIter1MaskedMeasurementTrackerEvent + process.hltIter1PixelLayerTriplets + process.hltIter1PFlowPixelTrackingRegions + process.hltIter1PFlowPixelClusterCheck + process.hltIter1PFlowPixelHitDoublets + process.hltIter1PFlowPixelHitTriplets + process.hltIter1PFlowPixelSeeds + process.hltIter1PFlowCkfTrackCandidates + process.hltIter1PFlowCtfWithMaterialTracks + process.hltIter1PFlowTrackCutClassifierPrompt + process.hltIter1PFlowTrackCutClassifierDetached + process.hltIter1PFlowTrackCutClassifierMerged + process.hltIter1PFlowTrackSelectionHighPurity ))

process.hltIter2PixelLayerTriplets = cms.EDProducer( "SeedingLayersEDProducer",
layerList = cms.vstring(
Expand Down Expand Up @@ -286,10 +295,10 @@ def _copy(old, new, skip=[]):
if key not in skipSet:
setattr(new, key, getattr(old, key))
from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer_cfi import seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer as _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer
process.hltIter2PFlowPixelSeeds = _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer.clone(seedingHitSets="hltIter2PFlowPixelHitTriplets")
modifier.toReplaceWith(process.hltIter2PFlowPixelSeeds, _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer.clone(seedingHitSets="hltIter2PFlowPixelHitTriplets"))
_copy(process.HLTSeedFromConsecutiveHitsTripletOnlyCreator, process.hltIter2PFlowPixelSeeds, skip=["ComponentName"])

process.HLTIterativeTrackingIteration2 = cms.Sequence( process.hltIter2ClustersRefRemoval + process.hltIter2MaskedMeasurementTrackerEvent + process.hltIter2PixelLayerTriplets + process.hltIter2PFlowPixelTrackingRegions + process.hltIter2PFlowPixelClusterCheck + process.hltIter2PFlowPixelHitDoublets + process.hltIter2PFlowPixelHitTriplets + process.hltIter2PFlowPixelSeeds + process.hltIter2PFlowCkfTrackCandidates + process.hltIter2PFlowCtfWithMaterialTracks + process.hltIter2PFlowTrackCutClassifier + process.hltIter2PFlowTrackSelectionHighPurity )
modifier.toReplaceWith(process.HLTIterativeTrackingIteration2, cms.Sequence( process.hltIter2ClustersRefRemoval + process.hltIter2MaskedMeasurementTrackerEvent + process.hltIter2PixelLayerTriplets + process.hltIter2PFlowPixelTrackingRegions + process.hltIter2PFlowPixelClusterCheck + process.hltIter2PFlowPixelHitDoublets + process.hltIter2PFlowPixelHitTriplets + process.hltIter2PFlowPixelSeeds + process.hltIter2PFlowCkfTrackCandidates + process.hltIter2PFlowCtfWithMaterialTracks + process.hltIter2PFlowTrackCutClassifier + process.hltIter2PFlowTrackSelectionHighPurity ))

# Need to operate on Paths as well...
for seqs in [process.sequences_(), process.paths_()]:
Expand Down

0 comments on commit 4ded3bc

Please sign in to comment.