Skip to content

Commit

Permalink
Migrate customizeHLTTrackingForPhaseI2017
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Jan 12, 2017
1 parent 584a162 commit 25c2b8c
Showing 1 changed file with 67 additions and 41 deletions.
108 changes: 67 additions & 41 deletions HLTrigger/Configuration/python/customizeHLTTrackingForPhaseI2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,21 @@ def customizeHLTForPFTrackingPhaseI2017(process):
)

# Configure seed generator / pixel track producer
from RecoPixelVertexing.PixelTriplets.CAHitQuadrupletGenerator_cfi import CAHitQuadrupletGenerator as _CAHitQuadrupletGenerator
from RecoPixelVertexing.PixelTriplets.caHitQuadrupletEDProducer_cfi import caHitQuadrupletEDProducer as _caHitQuadrupletEDProducer

process.hltPixelTracks.OrderedHitsFactoryPSet = _CAHitQuadrupletGenerator.clone(
ComponentName = cms.string("CAHitQuadrupletGenerator"),
process.hltPixelTracksTrackingRegions.RegionPSet = cms.PSet(
precise = cms.bool( True ),
beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
originRadius = cms.double(0.02),
ptMin = cms.double(0.9),
nSigmaZ = cms.double(4.0),
)

process.hltPixelTracksHitDoublets.seedingLayers = "hltPixelLayerQuadruplets"
process.hltPixelTracksHitDoublets.layerPairs = [0,1,2] # layer pairs (0,1), (1,2), (2,3)

process.hltPixelTracksHitQuadruplets = _caHitQuadrupletEDProducer.clone(
doublets = "hltPixelTracksHitDoublets",
extraHitRPhitolerance = cms.double(0.032),
maxChi2 = dict(
pt1 = 0.7,
Expand All @@ -93,7 +104,6 @@ def customizeHLTForPFTrackingPhaseI2017(process):
useBendingCorrection = True,
fitFastCircle = True,
fitFastCircleChi2Cut = True,
SeedingLayers = cms.InputTag("hltPixelLayerQuadruplets"),
CAThetaCut = cms.double(0.0012),
CAPhiCut = cms.double(0.2),
CAHardPtCut = cms.double(0),
Expand All @@ -103,15 +113,15 @@ def customizeHLTForPFTrackingPhaseI2017(process):
)
)

process.hltPixelTracks.RegionFactoryPSet.RegionPSet = cms.PSet(
precise = cms.bool( True ),
beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
originRadius = cms.double(0.02),
ptMin = cms.double(0.9),
nSigmaZ = cms.double(4.0),
)
process.hltPixelTracks.SeedingHitSets = "hltPixelTracksHitQuadruplets"

process.HLTDoRecoPixelTracksSequence = cms.Sequence( process.hltPixelLayerQuadruplets + process.hltPixelTracks )
process.HLTDoRecoPixelTracksSequence = cms.Sequence(
process.hltPixelLayerQuadruplets +
process.hltPixelTracksTrackingRegions +
process.hltPixelTracksHitDoublets +
process.hltPixelTracksHitQuadruplets +
process.hltPixelTracks
)

process.HLTIter0PSetTrajectoryFilterIT.minimumNumberOfHits = cms.int32( 4 )
process.HLTIter0PSetTrajectoryFilterIT.minHitsMinPt = cms.int32( 4 )
Expand Down Expand Up @@ -216,7 +226,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.hltIter1PFlowPixelSeeds + process.hltIter1PFlowCkfTrackCandidates + process.hltIter1PFlowCtfWithMaterialTracks + process.hltIter1PFlowTrackCutClassifierPrompt + process.hltIter1PFlowTrackCutClassifierDetached + process.hltIter1PFlowTrackCutClassifierMerged + process.hltIter1PFlowTrackSelectionHighPurity )
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 @@ -252,37 +262,53 @@ def customizeHLTForPFTrackingPhaseI2017(process):
TIB = cms.PSet( )
)

process.hltIter2PFlowPixelSeeds.OrderedHitsFactoryPSet = cms.PSet(
maxElement = cms.uint32( 0 ),
ComponentName = cms.string( "StandardHitTripletGenerator" ),
GeneratorPSet = cms.PSet(
useBending = cms.bool( True ),
useFixedPreFiltering = cms.bool( False ),
maxElement = cms.uint32( 100000 ),
phiPreFiltering = cms.double( 0.3 ),
extraHitRPhitolerance = cms.double( 0.032 ),
useMultScattering = cms.bool( True ),
ComponentName = cms.string( "PixelTripletHLTGenerator" ),
extraHitRZtolerance = cms.double( 0.037 ),
SeedComparitorPSet = cms.PSet( ComponentName = cms.string( "none" ) )
),
SeedingLayers = cms.InputTag( "hltIter2PixelLayerTriplets" )
from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer
process.hltIter2PFlowPixelHitDoublets.seedingLayers = "hltIter2PixelLayerTriplets"
process.hltIter2PFlowPixelHitDoublets.produceIntermediateHitDoublets = True
process.hltIter2PFlowPixelHitDoublets.produceSeedingHitSets = False
process.hltIter2PFlowPixelHitDoublets.seedingLayers = "hltIter2PixelLayerTriplets"
process.hltIter2PFlowPixelHitTriplets = _pixelTripletHLTEDProducer.clone(
doublets = "hltIter2PFlowPixelHitDoublets",
useBending = cms.bool( True ),
useFixedPreFiltering = cms.bool( False ),
maxElement = cms.uint32( 100000 ),
phiPreFiltering = cms.double( 0.3 ),
extraHitRPhitolerance = cms.double( 0.032 ),
useMultScattering = cms.bool( True ),
extraHitRZtolerance = cms.double( 0.037 ),
SeedComparitorPSet = cms.PSet( ComponentName = cms.string( "none" ) ),
produceSeedingHitSets = True,
)

process.hltIter2PFlowPixelSeeds.SeedCreatorPSet = cms.PSet( refToPSet_ = cms.string( "HLTSeedFromConsecutiveHitsTripletOnlyCreator" ) )

process.HLTIterativeTrackingIteration2 = cms.Sequence( process.hltIter2ClustersRefRemoval + process.hltIter2MaskedMeasurementTrackerEvent + process.hltIter2PixelLayerTriplets + process.hltIter2PFlowPixelSeeds + process.hltIter2PFlowCkfTrackCandidates + process.hltIter2PFlowCtfWithMaterialTracks + process.hltIter2PFlowTrackCutClassifier + process.hltIter2PFlowTrackSelectionHighPurity )
def _copy(old, new, skip=[]):
skipSet = set(skip)
for key in old.parameterNames_():
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")
_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 )

# Need to operate on Paths as well...
for seqs in [process.sequences_(), process.paths_()]:
for seqName, seq in seqs.iteritems():
from FWCore.ParameterSet.SequenceTypes import ModuleNodeVisitor
l = list()
v = ModuleNodeVisitor(l)
seq.visit(v)

if process.hltPixelTracks in l and not process.hltPixelLayerQuadruplets in l:
seq.remove(process.hltPixelLayerTriplets) # note that this module does not necessarily exist in sequence 'seq', if it doesn't, it does not get removed
index = seq.index(process.hltPixelTracksHitDoublets)
seq.insert(index,process.hltPixelLayerQuadruplets)
index = seq.index(process.hltPixelTracksHitTriplets)
seq.remove(process.hltPixelTracksHitTriplets)
seq.insert(index, process.hltPixelTracksHitQuadruplets)

for seqName in process.sequences:
seq = getattr(process,seqName)
from FWCore.ParameterSet.SequenceTypes import ModuleNodeVisitor
l = list()
v = ModuleNodeVisitor(l)
seq.visit(v)
if process.hltPixelTracks in l and not process.hltPixelLayerQuadruplets in l:
seq.remove(process.hltPixelLayerTriplets)
index = seq.index(process.hltPixelTracks)
seq.insert(index,process.hltPixelLayerQuadruplets)
# Remove entirely to avoid warning from the early deleter
del process.hltPixelTracksHitTriplets

return process

Expand Down

0 comments on commit 25c2b8c

Please sign in to comment.