From b087dacdb491a331cc4f5f26c2ccea61613dde37 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Fri, 5 Aug 2016 12:17:52 +0200 Subject: [PATCH 01/14] Migrate seeding to new seeding framework in customizeHLTforCMSSW --- .../python/customizeHLTforCMSSW.py | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index f32a37e2f6701..2383618ccddd4 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -161,6 +161,167 @@ def _copy(old, new, skip=[]): return process +# Migrate PixelTrackProducer and HLT to new seeding framework +def customiseFor17170(process): + from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot + from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cfi import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices + from RecoTauTag.HLTProducers.tauRegionalPixelSeedTrackingRegions_cfi import tauRegionalPixelSeedTrackingRegions as _tauRegionalPixelSeedTrackingRegions + + from RecoTracker.TkSeedGenerator.trackerClusterCheck_cfi import trackerClusterCheck as _trackerClusterCheck + + from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer + from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer + from RecoPixelVertexing.PixelTriplets.pixelTripletLargeTipEDProducer_cfi import pixelTripletLargeTipEDProducer as _pixelTripletLargeTipEDProducer + from RecoTracker.TkSeedGenerator.multiHitFromChi2EDProducer_cfi import multiHitFromChi2EDProducer as _multiHitFromChi2EDProducer + + from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsEDProducer_cfi import seedCreatorFromRegionConsecutiveHitsEDProducer as _seedCreatorFromRegionConsecutiveHitsEDProducer + from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer_cfi import seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer as _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer + + def _copy(old, new, skip=[]): + skipSet = set(skip) + for key in old.parameterNames_(): + if key not in skipSet: + setattr(new, key, getattr(old, key)) + + # Bit of a hack to replace a module with another, but works + # + # In principle setattr(process) could work too, but it expands the + # sequences and I don't want that + modifier = cms.Modifier() + modifier._setChosen() + + for producer in producers_by_type(process, "SeedGeneratorFromRegionHitsEDProducer"): + label = producer.label() + if "Seeds" in label: + regionLabel = label.replace("Seeds", "TrackingRegions") + clusterCheckLabel = label.replace("Seeds", "ClusterCheck") + doubletLabel = label.replace("Seeds", "HitDoublets") + tripletLabel = label.replace("Seeds", "HitTriplets") + else: + regionLabel = label + "TrackingRegions" + clusterCheckLabel = label + "ClusterCheck" + doubletLabel = label + "HitPairs" + tripletLabel = label + "HitTriplets" + + ## Construct new producers + # region + regionProducer = { + "GlobalRegionProducerFromBeamSpot": _globalTrackingRegionFromBeamSpot, + "GlobalTrackingRegionWithVerticesProducer": _globalTrackingRegionWithVertices, + "TauRegionalPixelSeedGenerator": _tauRegionalPixelSeedTrackingRegions, + }.get(producer.RegionFactoryPSet.ComponentName.value(), None) + if regionProducer is None: # got a region not migrated yet + #print "skipping", label, producer.RegionFactoryPSet.ComponentName.value() + continue + regionProducer = regionProducer.clone() + regionProducer.RegionPSet = producer.RegionFactoryPSet.RegionPSet + # some (all?) instances of TauRegionalPixelSeedGenerator have + # "precise" parameter, while the region producer itself does not have the parameter + if producer.RegionFactoryPSet.ComponentName.value() == "TauRegionalPixelSeedGenerator": + if hasattr(regionProducer.RegionPSet, "precise"): + del regionProducer.RegionPSet.precise + + # cluster check + clusterCheckProducer = _trackerClusterCheck.clone() + _copy(producer.ClusterCheckPSet, clusterCheckProducer) + + # hit doublet/triplet generator + doubletProducer = _hitPairEDProducer.clone( + seedingLayers = producer.OrderedHitsFactoryPSet.SeedingLayers.value(), + trackingRegions = regionLabel, + clusterCheck = clusterCheckLabel, + ) + + tripletProducer = None + if producer.OrderedHitsFactoryPSet.ComponentName.value() == "StandardHitPairGenerator": + doubletProducer.produceSeedingHitSets = True + doubletProducer.maxElement = producer.OrderedHitsFactoryPSet.maxElement.value() + elif producer.OrderedHitsFactoryPSet.ComponentName.value() == "StandardHitTripletGenerator": + doubletProducer.produceIntermediateHitDoublets = True + + tripletProducer = { + "PixelTripletHLTGenerator": _pixelTripletHLTEDProducer, + "PixelTripletLargeTipGenerator": _pixelTripletLargeTipEDProducer, + }.get(producer.OrderedHitsFactoryPSet.GeneratorPSet.ComponentName.value(), None) + if tripletProducer is None: # got a triplet generator not migrated yet + #print "skipping", label, producer.OrderedHitsFactoryPSet.GeneratorPSet.ComponentName.value() + continue + tripletProducer = tripletProducer.clone( + doublets = doubletLabel, + produceSeedingHitSets = True, + ) + elif producer.OrderedHitsFactoryPSet.ComponentName.value() == "StandardMultiHitGenerator": + doubletProducer.produceIntermediateHitDoublets = True + if producer.OrderedHitsFactoryPSet.GeneratorPSet.ComponentName.value() != "MultiHitGeneratorFromChi2": + raise Exception("In %s, StandardMultiHitGenerator without MultiHitGeneratorFromChi2, but with %s" % label, producer.OrderedHitsFactoryPSet.GeneratorPSet.ComponentName.value()) + tripletProducer = _multiHitFromChi2EDProducer.clone( + doublets = doubletLabel, + ) + else: # got a hit generator not migrated yet + #print "skipping", label, producer.OrderedHitsFactoryPSet.ComponentName.value() + continue + if tripletProducer: + _copy(producer.OrderedHitsFactoryPSet.GeneratorPSet, tripletProducer, skip=["ComponentName"]) + + # seed creator + seedCreatorPSet = producer.SeedCreatorPSet + if hasattr(seedCreatorPSet, "refToPSet_"): + seedCreatorPSet = getattr(process, seedCreatorPSet.refToPSet_.value()) + + seedProducer = { + "SeedFromConsecutiveHitsCreator": _seedCreatorFromRegionConsecutiveHitsEDProducer, + "SeedFromConsecutiveHitsTripletOnlyCreator": _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer, + }.get(producer.SeedCreatorPSet.ComponentName.value(), None) + if seedProducer is None: # got a seed creator not migrated yet + #print "skipping", label, producer.SeedCreatorPSet.ComponentName.value() + continue + seedProducer = seedProducer.clone( + seedingHitSets = tripletLabel if tripletProducer else doubletLabel + ) + _copy(seedCreatorPSet, seedProducer, skip=[ + "ComponentName", + "maxseeds", # some HLT seed creators include maxseeds parameter which does nothing except with CosmicSeedCreator + ]) + seedProducer.SeedComparitorPSet = producer.SeedComparitorPSet + + # Set new producers to process + setattr(process, regionLabel, regionProducer) + setattr(process, clusterCheckLabel, clusterCheckProducer) + setattr(process, doubletLabel, doubletProducer) + if tripletProducer: + setattr(process, tripletLabel, tripletProducer) + modifier.toReplaceWith(producer, seedProducer) + + print "Migrated", label + + # Modify sequences (also paths to be sure, altough in practice + # the seeding modules should be only in sequences in HLT?) + for seqs in [process.sequences_(), process.paths_()]: + for seqName, seq in seqs.iteritems(): + # Is there really no simpler way to add + # regionProducer+doubletProducer+tripletProducer + # before producer in the sequence? + # + # cms.Sequence.replace() would look much simpler, but + # it traverses the contained sequences too, leading to + # multiple replaces as we already loop over all + # sequences of a cms.Process, and also expands the + # contained sequences if a replacement occurs there. + try: + index = seq.index(producer) + except: + continue + + # Inserted on reverse order, succeeding module will be + # inserted before preceding one + if tripletProducer: + seq.insert(index, tripletProducer) + seq.insert(index, doubletProducer) + seq.insert(index, clusterCheckProducer) + seq.insert(index, regionProducer) + + return process + # # CMSSW version specific customizations def customizeHLTforCMSSW(process, menuType="GRun"): @@ -187,6 +348,7 @@ def customizeHLTforCMSSW(process, menuType="GRun"): print "# Applying 90X customization for ",menuType process = customiseFor16792(process) process = customiseFor17094(process) + process = customiseFor17170(process) pass # stage-2 changes only if needed From e883189bef378a5cc2ab74aaffd49739f8a40805 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Thu, 1 Dec 2016 10:45:02 +0100 Subject: [PATCH 02/14] Always clone LowPtClusterShapeSeedComparitor --- FastSimulation/Tracking/python/LowPtTripletStep_cff.py | 2 +- RecoHI/HiTracking/python/hiDetachedTripletStep_cff.py | 2 +- RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py | 2 +- RecoHI/HiTracking/python/hiRegitDetachedTripletStep_cff.py | 2 +- RecoHI/HiTracking/python/hiRegitLowPtTripletStep_cff.py | 2 +- .../PixelTriplets/python/PixelTripletHLTGenerator_cfi.py | 2 +- RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py | 2 +- RecoTracker/IterativeTracking/python/InitialStep_cff.py | 2 +- RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py | 2 +- RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/FastSimulation/Tracking/python/LowPtTripletStep_cff.py b/FastSimulation/Tracking/python/LowPtTripletStep_cff.py index 875c32903ff09..6ac6636ce089f 100644 --- a/FastSimulation/Tracking/python/LowPtTripletStep_cff.py +++ b/FastSimulation/Tracking/python/LowPtTripletStep_cff.py @@ -19,7 +19,7 @@ hitMasks = cms.InputTag("lowPtTripletStepMasks"), ) lowPtTripletStepSeeds.seedFinderSelector.pixelTripletGeneratorFactory = _hitSetProducerToFactoryPSet(_standard.lowPtTripletStepHitTriplets) -#lowPtTripletStepSeeds.pixelTripletGeneratorFactory.SeedComparitorPSet=cms.PSet( ComponentName = cms.string( "none" ) ) +lowPtTripletStepSeeds.seedFinderSelector.pixelTripletGeneratorFactory.SeedComparitorPSet.ComponentName = "none" # track candidates import FastSimulation.Tracking.TrackCandidateProducer_cfi diff --git a/RecoHI/HiTracking/python/hiDetachedTripletStep_cff.py b/RecoHI/HiTracking/python/hiDetachedTripletStep_cff.py index f64d5ef72776c..8ba4a8c97a714 100644 --- a/RecoHI/HiTracking/python/hiDetachedTripletStep_cff.py +++ b/RecoHI/HiTracking/python/hiDetachedTripletStep_cff.py @@ -90,7 +90,7 @@ hiDetachedTripletStepPixelTracks.OrderedHitsFactoryPSet.SeedingLayers = cms.InputTag('hiDetachedTripletStepSeedLayers') hiDetachedTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = cms.uint32(1000000) -hiDetachedTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor +hiDetachedTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() import RecoPixelVertexing.PixelLowPtUtilities.TrackSeeds_cfi hiDetachedTripletStepSeeds = RecoPixelVertexing.PixelLowPtUtilities.TrackSeeds_cfi.pixelTrackSeeds.clone( diff --git a/RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py b/RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py index bc10134399657..254ef35c733b4 100644 --- a/RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py +++ b/RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py @@ -87,7 +87,7 @@ hiLowPtTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = cms.uint32(5000000) hiLowPtTripletStepPixelTracks.OrderedHitsFactoryPSet.SeedingLayers = cms.InputTag('hiLowPtTripletStepSeedLayers') -hiLowPtTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor +hiLowPtTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() diff --git a/RecoHI/HiTracking/python/hiRegitDetachedTripletStep_cff.py b/RecoHI/HiTracking/python/hiRegitDetachedTripletStep_cff.py index cae790678a193..df86c3e9acf52 100644 --- a/RecoHI/HiTracking/python/hiRegitDetachedTripletStep_cff.py +++ b/RecoHI/HiTracking/python/hiRegitDetachedTripletStep_cff.py @@ -42,7 +42,7 @@ hiRegitDetachedTripletStepSeeds.OrderedHitsFactoryPSet.SeedingLayers = 'hiRegitDetachedTripletStepSeedLayers' from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import * #import RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi -#hiRegitDetachedTripletStepSeeds.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor +#hiRegitDetachedTripletStepSeeds.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() hiRegitDetachedTripletStepSeeds.RegionFactoryPSet.RegionPSet.ptMin = 1.2 # building: feed the new-named seeds diff --git a/RecoHI/HiTracking/python/hiRegitLowPtTripletStep_cff.py b/RecoHI/HiTracking/python/hiRegitLowPtTripletStep_cff.py index 9d226a078c15e..dccb112519c3a 100644 --- a/RecoHI/HiTracking/python/hiRegitLowPtTripletStep_cff.py +++ b/RecoHI/HiTracking/python/hiRegitLowPtTripletStep_cff.py @@ -41,7 +41,7 @@ hiRegitLowPtTripletStepSeeds.OrderedHitsFactoryPSet.SeedingLayers = 'hiRegitLowPtTripletStepSeedLayers' from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import * import RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi -hiRegitLowPtTripletStepSeeds.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor +hiRegitLowPtTripletStepSeeds.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() hiRegitLowPtTripletStepSeeds.RegionFactoryPSet.RegionPSet.ptMin = 0.4 diff --git a/RecoPixelVertexing/PixelTriplets/python/PixelTripletHLTGenerator_cfi.py b/RecoPixelVertexing/PixelTriplets/python/PixelTripletHLTGenerator_cfi.py index babf2ac73cd50..176f91ad5d4f0 100644 --- a/RecoPixelVertexing/PixelTriplets/python/PixelTripletHLTGenerator_cfi.py +++ b/RecoPixelVertexing/PixelTriplets/python/PixelTripletHLTGenerator_cfi.py @@ -17,6 +17,6 @@ import RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi PixelTripletHLTGeneratorWithFilter = PixelTripletHLTGenerator.clone() -PixelTripletHLTGeneratorWithFilter.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor +PixelTripletHLTGeneratorWithFilter.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() diff --git a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py index 18d80139d7389..db2d5e8c6b4f5 100644 --- a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py @@ -80,7 +80,7 @@ highPtTripletStepHitTriplets = _pixelTripletHLTEDProducer.clone( doublets = "highPtTripletStepHitDoublets", produceSeedingHitSets = True, - SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor + SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() ) from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsEDProducer_cff import seedCreatorFromRegionConsecutiveHitsEDProducer as _seedCreatorFromRegionConsecutiveHitsEDProducer highPtTripletStepSeeds = _seedCreatorFromRegionConsecutiveHitsEDProducer.clone( diff --git a/RecoTracker/IterativeTracking/python/InitialStep_cff.py b/RecoTracker/IterativeTracking/python/InitialStep_cff.py index 2f13d31ac3a07..54dc127f55949 100644 --- a/RecoTracker/IterativeTracking/python/InitialStep_cff.py +++ b/RecoTracker/IterativeTracking/python/InitialStep_cff.py @@ -56,7 +56,7 @@ initialStepHitTriplets = _pixelTripletHLTEDProducer.clone( doublets = "initialStepHitDoublets", produceSeedingHitSets = True, - SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor + SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() ) from RecoPixelVertexing.PixelTriplets.pixelQuadrupletMergerEDProducer_cfi import pixelQuadrupletMergerEDProducer as _pixelQuadrupletMergerEDProducer from RecoPixelVertexing.PixelTriplets.quadrupletseedmerging_cff import * diff --git a/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py b/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py index 22dd199d49792..c9eea1a0dbabd 100644 --- a/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py +++ b/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py @@ -52,7 +52,7 @@ lowPtQuadStepHitTriplets = _pixelTripletHLTEDProducer.clone( doublets = "lowPtQuadStepHitDoublets", produceIntermediateHitTriplets = True, - SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor + SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() ) from RecoPixelVertexing.PixelTriplets.pixelQuadrupletEDProducer_cfi import pixelQuadrupletEDProducer as _pixelQuadrupletEDProducer lowPtQuadStepHitQuadruplets = _pixelQuadrupletEDProducer.clone( diff --git a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py index 4239f31a5ae7d..52dc3dcdb2b74 100644 --- a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py @@ -76,7 +76,7 @@ lowPtTripletStepHitTriplets = _pixelTripletHLTEDProducer.clone( doublets = "lowPtTripletStepHitDoublets", produceSeedingHitSets = True, - SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor + SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() ) from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsEDProducer_cff import seedCreatorFromRegionConsecutiveHitsEDProducer as _seedCreatorFromRegionConsecutiveHitsEDProducer lowPtTripletStepSeeds = _seedCreatorFromRegionConsecutiveHitsEDProducer.clone( From a73b1b54f5382eb72746af13dcb199e892116d57 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Thu, 1 Dec 2016 11:46:50 +0100 Subject: [PATCH 03/14] Replace assert with an exception --- .../PixelLowPtUtilities/src/LowPtClusterShapeSeedComparitor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RecoPixelVertexing/PixelLowPtUtilities/src/LowPtClusterShapeSeedComparitor.cc b/RecoPixelVertexing/PixelLowPtUtilities/src/LowPtClusterShapeSeedComparitor.cc index 3f46573374eb9..b8114c8577820 100644 --- a/RecoPixelVertexing/PixelLowPtUtilities/src/LowPtClusterShapeSeedComparitor.cc +++ b/RecoPixelVertexing/PixelLowPtUtilities/src/LowPtClusterShapeSeedComparitor.cc @@ -123,7 +123,8 @@ bool LowPtClusterShapeSeedComparitor::compatible(const SeedingHitSet &hits) cons assert(hits.size()==3); const ClusterShapeHitFilter * filter = theShapeFilter.product(); - assert(filter != 0 && "LowPtClusterShapeSeedComparitor: init(EventSetup) method was not called"); + if(filter == 0) + throw cms::Exception("LogicError") << "LowPtClusterShapeSeedComparitor: init(EventSetup) method was not called"; // Get global positions GlobalPoint globalPoss[3]; From 52501d2e8259c99702ba96686af6b2e477c9e43d Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Mon, 28 Nov 2016 17:00:56 +0100 Subject: [PATCH 04/14] Add GlobalTrackingRegionEDProducer --- .../plugins/GlobalTrackingRegionProducer.h | 19 +++++++++++++++++++ .../TkTrackingRegions/plugins/SealModule.cc | 3 +++ 2 files changed, 22 insertions(+) diff --git a/RecoTracker/TkTrackingRegions/plugins/GlobalTrackingRegionProducer.h b/RecoTracker/TkTrackingRegions/plugins/GlobalTrackingRegionProducer.h index e80d199d94c6d..9098281a89ee8 100644 --- a/RecoTracker/TkTrackingRegions/plugins/GlobalTrackingRegionProducer.h +++ b/RecoTracker/TkTrackingRegions/plugins/GlobalTrackingRegionProducer.h @@ -27,6 +27,25 @@ class GlobalTrackingRegionProducer : public TrackingRegionProducer { virtual ~GlobalTrackingRegionProducer(){} + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + + desc.add("precise", true); + desc.add("useMultipleScattering", false); + desc.add("originHalfLength", 21.2); + desc.add("originRadius", 0.2); + desc.add("originXPos", 0.0); + desc.add("originYPos", 0.0); + desc.add("originZPos", 0.0); + desc.add("ptMin", 0.9); + + // Only for backwards-compatibility + edm::ParameterSetDescription descRegion; + descRegion.add("RegionPSet", desc); + + descriptions.add("globalTrackingRegion", descRegion); + } + virtual std::vector > regions(const edm::Event&, const edm::EventSetup&) const override { std::vector > result; result.push_back( diff --git a/RecoTracker/TkTrackingRegions/plugins/SealModule.cc b/RecoTracker/TkTrackingRegions/plugins/SealModule.cc index 310812a48b9cf..76a910b2fd539 100644 --- a/RecoTracker/TkTrackingRegions/plugins/SealModule.cc +++ b/RecoTracker/TkTrackingRegions/plugins/SealModule.cc @@ -17,6 +17,9 @@ DEFINE_EDM_PLUGIN(TrackingRegionProducerFactory, PointSeededTrackingRegionsProdu #include "RecoTracker/TkTrackingRegions/interface/TrackingRegionEDProducerT.h" +using GlobalTrackingRegionEDProducer = TrackingRegionEDProducerT; +DEFINE_FWK_MODULE(GlobalTrackingRegionEDProducer); + using GlobalTrackingRegionFromBeamSpotEDProducer = TrackingRegionEDProducerT; DEFINE_FWK_MODULE(GlobalTrackingRegionFromBeamSpotEDProducer); From a15a3c07b02c4ac0e934e91800f0acc50bb13d9b Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Mon, 28 Nov 2016 17:27:40 +0100 Subject: [PATCH 05/14] Make cluster multiplicity check optional in HitPairEDProducer Pixel tracking does not currently check cluster multiplicity --- .../TkHitPairs/plugins/HitPairEDProducer.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/RecoTracker/TkHitPairs/plugins/HitPairEDProducer.cc b/RecoTracker/TkHitPairs/plugins/HitPairEDProducer.cc index 69346b4e2c786..a9afb4d2a9780 100644 --- a/RecoTracker/TkHitPairs/plugins/HitPairEDProducer.cc +++ b/RecoTracker/TkHitPairs/plugins/HitPairEDProducer.cc @@ -257,8 +257,7 @@ namespace { HitPairEDProducer::HitPairEDProducer(const edm::ParameterSet& iConfig): seedingLayerToken_(consumes(iConfig.getParameter("seedingLayers"))), - regionToken_(consumes >(iConfig.getParameter("trackingRegions"))), - clusterCheckToken_(consumes(iConfig.getParameter("clusterCheck"))) + regionToken_(consumes >(iConfig.getParameter("trackingRegions"))) { const bool produceSeedingHitSets = iConfig.getParameter("produceSeedingHitSets"); const bool produceIntermediateHitDoublets = iConfig.getParameter("produceIntermediateHitDoublets"); @@ -272,6 +271,10 @@ HitPairEDProducer::HitPairEDProducer(const edm::ParameterSet& iConfig): else throw cms::Exception("Configuration") << "HitPairEDProducer requires either produceIntermediateHitDoublets or produceSeedingHitSets to be True. If neither are needed, just remove this module from your sequence/path as it doesn't do anything useful"; + auto clusterCheckTag = iConfig.getParameter("clusterCheck"); + if(clusterCheckTag.label() != "") + clusterCheckToken_ = consumes(clusterCheckTag); + impl_->produces(*this); } @@ -290,8 +293,12 @@ void HitPairEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip } void HitPairEDProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - edm::Handle hclusterCheck; - iEvent.getByToken(clusterCheckToken_, hclusterCheck); + bool clusterCheckOk = true; + if(!clusterCheckToken_.isUninitialized()) { + edm::Handle hclusterCheck; + iEvent.getByToken(clusterCheckToken_, hclusterCheck); + clusterCheckOk = *hclusterCheck; + } edm::Handle hlayers; iEvent.getByToken(seedingLayerToken_, hlayers); @@ -302,7 +309,7 @@ void HitPairEDProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetu edm::Handle > hregions; iEvent.getByToken(regionToken_, hregions); - impl_->produce(layers, *hregions, *hclusterCheck, iEvent, iSetup); + impl_->produce(layers, *hregions, clusterCheckOk, iEvent, iSetup); } #include "FWCore/PluginManager/interface/ModuleDef.h" From 6f54989abf4bc9b0972a8c6830cf33f41e6e3fc1 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Tue, 29 Nov 2016 14:19:29 +0100 Subject: [PATCH 06/14] Add HITrackingRegionForPrimaryVtxEDProducer --- .../HITrackingRegionForPrimaryVtxProducer.h | 28 +++++++++++++++++++ RecoHI/HiTracking/plugins/modules.cc | 4 +++ 2 files changed, 32 insertions(+) diff --git a/RecoHI/HiTracking/plugins/HITrackingRegionForPrimaryVtxProducer.h b/RecoHI/HiTracking/plugins/HITrackingRegionForPrimaryVtxProducer.h index 8bb4c8ccd69f2..c01a69492838c 100644 --- a/RecoHI/HiTracking/plugins/HITrackingRegionForPrimaryVtxProducer.h +++ b/RecoHI/HiTracking/plugins/HITrackingRegionForPrimaryVtxProducer.h @@ -56,6 +56,34 @@ class HITrackingRegionForPrimaryVtxProducer : public TrackingRegionProducer { } virtual ~HITrackingRegionForPrimaryVtxProducer(){} + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + + desc.add("ptMin", 0.7); + desc.add("doVariablePtMin", true); + desc.add("originRadius", 0.2); + desc.add("nSigmaZ", 3.0); + desc.add("beamSpot", edm::InputTag("offlineBeamSpot")); + desc.add("precise", true); + desc.add("useMultipleScattering", false); + desc.add("useFakeVertices", false); + desc.add("siPixelRecHits", edm::InputTag("siPixelRecHits")); + desc.add("directionXCoord", 1.0); + desc.add("directionYCoord", 1.0); + desc.add("directionZCoord", 0.0); + desc.add("useFoundVertices", true); + desc.add("VertexCollection", edm::InputTag("hiPixelClusterVertex")); + desc.add("useFixedError", true); + desc.add("fixedError", 3.0); + desc.add("sigmaZVertex", 3.0); + + // Only for backwards-compatibility + edm::ParameterSetDescription descRegion; + descRegion.add("RegionPSet", desc); + + descriptions.add("hiTrackingRegionFromClusterVtx", descRegion); + } int estimateMultiplicity (const edm::Event& ev, const edm::EventSetup& es) const diff --git a/RecoHI/HiTracking/plugins/modules.cc b/RecoHI/HiTracking/plugins/modules.cc index 6fd86feae9b8e..e87c86d5da269 100644 --- a/RecoHI/HiTracking/plugins/modules.cc +++ b/RecoHI/HiTracking/plugins/modules.cc @@ -23,3 +23,7 @@ DEFINE_EDM_PLUGIN(TrackingRegionProducerFactory, HITrackingRegionProducer, "HITr #include "HITrackingRegionForPrimaryVtxProducer.h" DEFINE_EDM_PLUGIN(TrackingRegionProducerFactory, HITrackingRegionForPrimaryVtxProducer, "HITrackingRegionForPrimaryVtxProducer"); + +#include "RecoTracker/TkTrackingRegions/interface/TrackingRegionEDProducerT.h" +using HITrackingRegionForPrimaryVtxEDProducer = TrackingRegionEDProducerT; +DEFINE_FWK_MODULE(HITrackingRegionForPrimaryVtxEDProducer); From 43aeb023803d613c15ba87a75cd476a47d5ebd32 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Wed, 30 Nov 2016 15:32:14 +0100 Subject: [PATCH 07/14] Add CandidateSeededTrackingRegionsEDProducer --- .../python/customizeHLTforCMSSW.py | 2 ++ .../CandidateSeededTrackingRegionsProducer.h | 34 +++++++++++++++++++ RecoTauTag/HLTProducers/src/SealModule.cc | 2 ++ 3 files changed, 38 insertions(+) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index 2383618ccddd4..9b26e9494a31c 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -166,6 +166,7 @@ def customiseFor17170(process): from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cfi import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices from RecoTauTag.HLTProducers.tauRegionalPixelSeedTrackingRegions_cfi import tauRegionalPixelSeedTrackingRegions as _tauRegionalPixelSeedTrackingRegions + from RecoTauTag.HLTProducers.seededTrackingRegionsFromBeamSpotFixedZLength_cfi import seededTrackingRegionsFromBeamSpotFixedZLength as _seededTrackingRegionsFromBeamSpotFixedZLength from RecoTracker.TkSeedGenerator.trackerClusterCheck_cfi import trackerClusterCheck as _trackerClusterCheck @@ -209,6 +210,7 @@ def _copy(old, new, skip=[]): "GlobalRegionProducerFromBeamSpot": _globalTrackingRegionFromBeamSpot, "GlobalTrackingRegionWithVerticesProducer": _globalTrackingRegionWithVertices, "TauRegionalPixelSeedGenerator": _tauRegionalPixelSeedTrackingRegions, + "CandidateSeededTrackingRegionsProducer": _seededTrackingRegionsFromBeamSpotFixedZLength, }.get(producer.RegionFactoryPSet.ComponentName.value(), None) if regionProducer is None: # got a region not migrated yet #print "skipping", label, producer.RegionFactoryPSet.ComponentName.value() diff --git a/RecoTauTag/HLTProducers/src/CandidateSeededTrackingRegionsProducer.h b/RecoTauTag/HLTProducers/src/CandidateSeededTrackingRegionsProducer.h index 015d578ac0eb6..fcb8841f9c8dc 100644 --- a/RecoTauTag/HLTProducers/src/CandidateSeededTrackingRegionsProducer.h +++ b/RecoTauTag/HLTProducers/src/CandidateSeededTrackingRegionsProducer.h @@ -99,6 +99,40 @@ class CandidateSeededTrackingRegionsProducer : public TrackingRegionProducer virtual ~CandidateSeededTrackingRegionsProducer() {} + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + + desc.add("mode", "BeamSpotFixed"); + + desc.add("input", edm::InputTag("")); + desc.add("maxNRegions", 10); + desc.add("beamSpot", edm::InputTag("hltOnlineBeamSpot")); + desc.add("vertexCollection", edm::InputTag("hltPixelVertices")); + desc.add("maxNVertices", 1); + + desc.add("ptMin", 0.9); + desc.add("originRadius", 0.2); + desc.add("zErrorBeamSpot", 24.2); + desc.add("deltaEta", 0.5); + desc.add("deltaPhi", 0.5); + desc.add("precise", true); + + desc.add("nSigmaZVertex", 3.); + desc.add("zErrorVetex", 0.2); + desc.add("nSigmaZBeamSpot", 4.); + + desc.add("whereToUseMeasurementTracker", "ForSiStrips"); + desc.add("measurementTrackerName", edm::InputTag("")); + + desc.add("searchOpt", false); + + // Only for backwards-compatibility + edm::ParameterSetDescription descRegion; + descRegion.add("RegionPSet", desc); + + descriptions.add("seededTrackingRegionsFromBeamSpotFixedZLength", descRegion); + } + virtual std::vector > regions(const edm::Event& e, const edm::EventSetup& es) const override { diff --git a/RecoTauTag/HLTProducers/src/SealModule.cc b/RecoTauTag/HLTProducers/src/SealModule.cc index 22830514ade9e..6da1d7c16b5f1 100644 --- a/RecoTauTag/HLTProducers/src/SealModule.cc +++ b/RecoTauTag/HLTProducers/src/SealModule.cc @@ -27,6 +27,8 @@ DEFINE_EDM_PLUGIN(TrackingRegionProducerFactory, CandidateSeededTrackingRegionsP #include "RecoTracker/TkTrackingRegions/interface/TrackingRegionEDProducerT.h" using TauRegionalPixelSeedTrackingRegionEDProducer = TrackingRegionEDProducerT; DEFINE_FWK_MODULE(TauRegionalPixelSeedTrackingRegionEDProducer); +using CandidateSeededTrackingRegionsEDProducer = TrackingRegionEDProducerT; +DEFINE_FWK_MODULE(CandidateSeededTrackingRegionsEDProducer); DEFINE_FWK_MODULE(L2TauJetsMerger); DEFINE_FWK_MODULE(L1HLTJetsMatching); From a5ae39bd3dc08a2d0d78478d5617bebcdc74b9b0 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Thu, 1 Dec 2016 12:22:49 +0100 Subject: [PATCH 08/14] Make PixelQuadrupletMergerEDProducer to work with PixelTrackProducer --- .../PixelQuadrupletMergerEDProducer.cc | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/RecoPixelVertexing/PixelTriplets/plugins/PixelQuadrupletMergerEDProducer.cc b/RecoPixelVertexing/PixelTriplets/plugins/PixelQuadrupletMergerEDProducer.cc index ded62ac0c7ca9..01ee9dffecdb4 100644 --- a/RecoPixelVertexing/PixelTriplets/plugins/PixelQuadrupletMergerEDProducer.cc +++ b/RecoPixelVertexing/PixelTriplets/plugins/PixelQuadrupletMergerEDProducer.cc @@ -56,7 +56,8 @@ PixelQuadrupletMergerEDProducer::PixelQuadrupletMergerEDProducer(const edm::Para edm::ParameterSet creatorPSet = iConfig.getParameter("SeedCreatorPSet"); std::string creatorName = creatorPSet.getParameter("ComponentName"); - seedCreator_.reset(SeedCreatorFactory::get()->create( creatorName, creatorPSet)); + if(creatorName != "none") // pixel tracking does not use seed creator + seedCreator_.reset(SeedCreatorFactory::get()->create( creatorName, creatorPSet)); produces(); produces(); // need to keep these in memory because TrajectorySeed owns its RecHits @@ -83,6 +84,7 @@ void PixelQuadrupletMergerEDProducer::fillDescriptions(edm::ConfigurationDescrip descComparitor.setAllowAnything(); desc.add("SeedComparitorPSet", descComparitor); edm::ParameterSetDescription descCreator; + descCreator.add("ComponentName", "none"); descCreator.setAllowAnything(); desc.add("SeedCreatorPSet", descCreator); @@ -122,23 +124,30 @@ void PixelQuadrupletMergerEDProducer::produce(edm::Event& iEvent, const edm::Eve // Keeping same resuls has been made really difficult... + // Especially when supporting both pixel tracking and seeding // Following is from SeedGeneratorFromRegionHits - seedCreator_->init(region, iSetup, comparitor_.get()); - for(const auto& hits: regionSeedingHitSets) { - if(!comparitor_ || comparitor_->compatible(hits)) { - seedCreator_->makeSeed(*tmpSeedCollection, hits); + if(seedCreator_) { + seedCreator_->init(region, iSetup, comparitor_.get()); + for(const auto& hits: regionSeedingHitSets) { + if(!comparitor_ || comparitor_->compatible(hits)) { + seedCreator_->makeSeed(*tmpSeedCollection, hits); + } } - } - - // then convert seeds back to hits - // awful, but hopefully only temporary to preserve old results + // then convert seeds back to hits + // awful, but hopefully only temporary to preserve old results for(const auto& seed: *tmpSeedCollection) { - auto hitRange = seed.recHits(); - assert(std::distance(hitRange.first, hitRange.second) == 3); - tripletsPerRegion.emplace_back(static_cast(&*(hitRange.first)), - static_cast(&*(hitRange.first+1)), - static_cast(&*(hitRange.first+2))); + auto hitRange = seed.recHits(); + assert(std::distance(hitRange.first, hitRange.second) == 3); + tripletsPerRegion.emplace_back(static_cast(&*(hitRange.first)), + static_cast(&*(hitRange.first+1)), + static_cast(&*(hitRange.first+2))); + } + } + else { + for(const auto& hits: regionSeedingHitSets) { + tripletsPerRegion.emplace_back(hits[0], hits[1], hits[2]); + } } LogTrace("PixelQuadrupletEDProducer") << " starting region, number of triplets " << tripletsPerRegion.size(); From b2242d4c70801ec533582fef7174803218f0ae00 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Mon, 28 Nov 2016 15:02:26 +0100 Subject: [PATCH 09/14] Migrate PixelTrackProducer to the new seeding framework --- .../IsolatedParticles/python/isoTrack_cff.py | 122 ++++++++++-------- .../clients/beam_dqm_sourceclient-live_cfg.py | 30 ++++- .../beampixel_dqm_sourceclient-live_cfg.py | 28 +++- .../sistrip_dqm_sourceclient-live_cfg.py | 2 +- .../python/HILowPtConformalPixelTracks_cfi.py | 41 +++--- .../python/HIPixel3PrimTracks_cfi.py | 41 +++--- .../python/HIPixel3ProtoTracks_cfi.py | 38 +++--- .../python/HIPixelVerticesPreSplitting_cff.py | 24 +++- .../python/HITrackingRegionProducer_cfi.py | 27 +--- .../python/LowPtTracking_PbPb_cff.py | 4 +- .../python/hiDetachedTripletStep_cff.py | 71 +++++----- .../python/hiLowPtTripletStep_cff.py | 70 +++++----- RecoMuon/L3MuonProducer/test/newL3.py | 94 ++++++-------- .../interface/PixelTrackReconstruction.h | 14 +- .../plugins/PixelTrackProducer.cc | 12 +- .../plugins/PixelTrackProducer.h | 5 +- .../python/PixelTrackReconstruction_cfi.py | 56 -------- .../python/PixelTracks_cff.py | 67 +++++++++- .../python/PixelTracks_cfi.py | 10 -- .../src/PixelTrackReconstruction.cc | 65 +++------- .../PixelTriplets/test/trip_cfg.py | 1 - 21 files changed, 415 insertions(+), 407 deletions(-) delete mode 100644 RecoPixelVertexing/PixelTrackFitting/python/PixelTrackReconstruction_cfi.py delete mode 100644 RecoPixelVertexing/PixelTrackFitting/python/PixelTracks_cfi.py diff --git a/Calibration/IsolatedParticles/python/isoTrack_cff.py b/Calibration/IsolatedParticles/python/isoTrack_cff.py index 54c319aacea98..e4e1e5c57be24 100644 --- a/Calibration/IsolatedParticles/python/isoTrack_cff.py +++ b/Calibration/IsolatedParticles/python/isoTrack_cff.py @@ -4,6 +4,39 @@ L1GtReadoutRecordTag = cms.InputTag( "hltGtDigis" ), offset = cms.uint32( 0 ) ) +hltHITPixelTracksHBTrackingRegions = cms.EDProducer("GlobalTrackingRegionFromBeamSpotEDProducer", + RegionPSet = cms.PSet( + precise = cms.bool( True ), + originRadius = cms.double( 0.0015 ), + nSigmaZ = cms.double( 3.0 ), + ptMin = cms.double( 0.7 ), + beamSpot = cms.InputTag( "hltOnlineBeamSpot" ) + ) +) +hltHITPixelTracksHBHitDoublets = cms.EDProducer("HitPairEDProducer", + clusterCheck = cms.InputTag(""), + layerPairs = cms.vuint32(0), + maxElement = cms.uint32(0), + produceIntermediateHitDoublets = cms.bool(True), + produceSeedingHitSets = cms.bool(False), + seedingLayers = cms.InputTag("hltESPPixelLayerTripletsHITHB"), + trackingRegions = cms.InputTag("hltHITPixelTracksHBTrackingRegions") +) +hltHITPixelTracksHBHitTriplets = cms.EDProducer("PixelTripletHLTEDProducer", + SeedComparitorPSet = cms.PSet( + ComponentName = cms.string("none"), + ), + doublets = cms.InputTag("hltHITPixelTracksHBHitDoublets"), + extraHitRPhitolerance = cms.double(0.06), + extraHitRZtolerance = cms.double(0.06), + maxElement = cms.uint32(100000), + phiPreFiltering = cms.double(0.3), + produceIntermediateHitTriplets = cms.bool(False), + produceSeedingHitSets = cms.bool(True), + useBending = cms.bool(True), + useFixedPreFiltering = cms.bool(False), + useMultScattering = cms.bool(True) +) hltHITPixelTracksHBFitter = cms.EDProducer("PixelFitterByConformalMappingAndLineProducer", TTRHBuilder = cms.string( "hltESPTTRHBuilderPixelOnly" ), useFixImpactParameter = cms.bool(True), @@ -24,34 +57,43 @@ Filter = cms.InputTag("hltHITPixelTracksHBFilter"), passLabel = cms.string( "Pixel triplet primary tracks with vertex constraint" ), Fitter = cms.InputTag("hltHITPixelTracksHBFitter"), - RegionFactoryPSet = cms.PSet( - ComponentName = cms.string( "GlobalRegionProducerFromBeamSpot" ), - RegionPSet = cms.PSet( - precise = cms.bool( True ), - originRadius = cms.double( 0.0015 ), - nSigmaZ = cms.double( 3.0 ), - ptMin = cms.double( 0.7 ), - beamSpot = cms.InputTag( "hltOnlineBeamSpot" ) - ) - ), Cleaner = cms.string("hltHITPixelTracksCleaner"), - OrderedHitsFactoryPSet = cms.PSet( - ComponentName = cms.string( "StandardHitTripletGenerator" ), - SeedingLayers = cms.string( "hltESPPixelLayerTripletsHITHB" ), - GeneratorPSet = cms.PSet( - useBending = cms.bool( True ), - useFixedPreFiltering = cms.bool( False ), - maxElement = cms.uint32( 100000 ), - phiPreFiltering = cms.double( 0.3 ), - extraHitRPhitolerance = cms.double( 0.06 ), - useMultScattering = cms.bool( True ), - ComponentName = cms.string( "PixelTripletHLTGenerator" ), - extraHitRZtolerance = cms.double( 0.06 ), - SeedComparitorPSet = cms.PSet( ComponentName = cms.string( "none" ) ) - ) - ) + SeedingHitSets = cms.InputTag("hltHITPixelTracksHBHitTriplets"), ) +hltHITPixelTracksHETrackingRegions = cms.EDProducer("GlobalTrackingRegionFromBeamSpotEDProducer", + RegionPSet = cms.PSet( + precise = cms.bool( True ), + originRadius = cms.double( 0.0015 ), + nSigmaZ = cms.double( 3.0 ), + beamSpot = cms.InputTag( "hltOnlineBeamSpot" ), + ptMin = cms.double( 0.35 ) + ) +) +hltHITPixelTracksHEHitDoublets = cms.EDProducer("HitPairEDProducer", + clusterCheck = cms.InputTag(""), + layerPairs = cms.vuint32(0), + maxElement = cms.uint32(0), + produceIntermediateHitDoublets = cms.bool(True), + produceSeedingHitSets = cms.bool(False), + seedingLayers = cms.InputTag("hltESPPixelLayerTripletsHITHE"), + trackingRegions = cms.InputTag("hltHITPixelTracksHBTrackingRegions") +) +hltHITPixelTracksHEHitTriplets = cms.EDProducer("PixelTripletHLTEDProducer", + SeedComparitorPSet = cms.PSet( + ComponentName = cms.string("none"), + ), + doublets = cms.InputTag("hltHITPixelTracksHEHitDoublets"), + extraHitRPhitolerance = cms.double(0.06), + extraHitRZtolerance = cms.double(0.06), + maxElement = cms.uint32(100000), + phiPreFiltering = cms.double(0.3), + produceIntermediateHitTriplets = cms.bool(False), + produceSeedingHitSets = cms.bool(True), + useBending = cms.bool(True), + useFixedPreFiltering = cms.bool(False), + useMultScattering = cms.bool(True) +) hltHITPixelTracksHEFitter = cms.EDProducer("PixelFitterByConformalMappingAndLineProducer", TTRHBuilder = cms.string( "hltESPTTRHBuilderPixelOnly" ), useFixImpactParameter = cms.bool(True), @@ -68,35 +110,11 @@ Filter = cms.InputTag("hltHITPixelTracksHEFilter"), passLabel = cms.string( "Pixel triplet primary tracks with vertex constraint" ), Fitter = cms.InputTag("hltHITPixelTracksHEFitter"), - RegionFactoryPSet = cms.PSet( - ComponentName = cms.string( "GlobalRegionProducerFromBeamSpot" ), - RegionPSet = cms.PSet( - precise = cms.bool( True ), - originRadius = cms.double( 0.0015 ), - nSigmaZ = cms.double( 3.0 ), - beamSpot = cms.InputTag( "hltOnlineBeamSpot" ), - ptMin = cms.double( 0.35 ) - ) - ), CleanerPSet = cms.PSet( ComponentName = cms.string( "PixelTrackCleanerBySharedHits" ), useQuadrupletAlgo = cms.bool(False) ), - OrderedHitsFactoryPSet = cms.PSet( - 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.06 ), - useMultScattering = cms.bool( True ), - ComponentName = cms.string( "PixelTripletHLTGenerator" ), - extraHitRZtolerance = cms.double( 0.06 ), - SeedComparitorPSet = cms.PSet( ComponentName = cms.string( "none" ) ) - ), - SeedingLayers = cms.string( "hltESPPixelLayerTripletsHITHE" ) - ) + SeedingHitSets = cms.InputTag("hltHITPixelTracksHEHitTriplets"), ) hltHITPixelVerticesHE = cms.EDProducer("PixelVertexProducer", @@ -430,7 +448,7 @@ saveTags = cms.bool( False ) ) -HLT_IsoTrackHE_v15 = cms.Path( HLTBeginSequence + hltL1sV0SingleJet60 + hltPreIsoTrackHE + HLTDoLocalPixelSequence + hltHITPixelTracksHBFitter + hltHITPixelTracksHBFilter + hltHITPixelTracksHEFitter + hltHITPixelTracksHEFilter + hltHITPixelTracksHB + hltHITPixelTracksHE + hltHITPixelVerticesHE + hltIsolPixelTrackProdHE + hltIsolPixelTrackL2FilterHE + HLTDoLocalStripSequence + hltHITPixelTripletSeedGeneratorHE + hltHITCkfTrackCandidatesHE + hltHITCtfWithMaterialTracksHE + hltHITIPTCorrectorHE + hltIsolPixelTrackL3FilterHE + HLTEndSequence ) +HLT_IsoTrackHE_v15 = cms.Path( HLTBeginSequence + hltL1sV0SingleJet60 + hltPreIsoTrackHE + HLTDoLocalPixelSequence + hltHITPixelTracksHBTrackingRegions + hltHITPixelTracksHBHitDoublets + hltHITPixelTracksHBHitTriplets + hltHITPixelTracksHBFitter + hltHITPixelTracksHBFilter + hltHITPixelTracksHEFitter + hltHITPixelTracksHEFilter + hltHITPixelTracksHB + hltHITPixelTracksHBTrackingRegions + hltHITPixelTracksHBHitDoublets + hltHITPixelTracksHBHitTriplets + hltHITPixelTracksHE + hltHITPixelVerticesHE + hltIsolPixelTrackProdHE + hltIsolPixelTrackL2FilterHE + HLTDoLocalStripSequence + hltHITPixelTripletSeedGeneratorHE + hltHITCkfTrackCandidatesHE + hltHITCtfWithMaterialTracksHE + hltHITIPTCorrectorHE + hltIsolPixelTrackL3FilterHE + HLTEndSequence ) -HLT_IsoTrackHB_v14 = cms.Path( HLTBeginSequence + hltL1sV0SingleJet60 + hltPreIsoTrackHB + HLTDoLocalPixelSequence + hltHITPixelTracksHBFitter + hltHITPixelTracksHBFilter + hltHITPixelTracksHB + hltHITPixelVerticesHB + hltIsolPixelTrackProdHB + hltIsolPixelTrackL2FilterHB + HLTDoLocalStripSequence + hltHITPixelTripletSeedGeneratorHB + hltHITCkfTrackCandidatesHB + hltHITCtfWithMaterialTracksHB + hltHITIPTCorrectorHB + hltIsolPixelTrackL3FilterHB + HLTEndSequence ) +HLT_IsoTrackHB_v14 = cms.Path( HLTBeginSequence + hltL1sV0SingleJet60 + hltPreIsoTrackHB + HLTDoLocalPixelSequence + hltHITPixelTracksHBTrackingRegions + hltHITPixelTracksHBHitDoublets + hltHITPixelTracksHBHitTriplets + hltHITPixelTracksHBFitter + hltHITPixelTracksHBFilter + hltHITPixelTracksHB + hltHITPixelVerticesHB + hltIsolPixelTrackProdHB + hltIsolPixelTrackL2FilterHB + HLTDoLocalStripSequence + hltHITPixelTripletSeedGeneratorHB + hltHITCkfTrackCandidatesHB + hltHITCtfWithMaterialTracksHB + hltHITIPTCorrectorHB + hltIsolPixelTrackL3FilterHB + HLTEndSequence ) diff --git a/DQM/Integration/python/clients/beam_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/beam_dqm_sourceclient-live_cfg.py index dac2ba8b9fbe5..595e2e118bdbc 100644 --- a/DQM/Integration/python/clients/beam_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/beam_dqm_sourceclient-live_cfg.py @@ -188,6 +188,8 @@ process.InitialStepPreSplitting.remove(process.siPixelRecHits) process.InitialStepPreSplitting.remove(process.MeasurementTrackerEvent) process.InitialStepPreSplitting.remove(process.siPixelClusterShapeCache) + # 2016-11-28 MK FIXME: I suppose I should migrate the lines below following the "new seeding framework" + # # if z is very far due to bad fit process.initialStepSeedsPreSplitting.RegionFactoryPSet.RegionPSet.originRadius = 1.5 process.initialStepSeedsPreSplitting.RegionFactoryPSet.RegionPSet.originHalfLength = cms.double(30.0) @@ -213,12 +215,27 @@ else: # pixel tracking print "[beam_dqm_sourceclient-live_cfg]:: pixelTracking" #pixel track/vertices reco - from RecoTracker.TkTrackingRegions.GlobalTrackingRegion_cfi import * - process.RegionPSetBlock.RegionPSet.originRadius = cms.double(0.4) - process.load("RecoPixelVertexing.Configuration.RecoPixelVertexing_cff") - process.PixelTrackReconstructionBlock.RegionFactoryPSet = cms.PSet(RegionPSetBlock, ComponentName = cms.string("GlobalTrackingRegion")) - process.pixelVertices.TkFilterParameters.minPt = process.pixelTracks.RegionFactoryPSet.RegionPSet.ptMin + from RecoPixelVertexing.PixelTrackFitting.PixelTracks_cff import * + from RecoTracker.TkTrackingRegions.globalTrackingRegion_cfi import * + new = globalTrackingRegion.clone() + def _copy(old, new, skip=[]): + skipSet = set(skip) + for key in old.parameterNames_(): + if key not in skipSet: + setattr(new, key, getattr(old, key)) + _copy(process.pixelTracksTrackingRegions, new, skip=["nSigmaZ", "beamSpot"]) + new.RegionPSet.originRadius = 0.4 + # Bit of a hack to replace a module with another, but works + # + # With the naive + # process.pixelTracksTrackingRegions = glovalTrackingRegion.clone() + # the configuration system complains that pixelTracksTrackingRegions is already being used in recopixelvertexing sequence + modifier = cms.Modifier() + modifier._setChosen() + modifier.toReplaceWith(process.pixelTracksTrackingRegions, new) + + process.pixelVertices.TkFilterParameters.minPt = process.pixelTracksTrackingRegions.RegionPSet.ptMin process.dqmBeamMonitor.PVFitter.errorScale = 1.22 #keep checking this with new release expected close to 1.2 @@ -226,8 +243,7 @@ from RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi import * process.PixelLayerTriplets.BPix.HitProducer = cms.string('siPixelRecHitsPreSplitting') process.PixelLayerTriplets.FPix.HitProducer = cms.string('siPixelRecHitsPreSplitting') - from RecoPixelVertexing.PixelTrackFitting.PixelTracks_cff import * - process.pixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet.clusterShapeCacheSrc = cms.InputTag('siPixelClusterShapeCachePreSplitting') + process.pixelTracksHitTriplets.SeedComparitorPSet.clusterShapeCacheSrc = 'siPixelClusterShapeCachePreSplitting' process.tracking_FirstStep = cms.Sequence(process.siPixelDigis* process.offlineBeamSpot* diff --git a/DQM/Integration/python/clients/beampixel_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/beampixel_dqm_sourceclient-live_cfg.py index 94c76e54b8d78..afdcd310e891a 100644 --- a/DQM/Integration/python/clients/beampixel_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/beampixel_dqm_sourceclient-live_cfg.py @@ -115,19 +115,33 @@ #---------------------------- # Pixel-Tracks&Vertices Config #---------------------------- - from RecoTracker.TkTrackingRegions.GlobalTrackingRegion_cfi import * - process.RegionPSetBlock.RegionPSet.originRadius = cms.double(0.4) - process.load("RecoPixelVertexing.Configuration.RecoPixelVertexing_cff") - process.PixelTrackReconstructionBlock.RegionFactoryPSet = cms.PSet(RegionPSetBlock, ComponentName = cms.string("GlobalTrackingRegion")) - process.pixelVertices.TkFilterParameters.minPt = process.pixelTracks.RegionFactoryPSet.RegionPSet.ptMin + from RecoPixelVertexing.PixelTrackFitting.PixelTracks_cff import * + from RecoTracker.TkTrackingRegions.globalTrackingRegion_cfi import * + new = globalTrackingRegion.clone() + def _copy(old, new, skip=[]): + skipSet = set(skip) + for key in old.parameterNames_(): + if key not in skipSet: + setattr(new, key, getattr(old, key)) + _copy(process.pixelTracksTrackingRegions, new, skip=["nSigmaZ", "beamSpot"]) + new.RegionPSet.originRadius = 0.4 + # Bit of a hack to replace a module with another, but works + # + # With the naive + # process.pixelTracksTrackingRegions = glovalTrackingRegion.clone() + # the configuration system complains that pixelTracksTrackingRegions is already being used in recopixelvertexing sequence + modifier = cms.Modifier() + modifier._setChosen() + modifier.toReplaceWith(process.pixelTracksTrackingRegions, new) + + process.pixelVertices.TkFilterParameters.minPt = process.pixelTracksTrackingRegions.RegionPSet.ptMin from RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi import * process.PixelLayerTriplets.BPix.HitProducer = cms.string("siPixelRecHitsPreSplitting") process.PixelLayerTriplets.FPix.HitProducer = cms.string("siPixelRecHitsPreSplitting") - from RecoPixelVertexing.PixelTrackFitting.PixelTracks_cff import * - process.pixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet.clusterShapeCacheSrc = cms.InputTag("siPixelClusterShapeCachePreSplitting") + process.pixelTracksHitTriplets.SeedComparitorPSet.clusterShapeCacheSrc = "siPixelClusterShapeCachePreSplitting" #---------------------------- diff --git a/DQM/Integration/python/clients/sistrip_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/sistrip_dqm_sourceclient-live_cfg.py index f9ecbeb8d89ea..1cd8f511e035e 100644 --- a/DQM/Integration/python/clients/sistrip_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/sistrip_dqm_sourceclient-live_cfg.py @@ -355,7 +355,7 @@ process.PixelLayerTriplets.BPix.HitProducer = cms.string('siPixelRecHitsPreSplitting') process.PixelLayerTriplets.FPix.HitProducer = cms.string('siPixelRecHitsPreSplitting') from RecoPixelVertexing.PixelTrackFitting.PixelTracks_cff import * - process.pixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet.clusterShapeCacheSrc = cms.InputTag('siPixelClusterShapeCachePreSplitting') + process.pixelTracksHitTriplets.SeedComparitorPSet.clusterShapeCacheSrc = 'siPixelClusterShapeCachePreSplitting' process.RecoForDQM_TrkReco = cms.Sequence(process.offlineBeamSpot*process.MeasurementTrackerEventPreSplitting*process.siPixelClusterShapeCachePreSplitting*process.recopixelvertexing*process.InitialStepPreSplitting) diff --git a/RecoHI/HiTracking/python/HILowPtConformalPixelTracks_cfi.py b/RecoHI/HiTracking/python/HILowPtConformalPixelTracks_cfi.py index e311775dae108..d6b77b3e086b8 100644 --- a/RecoHI/HiTracking/python/HILowPtConformalPixelTracks_cfi.py +++ b/RecoHI/HiTracking/python/HILowPtConformalPixelTracks_cfi.py @@ -1,32 +1,35 @@ import FWCore.ParameterSet.Config as cms -from RecoPixelVertexing.PixelTriplets.PixelTripletHLTGenerator_cfi import * +from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer +from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import * from RecoPixelVertexing.PixelLowPtUtilities.trackCleaner_cfi import * from RecoPixelVertexing.PixelTrackFitting.pixelFitterByConformalMappingAndLine_cfi import * from RecoHI.HiTracking.HIPixelTrackFilter_cff import * from RecoHI.HiTracking.HITrackingRegionProducer_cfi import * +# Hit ntuplets +hiConformalPixelTracksHitDoublets = _hitPairEDProducer.clone( + clusterCheck = "", + seedingLayers = "PixelLayerTriplets", + trackingRegions = "hiTrackingRegionWithVertex", + maxElement = 0, + produceIntermediateHitDoublets = True, +) + +hiConformalPixelTracksHitTriplets = _pixelTripletHLTEDProducer.clone( + doublets = "hiConformalPixelTracksHitDoublets", + maxElement = 5000000, # increase threshold for triplets in generation step (default: 100000) + produceSeedingHitSets = True, +) + +# Pixel tracks hiConformalPixelTracks = cms.EDProducer("PixelTrackProducer", #passLabel = cms.string('Pixel triplet low-pt tracks with vertex constraint'), - # Region - RegionFactoryPSet = cms.PSet( - ComponentName = cms.string("GlobalTrackingRegionWithVerticesProducer"), - RegionPSet = cms.PSet( - HiLowPtTrackingRegionWithVertexBlock - ) - ), - # Ordered Hits - OrderedHitsFactoryPSet = cms.PSet( - ComponentName = cms.string( "StandardHitTripletGenerator" ), - SeedingLayers = cms.InputTag( "PixelLayerTriplets" ), - GeneratorPSet = cms.PSet( - PixelTripletHLTGenerator - ) - ), + SeedingHitSets = cms.InputTag("hiConformalPixelTracksHitTriplets"), # Fitter Fitter = cms.InputTag('pixelFitterByConformalMappingAndLine'), @@ -38,10 +41,10 @@ Cleaner = cms.string("trackCleaner") ) -# increase threshold for triplets in generation step (default: 10000) -hiConformalPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = 5000000 - hiConformalPixelTracksSequence = cms.Sequence( + hiTrackingRegionWithVertex + + hiConformalPixelTracksHitDoublets + + hiConformalPixelTracksHitTriplets + pixelFitterByConformalMappingAndLine + hiConformalPixelFilter + hiConformalPixelTracks diff --git a/RecoHI/HiTracking/python/HIPixel3PrimTracks_cfi.py b/RecoHI/HiTracking/python/HIPixel3PrimTracks_cfi.py index 8b97a649393d0..21f0d78aafefe 100644 --- a/RecoHI/HiTracking/python/HIPixel3PrimTracks_cfi.py +++ b/RecoHI/HiTracking/python/HIPixel3PrimTracks_cfi.py @@ -1,6 +1,7 @@ import FWCore.ParameterSet.Config as cms -from RecoPixelVertexing.PixelTriplets.PixelTripletHLTGenerator_cfi import * +from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer +from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import * from RecoPixelVertexing.PixelLowPtUtilities.trackCleaner_cfi import * from RecoPixelVertexing.PixelTrackFitting.pixelFitterByHelixProjections_cfi import * @@ -8,26 +9,28 @@ from RecoHI.HiTracking.HITrackingRegionProducer_cfi import * from RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi import * +# Hit ntuplets +hiPixel3PrimTracksHitDoublets = _hitPairEDProducer.clone( + clusterCheck = "", + seedingLayers = "PixelLayerTriplets", + trackingRegions = "hiTrackingRegionWithVertex", + maxElement = 0, + produceIntermediateHitDoublets = True, +) + +hiPixel3PrimTracksHitTriplets = _pixelTripletHLTEDProducer.clone( + doublets = "hiPixel3PrimTracksHitDoublets", + maxElement = 1000000, # increase threshold for triplets in generation step (default: 100000) + produceSeedingHitSets = True, +) + +# Pixel tracks hiPixel3PrimTracks = cms.EDProducer("PixelTrackProducer", passLabel = cms.string('Pixel triplet primary tracks with vertex constraint'), - # Region - RegionFactoryPSet = cms.PSet( - ComponentName = cms.string("GlobalTrackingRegionWithVerticesProducer"), - RegionPSet = cms.PSet( - HiTrackingRegionWithVertexBlock - ) - ), - # Ordered Hits - OrderedHitsFactoryPSet = cms.PSet( - ComponentName = cms.string( "StandardHitTripletGenerator" ), - SeedingLayers = cms.InputTag( "PixelLayerTriplets" ), - GeneratorPSet = cms.PSet( - PixelTripletHLTGenerator - ) - ), + SeedingHitSets = cms.InputTag("hiPixel3PrimTracksHitTriplets"), # Fitter Fitter = cms.InputTag("pixelFitterByHelixProjections"), @@ -39,10 +42,10 @@ Cleaner = cms.string("trackCleaner") ) -# increase threshold for triplets in generation step (default: 10000) -hiPixel3PrimTracks.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = 1000000 - hiPixel3PrimTracksSequence = cms.Sequence( + hiTrackingRegionWithVertex + + hiPixel3PrimTracksHitDoublets + + hiPixel3PrimTracksHitTriplets + pixelFitterByHelixProjections + hiFilter + hiPixel3PrimTracks diff --git a/RecoHI/HiTracking/python/HIPixel3ProtoTracks_cfi.py b/RecoHI/HiTracking/python/HIPixel3ProtoTracks_cfi.py index 5bfa6c5e0cc90..953933cd42834 100644 --- a/RecoHI/HiTracking/python/HIPixel3ProtoTracks_cfi.py +++ b/RecoHI/HiTracking/python/HIPixel3ProtoTracks_cfi.py @@ -1,5 +1,7 @@ import FWCore.ParameterSet.Config as cms +from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer +from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer from RecoPixelVertexing.PixelTriplets.PixelTripletHLTGenerator_cfi import * from RecoPixelVertexing.PixelTrackFitting.pixelFitterByHelixProjections_cfi import * from RecoPixelVertexing.PixelTrackFitting.pixelTrackCleanerBySharedHits_cfi import * @@ -7,27 +9,28 @@ from RecoHI.HiTracking.HITrackingRegionProducer_cfi import * from RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi import * +# Hit ntuplets +hiPixel3ProtoTracksHitDoublets = _hitPairEDProducer.clone( + clusterCheck = "", + seedingLayers = "PixelLayerTriplets", + trackingRegions = "hiTrackingRegionFromClusterVtx", + maxElement = 0, + produceIntermediateHitDoublets = True, +) + +hiPixel3ProtoTracksHitTriplets = _pixelTripletHLTEDProducer.clone( + doublets = "hiPixel3ProtoTracksHitDoublets", + maxElement = 100000, + produceSeedingHitSets = True, +) + +# Pixel tracks hiPixel3ProtoTracks = cms.EDProducer( "PixelTrackProducer", passLabel = cms.string('Pixel triplet tracks for vertexing'), - # Region - RegionFactoryPSet = cms.PSet( - ComponentName = cms.string( "HITrackingRegionForPrimaryVtxProducer" ), - RegionPSet = cms.PSet( - #HiTrackingRegionForPrimaryVertexBlock - HiTrackingRegionFromClusterVtxBlock - ) - ), - # Ordered Hits - OrderedHitsFactoryPSet = cms.PSet( - ComponentName = cms.string( "StandardHitTripletGenerator" ), - SeedingLayers = cms.InputTag( "PixelLayerTriplets" ), - GeneratorPSet = cms.PSet( - PixelTripletHLTGenerator - ) - ), + SeedingHitSets = cms.InputTag("hiPixel3ProtoTracksHitTriplets"), # Fitter Fitter = cms.InputTag("pixelFitterByHelixProjections"), @@ -40,6 +43,9 @@ ) hiPixel3ProtoTracksSequence = cms.Sequence( + hiTrackingRegionFromClusterVtx + + hiPixel3ProtoTracksHitDoublets + + hiPixel3ProtoTracksHitTriplets + pixelFitterByHelixProjections + hiProtoTrackFilter + hiPixel3ProtoTracks diff --git a/RecoHI/HiTracking/python/HIPixelVerticesPreSplitting_cff.py b/RecoHI/HiTracking/python/HIPixelVerticesPreSplitting_cff.py index 93e299c4297e8..2df1be08cc4b6 100644 --- a/RecoHI/HiTracking/python/HIPixelVerticesPreSplitting_cff.py +++ b/RecoHI/HiTracking/python/HIPixelVerticesPreSplitting_cff.py @@ -8,11 +8,22 @@ siPixelRecHits = "siPixelRecHitsPreSplitting" ) -hiPixel3ProtoTracksPreSplitting = hiPixel3ProtoTracks.clone() -hiPixel3ProtoTracksPreSplitting.RegionFactoryPSet.RegionPSet.siPixelRecHits = cms.InputTag( "siPixelRecHitsPreSplitting" ) -hiPixel3ProtoTracksPreSplitting.RegionFactoryPSet.RegionPSet.VertexCollection = cms.InputTag( "hiPixelClusterVertexPreSplitting" ) -hiPixel3ProtoTracksPreSplitting.Filter = "hiProtoTrackFilterPreSplitting" -hiPixel3ProtoTracksPreSplitting.OrderedHitsFactoryPSet.SeedingLayers = cms.InputTag( "PixelLayerTripletsPreSplitting" ) +hiPixel3ProtoTracksTrackingRegionsPreSplitting = hiTrackingRegionFromClusterVtx.clone(RegionPSet=dict( + siPixelRecHits = "siPixelRecHitsPreSplitting", + VertexCollection = "hiPixelClusterVertexPreSplitting" +)) +hiPixel3PRotoTracksHitDoubletsPreSplitting = hiPixel3ProtoTracksHitDoublets.clone( + seedingLayers = "PixelLayerTripletsPreSplitting", + trackingRegions = "hiPixel3ProtoTracksTrackingRegionsPreSplitting", +) +hiPixel3ProtoTracksHitTripletsPreSplitting = hiPixel3ProtoTracksHitTriplets.clone( + doublets = "hiPixel3PRotoTracksHitDoubletsPreSplitting" +) + +hiPixel3ProtoTracksPreSplitting = hiPixel3ProtoTracks.clone( + SeedingHitSets = "hiPixel3ProtoTracksHitTripletsPreSplitting", + Filter = "hiProtoTrackFilterPreSplitting", +) hiPixelMedianVertexPreSplitting = hiPixelMedianVertex.clone( TrackCollection = cms.InputTag('hiPixel3ProtoTracksPreSplitting') ) hiSelectedProtoTracksPreSplitting = hiSelectedProtoTracks.clone( @@ -35,6 +46,9 @@ hiPixelVerticesPreSplitting = cms.Sequence(hiPixelClusterVertexPreSplitting * PixelLayerTripletsPreSplitting + * hiPixel3ProtoTracksTrackingRegionsPreSplitting + * hiPixel3PRotoTracksHitDoubletsPreSplitting + * hiPixel3ProtoTracksHitTripletsPreSplitting * hiProtoTrackFilterPreSplitting * pixelFitterByHelixProjections * hiPixel3ProtoTracksPreSplitting diff --git a/RecoHI/HiTracking/python/HITrackingRegionProducer_cfi.py b/RecoHI/HiTracking/python/HITrackingRegionProducer_cfi.py index 6a9e500055dae..3c118f18e76bf 100644 --- a/RecoHI/HiTracking/python/HITrackingRegionProducer_cfi.py +++ b/RecoHI/HiTracking/python/HITrackingRegionProducer_cfi.py @@ -1,7 +1,8 @@ import FWCore.ParameterSet.Config as cms # global tracking region for primary pixel tracks -HiTrackingRegionWithVertexBlock = cms.PSet( +from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cfi import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices +hiTrackingRegionWithVertex = _globalTrackingRegionWithVertices.clone(RegionPSet = dict( ptMin = cms.double(1.5), originRadius = cms.double(0.2), nSigmaZ = cms.double(3.0), @@ -14,8 +15,7 @@ useFixedError = cms.bool(True), fixedError = cms.double(0.2), sigmaZVertex = cms.double(3.0) - ) - +)) # global tracking region for low-pt pixel tracks HiLowPtTrackingRegionWithVertexBlock = cms.PSet( @@ -50,25 +50,8 @@ ) # limited tracking region for pixel proto-tracks (using cluster vtx input) -HiTrackingRegionFromClusterVtxBlock = cms.PSet( - ptMin = cms.double( 0.7 ), - doVariablePtMin = cms.bool ( True ), - originRadius = cms.double( 0.2 ), - nSigmaZ = cms.double(3.0), - beamSpot = cms.InputTag("offlineBeamSpot"), - precise = cms.bool( True ), - useMultipleScattering = cms.bool(False), - useFakeVertices = cms.bool(False), - siPixelRecHits = cms.InputTag( "siPixelRecHits" ), - directionXCoord = cms.double( 1.0 ), - directionYCoord = cms.double( 1.0 ), - directionZCoord = cms.double( 0.0 ), - useFoundVertices = cms.bool(True), - VertexCollection = cms.InputTag("hiPixelClusterVertex"), - useFixedError = cms.bool(True), - fixedError = cms.double(3.0), - sigmaZVertex = cms.double(3.0) - ) +from RecoHI.HiTracking.hiTrackingRegionFromClusterVtx_cfi import hiTrackingRegionFromClusterVtx + # limited jet-seeded tracking region from RecoTauTag.HLTProducers.TauRegionalPixelSeedGenerator_cfi import tauRegionalPixelSeedGenerator diff --git a/RecoHI/HiTracking/python/LowPtTracking_PbPb_cff.py b/RecoHI/HiTracking/python/LowPtTracking_PbPb_cff.py index a24bdbdf51a54..23f1928a906d7 100644 --- a/RecoHI/HiTracking/python/LowPtTracking_PbPb_cff.py +++ b/RecoHI/HiTracking/python/LowPtTracking_PbPb_cff.py @@ -2,8 +2,8 @@ from RecoHI.HiTracking.HighPtTracking_PbPb_cff import * -hiPixel3PrimTracks.RegionFactoryPSet.RegionPSet.ptMin = 0.9 -hiPixel3PrimTracks.RegionFactoryPSet.RegionPSet.originRadius = 0.1 +hiTrackingRegionWithVertex.RegionPSet.ptMin = 0.9 +hiTrackingRegionWithVertex.RegionPSet.originRadius = 0.1 hiFilter.ptMin = 0.9 CkfBaseTrajectoryFilter_block.minPt = 0.9 diff --git a/RecoHI/HiTracking/python/hiDetachedTripletStep_cff.py b/RecoHI/HiTracking/python/hiDetachedTripletStep_cff.py index 8ba4a8c97a714..72fb5229b4de5 100644 --- a/RecoHI/HiTracking/python/hiDetachedTripletStep_cff.py +++ b/RecoHI/HiTracking/python/hiDetachedTripletStep_cff.py @@ -30,12 +30,44 @@ hiDetachedTripletStepSeedLayers.FPix.skipClusters = cms.InputTag('hiDetachedTripletStepClusters') # SEEDS -from RecoPixelVertexing.PixelTriplets.PixelTripletHLTGenerator_cfi import * +from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cfi import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices +from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer +from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import * from RecoPixelVertexing.PixelLowPtUtilities.trackCleaner_cfi import * from RecoPixelVertexing.PixelTrackFitting.pixelFitterByHelixProjections_cfi import * from RecoHI.HiTracking.HIPixelTrackFilter_cff import * from RecoHI.HiTracking.HITrackingRegionProducer_cfi import * + +hiDetachedTripletStepTrackingRegions = _globalTrackingRegionWithVertices.clone(RegionPSet=dict( + precise = True, + useMultipleScattering = False, + useFakeVertices = False, + beamSpot = "offlineBeamSpot", + useFixedError = True, + nSigmaZ = 4.0, + sigmaZVertex = 4.0, + fixedError = 0.5, + VertexCollection = "hiSelectedVertex", + ptMin = 0.9, + useFoundVertices = True, + originRadius = 0.5 +)) +hiDetachedTripletStepTracksHitDoublets = _hitPairEDProducer.clone( + clusterCheck = "", + seedingLayers = "hiDetachedTripletStepSeedLayers", + trackingRegions = "hiDetachedTripletStepTrackingRegions", + maxElement = 0, + produceIntermediateHitDoublets = True, +) +hiDetachedTripletStepTracksHitTriplets = _pixelTripletHLTEDProducer.clone( + doublets = "hiDetachedTripletStepTracksHitDoublets", + extraHitRPhitolerance = 0.0, + extraHitRZtolerance = 0.0, + maxElement = 1000000, + SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone(), + produceSeedingHitSets = True, +) hiDetachedTripletStepPixelTracksFilter = hiFilter.clone( nSigmaTipMaxTolerance = 0, lipMax = 1.0, @@ -46,32 +78,8 @@ passLabel = cms.string('Pixel detached tracks with vertex constraint'), - RegionFactoryPSet = cms.PSet( - ComponentName = cms.string('GlobalTrackingRegionWithVerticesProducer'), - RegionPSet = cms.PSet( - precise = cms.bool(True), - useMultipleScattering = cms.bool(False), - useFakeVertices = cms.bool(False), - beamSpot = cms.InputTag("offlineBeamSpot"), - useFixedError = cms.bool(True), - nSigmaZ = cms.double(4.0), - sigmaZVertex = cms.double(4.0), - fixedError = cms.double(0.5), - VertexCollection = cms.InputTag("hiSelectedVertex"), - ptMin = cms.double(0.9), - useFoundVertices = cms.bool(True), - originRadius = cms.double(0.5) - ) - ), - # Ordered Hits - OrderedHitsFactoryPSet = cms.PSet( - ComponentName = cms.string( "StandardHitTripletGenerator" ), - SeedingLayers = cms.InputTag( "PixelLayerTriplets" ), - GeneratorPSet = cms.PSet( - PixelTripletHLTGenerator - ) - ), + SeedingHitSets = cms.InputTag("hiDetachedTripletStepTracksHitTriplets"), # Fitter Fitter = cms.InputTag("pixelFitterByHelixProjections"), @@ -84,14 +92,6 @@ ) - -hiDetachedTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.extraHitRPhitolerance = cms.double(0.0) -hiDetachedTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.extraHitRZtolerance = cms.double(0.0) -hiDetachedTripletStepPixelTracks.OrderedHitsFactoryPSet.SeedingLayers = cms.InputTag('hiDetachedTripletStepSeedLayers') - -hiDetachedTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = cms.uint32(1000000) -hiDetachedTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() - import RecoPixelVertexing.PixelLowPtUtilities.TrackSeeds_cfi hiDetachedTripletStepSeeds = RecoPixelVertexing.PixelLowPtUtilities.TrackSeeds_cfi.pixelTrackSeeds.clone( InputCollection = 'hiDetachedTripletStepPixelTracks' @@ -191,6 +191,9 @@ hiDetachedTripletStep = cms.Sequence(hiDetachedTripletStepClusters* hiDetachedTripletStepSeedLayers* + hiDetachedTripletStepTrackingRegions* + hiDetachedTripletStepTracksHitDoublets* + hiDetachedTripletStepTracksHitTriplets* pixelFitterByHelixProjections* hiDetachedTripletStepPixelTracksFilter* hiDetachedTripletStepPixelTracks* diff --git a/RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py b/RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py index 254ef35c733b4..e4741933a06b3 100644 --- a/RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py +++ b/RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py @@ -29,50 +29,55 @@ hiLowPtTripletStepSeedLayers.FPix.skipClusters = cms.InputTag('hiLowPtTripletStepClusters') # SEEDS -from RecoPixelVertexing.PixelTriplets.PixelTripletHLTGenerator_cfi import * +from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cfi import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices +from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer +from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import * +import RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi from RecoPixelVertexing.PixelLowPtUtilities.trackCleaner_cfi import * from RecoPixelVertexing.PixelTrackFitting.pixelFitterByHelixProjections_cfi import * from RecoHI.HiTracking.HIPixelTrackFilter_cff import * from RecoHI.HiTracking.HITrackingRegionProducer_cfi import * + +hiLowPtTripletStepTrackingRegions = _globalTrackingRegionWithVertices.clone(RegionPSet=dict( + precise = True, + useMultipleScattering = False, + useFakeVertices = False, + beamSpot = "offlineBeamSpot", + useFixedError = False, + nSigmaZ = 4.0, + sigmaZVertex = 4.0, + fixedError = 0.2, + VertexCollection = "hiSelectedVertex", + ptMin = 0.4, + useFoundVertices = True, + originRadius = 0.02 +)) +hiLowPtTripletStepTracksHitDoublets = _hitPairEDProducer.clone( + clusterCheck = "", + seedingLayers = "hiLowPtTripletStepSeedLayers", + trackingRegions = "hiLowPtTripletStepTrackingRegions", + maxElement = 0, + produceIntermediateHitDoublets = True, +) +hiLowPtTripletStepTracksHitTriplets = _pixelTripletHLTEDProducer.clone( + doublets = "hiLowPtTripletStepTracksHitDoublets", + maxElement = 5000000, + SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone(), + produceSeedingHitSets = True, +) hiLowPtTripletStepPixelTracksFilter = hiFilter.clone( nSigmaLipMaxTolerance = 4.0, nSigmaTipMaxTolerance = 4.0, lipMax = 0, ptMin = 0.4, ) - hiLowPtTripletStepPixelTracks = cms.EDProducer("PixelTrackProducer", passLabel = cms.string('Pixel primary tracks with vertex constraint'), - # Region - RegionFactoryPSet = cms.PSet( - ComponentName = cms.string("GlobalTrackingRegionWithVerticesProducer"), - RegionPSet = cms.PSet( - precise = cms.bool(True), - useMultipleScattering = cms.bool(False), - useFakeVertices = cms.bool(False), - beamSpot = cms.InputTag("offlineBeamSpot"), - useFixedError = cms.bool(False), - nSigmaZ = cms.double(4.0), - sigmaZVertex = cms.double(4.0), - fixedError = cms.double(0.2), - VertexCollection = cms.InputTag("hiSelectedVertex"), - ptMin = cms.double(0.4), - useFoundVertices = cms.bool(True), - originRadius = cms.double(0.02) - ) - ), - # Ordered Hits - OrderedHitsFactoryPSet = cms.PSet( - ComponentName = cms.string( "StandardHitTripletGenerator" ), - SeedingLayers = cms.InputTag( "PixelLayerTriplets" ), - GeneratorPSet = cms.PSet( - PixelTripletHLTGenerator - ) - ), + SeedingHitSets = cms.InputTag("hiLowPtTripletStepTracksHitTriplets"), # Fitter Fitter = cms.InputTag("pixelFitterByHelixProjections"), @@ -84,12 +89,6 @@ Cleaner = cms.string("trackCleaner") ) -hiLowPtTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = cms.uint32(5000000) -hiLowPtTripletStepPixelTracks.OrderedHitsFactoryPSet.SeedingLayers = cms.InputTag('hiLowPtTripletStepSeedLayers') - -hiLowPtTripletStepPixelTracks.OrderedHitsFactoryPSet.GeneratorPSet.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() - - import RecoPixelVertexing.PixelLowPtUtilities.TrackSeeds_cfi hiLowPtTripletStepSeeds = RecoPixelVertexing.PixelLowPtUtilities.TrackSeeds_cfi.pixelTrackSeeds.clone( @@ -190,6 +189,9 @@ hiLowPtTripletStep = cms.Sequence(hiLowPtTripletStepClusters* hiLowPtTripletStepSeedLayers* + hiLowPtTripletStepTrackingRegions* + hiLowPtTripletStepTracksHitDoublets* + hiLowPtTripletStepTracksHitTriplets* pixelFitterByHelixProjections* hiLowPtTripletStepPixelTracksFilter* hiLowPtTripletStepPixelTracks*hiLowPtTripletStepSeeds* diff --git a/RecoMuon/L3MuonProducer/test/newL3.py b/RecoMuon/L3MuonProducer/test/newL3.py index d99a0101f6574..db4c5856c2ded 100644 --- a/RecoMuon/L3MuonProducer/test/newL3.py +++ b/RecoMuon/L3MuonProducer/test/newL3.py @@ -47,9 +47,39 @@ def producers_by_type(process, type): process.hltDiMuonLinks.LinkCollection = cms.InputTag("hltBRSL3MuonsLinksCombination") ############################################################# #Making Pixel Vertices: + from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot + from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer + from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer from RecoPixelVertexing.PixelTrackFitting.pixelTrackFilterByKinematics_cfi import pixelTrackFilterByKinematics as _pixelTrackFilterByKinematics from RecoPixelVertexing.PixelTrackFitting.pixelFitterByHelixProjections_cfi import pixelFitterByHelixProjections as _pixelFitterByHelixProjections from RecoPixelVertexing.PixelTrackFitting.pixelTrackCleanerBySharedHits_cfi import pixelTrackCleanerBySharedHits as _pixelTrackCleanerBySharedHits + process.hltPixelTracksTrackingRegions = _globalTrackingRegionFromBeamSpot.clone( + precise = True, + originRadius = 0.2, + ptMin = 0.9, + originHalfLength = 24.0, + beamSpot = "hltOnlineBeamSpot" + ) + process.hltPixelTracksHitDoublets = _hitPairEDProducer.clone( + clusterCheck = "", + seedingLayers = "hltPixelLayerTriplets", + trackingRegions = "hltPixelTracksTrackingRegions", + maxElement = 0, + produceIntermediateHitDoublets = True, + ) + process.hltPixelTracksHitTriplets = _pixelTripletHLTEDProducer.clone( + useBending = True, + useFixedPreFiltering = False, + maxElement = 100000, + phiPreFiltering = 0.3, + extraHitRPhitolerance = 0.06, + useMultScattering = True, + SeedComparitorPSet = dict( + ComponentName = "LowPtClusterShapeSeedComparitor", + clusterShapeCacheSrc = cms.InputTag( "hltSiPixelClustersCache" ) + ), + extraHitRZtolerance = 0.06, + ) process.hltPixelTracksFitter = _pixelFitterByHelixProjections.clone() process.hltPixelTrackFilterByKinematics = _pixelTrackFilterByKinematics.clone() process.hltPixelTracksCleaner = _pixelTrackCleanerBySharedHits.clone( @@ -59,35 +89,8 @@ def producers_by_type(process, type): Filter = cms.InputTag("hltPixelTrackFilterByKinematics"), passLabel = cms.string( "Pixel triplet primary tracks with vertex constraint" ), FitterPSet = cms.InputTag("hltPixelTracksFitter"), - RegionFactoryPSet = cms.PSet( - ComponentName = cms.string( "GlobalRegionProducerFromBeamSpot" ), - RegionPSet = cms.PSet( - precise = cms.bool( True ), - originRadius = cms.double( 0.2 ), - ptMin = cms.double( 0.9 ), - originHalfLength = cms.double( 24.0 ), - beamSpot = cms.InputTag( "hltOnlineBeamSpot" ) - ) - ), Cleaner = cms.string("hltPixelTracksCleaner"), - OrderedHitsFactoryPSet = cms.PSet( - 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.06 ), - useMultScattering = cms.bool( True ), - SeedComparitorPSet = cms.PSet( - ComponentName = cms.string( "LowPtClusterShapeSeedComparitor" ), - clusterShapeCacheSrc = cms.InputTag( "hltSiPixelClustersCache" ) - ), - extraHitRZtolerance = cms.double( 0.06 ), - ComponentName = cms.string( "PixelTripletHLTGenerator" ) - ), - SeedingLayers = cms.InputTag( "hltPixelLayerTriplets" ) - ) + SeedingHitSets = cms.InputTag("hltPixelTracksHitTriplets"), ) process.hltPixelVertices = cms.EDProducer( "PixelVertexProducer", @@ -108,6 +111,9 @@ def producers_by_type(process, type): process.HLTRecopixelvertexingSequence = cms.Sequence( process.hltPixelLayerTriplets + + process.hltPixelTracksTrackingRegions + + process.hltPixelTracksHitDoublets + + process.hltPixelTracksHitTriplets + process.hltPixelTracksFitter + process.hltPixelTrackFilterByKinematics + process.hltPixelTracks @@ -433,35 +439,8 @@ def producers_by_type(process, type): Filter = cms.InputTag("hltPixelTrackFilterByKinematics"), passLabel = cms.string( "Pixel triplet primary tracks with vertex constraint" ), Fitter = cms.InputTag("hltPixelTracksFitter"), - RegionFactoryPSet = cms.PSet( - ComponentName = cms.string( "GlobalRegionProducerFromBeamSpot" ), - RegionPSet = cms.PSet( - precise = cms.bool( True ), - originRadius = cms.double( 0.2 ), - ptMin = cms.double( 0.9 ), - originHalfLength = cms.double( 24.0 ), - beamSpot = cms.InputTag( "hltOnlineBeamSpot" ) - ) - ), CleanerPSet = cms.string("hltPixelTracksCleaner"), - OrderedHitsFactoryPSet = cms.PSet( - 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.06 ), - useMultScattering = cms.bool( True ), - SeedComparitorPSet = cms.PSet( - ComponentName = cms.string( "LowPtClusterShapeSeedComparitor" ), - clusterShapeCacheSrc = cms.InputTag( "hltSiPixelClustersCache" ) - ), - extraHitRZtolerance = cms.double( 0.06 ), - ComponentName = cms.string( "PixelTripletHLTGenerator" ) - ), - SeedingLayers = cms.InputTag( "hltPixelLayerTriplets" ) - ) + SeedingHitSets = cms.InputTag("hltPixelTracksHitTriplets"), ) process.hltPixelVertices = cms.EDProducer( "PixelVertexProducer", @@ -939,6 +918,9 @@ def producers_by_type(process, type): ####################### NEW Combo: process.HLTBRSIterativeTrackingHighPtTkMuIteration0 = cms.Sequence( process.hltPixelLayerTriplets + + process.hltPixelTracksTrackingRegions + + process.hltPixelTracksHitDoublets + + process.hltPixelTracksHitTriplets + process.hltPixelTracksFitter + process.hltPixelTrackFilterByKinematics + process.hltBRSIter0HighPtTkMuPixelTracks + diff --git a/RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackReconstruction.h b/RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackReconstruction.h index 8f3e5f257b28c..2a8251ad9a827 100644 --- a/RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackReconstruction.h +++ b/RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackReconstruction.h @@ -12,11 +12,9 @@ class PixelFitter; class PixelTrackCleaner; class PixelTrackFilter; -class OrderedHitsGenerator; -class TrackingRegionProducer; -class QuadrupletSeedMerger; +class RegionsSeedingHitSets; -namespace edm { class Event; class EventSetup; class Run; } +namespace edm { class Event; class EventSetup; class Run; class ParameterSetDescription;} class PixelTrackReconstruction { public: @@ -25,17 +23,15 @@ class PixelTrackReconstruction { edm::ConsumesCollector && iC); ~PixelTrackReconstruction(); - void run(pixeltrackfitting::TracksWithTTRHs& tah, edm::Event& ev, const edm::EventSetup& es); + static void fillDescriptions(edm::ParameterSetDescription& desc); - void init(const edm::EventSetup& es); + void run(pixeltrackfitting::TracksWithTTRHs& tah, edm::Event& ev, const edm::EventSetup& es); private: + edm::EDGetTokenT theHitSetsToken; edm::EDGetTokenT theFitterToken; edm::EDGetTokenT theFilterToken; std::string theCleanerName; - std::unique_ptr theGenerator; - std::unique_ptr theRegionProducer; - std::unique_ptr theMerger_; }; #endif diff --git a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.cc b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.cc index 6f2b0af9f339c..0bcb0b7f22dde 100644 --- a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.cc +++ b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.cc @@ -5,6 +5,8 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" @@ -30,9 +32,13 @@ PixelTrackProducer::PixelTrackProducer(const ParameterSet& cfg) PixelTrackProducer::~PixelTrackProducer() { } -void PixelTrackProducer::beginRun(const edm::Run &run, const edm::EventSetup& es) -{ - theReconstruction.init(es); +void PixelTrackProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + + desc.add("passLabel", "pixelTracks"); // What is this? It is not used anywhere in this code. + PixelTrackReconstruction::fillDescriptions(desc); + + descriptions.add("pixelTracksDefault", desc); } void PixelTrackProducer::produce(edm::Event& ev, const edm::EventSetup& es) diff --git a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.h b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.h index 83ed99dc00f4a..bfc48ff9a3f80 100644 --- a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.h +++ b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.h @@ -5,7 +5,7 @@ #include "RecoPixelVertexing/PixelTrackFitting/interface/TracksWithHits.h" #include "RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackReconstruction.h" -namespace edm { class Event; class EventSetup; class ParameterSet; } +namespace edm { class Event; class EventSetup; class ParameterSet; class ConfigurationDescriptions; } class TrackerTopology; class PixelTrackProducer : public edm::stream::EDProducer<> { @@ -15,7 +15,8 @@ class PixelTrackProducer : public edm::stream::EDProducer<> { ~PixelTrackProducer(); - virtual void beginRun(const edm::Run &run, const edm::EventSetup& es) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + virtual void produce(edm::Event& ev, const edm::EventSetup& es) override; private: diff --git a/RecoPixelVertexing/PixelTrackFitting/python/PixelTrackReconstruction_cfi.py b/RecoPixelVertexing/PixelTrackFitting/python/PixelTrackReconstruction_cfi.py deleted file mode 100644 index 63707ebec2877..0000000000000 --- a/RecoPixelVertexing/PixelTrackFitting/python/PixelTrackReconstruction_cfi.py +++ /dev/null @@ -1,56 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from RecoTracker.TkTrackingRegions.GlobalTrackingRegionFromBeamSpot_cfi import * -from RecoPixelVertexing.PixelTriplets.PixelTripletHLTGenerator_cfi import * -from RecoPixelVertexing.PixelTrackFitting.pixelTrackCleanerBySharedHits_cfi import * - -PixelTrackReconstructionBlock = cms.PSet ( - Fitter = cms.InputTag("pixelFitterByHelixProjections"), - Filter = cms.InputTag("pixelTrackFilterByKinematics"), - RegionFactoryPSet = cms.PSet( - RegionPsetFomBeamSpotBlock, - ComponentName = cms.string('GlobalRegionProducerFromBeamSpot') - ), - OrderedHitsFactoryPSet = cms.PSet( - ComponentName = cms.string('StandardHitTripletGenerator'), - SeedingLayers = cms.InputTag('PixelLayerTriplets'), - GeneratorPSet = cms.PSet( - PixelTripletHLTGeneratorWithFilter - ) - ), - Cleaner = cms.string("pixelTrackCleanerBySharedHits") -) - -_OrderedHitsFactoryPSet_LowPU_Phase1PU70 = dict( - SeedingLayers = "PixelLayerTripletsPreSplitting", - GeneratorPSet = dict(SeedComparitorPSet = dict(clusterShapeCacheSrc = "siPixelClusterShapeCachePreSplitting")) -) -from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU -trackingLowPU.toModify(PixelTrackReconstructionBlock, OrderedHitsFactoryPSet = _OrderedHitsFactoryPSet_LowPU_Phase1PU70) -from Configuration.Eras.Modifier_trackingPhase1PU70_cff import trackingPhase1PU70 -trackingPhase1PU70.toModify(PixelTrackReconstructionBlock, - SeedMergerPSet = cms.PSet( - layerList = cms.PSet(refToPSet_ = cms.string('PixelSeedMergerQuadruplets')), - addRemainingTriplets = cms.bool(False), - mergeTriplets = cms.bool(True), - ttrhBuilderLabel = cms.string('PixelTTRHBuilderWithoutAngle') - ), - RegionFactoryPSet = dict(RegionPSet = dict(originRadius = 0.02)), - OrderedHitsFactoryPSet = _OrderedHitsFactoryPSet_LowPU_Phase1PU70, -) -from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(PixelTrackReconstructionBlock, - SeedMergerPSet = cms.PSet( - layerList = cms.PSet(refToPSet_ = cms.string('PixelSeedMergerQuadruplets')), - addRemainingTriplets = cms.bool(False), - mergeTriplets = cms.bool(True), - ttrhBuilderLabel = cms.string('PixelTTRHBuilderWithoutAngle') - ), - RegionFactoryPSet = dict(RegionPSet = dict(originRadius = 0.02)), - OrderedHitsFactoryPSet = dict( - SeedingLayers = "PixelLayerTripletsPreSplitting", - GeneratorPSet = dict(SeedComparitorPSet = dict(clusterShapeCacheSrc = "siPixelClusterShapeCachePreSplitting"), - maxElement = 0) - ) -) - diff --git a/RecoPixelVertexing/PixelTrackFitting/python/PixelTracks_cff.py b/RecoPixelVertexing/PixelTrackFitting/python/PixelTracks_cff.py index a5b9dad72f2d1..7425dbebfb457 100644 --- a/RecoPixelVertexing/PixelTrackFitting/python/PixelTracks_cff.py +++ b/RecoPixelVertexing/PixelTrackFitting/python/PixelTracks_cff.py @@ -14,17 +14,76 @@ # include "RecoTracker/TransientTrackingRecHit/data/TransientTrackingRecHitBuilderWithoutRefit.cfi" from RecoTracker.TransientTrackingRecHit.TransientTrackingRecHitBuilder_cfi import * import RecoTracker.TransientTrackingRecHit.TransientTrackingRecHitBuilder_cfi -myTTRHBuilderWithoutAngle = RecoTracker.TransientTrackingRecHit.TransientTrackingRecHitBuilder_cfi.ttrhbwr.clone() +myTTRHBuilderWithoutAngle = RecoTracker.TransientTrackingRecHit.TransientTrackingRecHitBuilder_cfi.ttrhbwr.clone( + StripCPE = 'Fake', + ComponentName = 'PixelTTRHBuilderWithoutAngle' +) from RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi import * from RecoTracker.TkSeedingLayers.TTRHBuilderWithoutAngle4PixelTriplets_cfi import * from RecoPixelVertexing.PixelTrackFitting.pixelFitterByHelixProjections_cfi import pixelFitterByHelixProjections from RecoPixelVertexing.PixelTrackFitting.pixelTrackFilterByKinematics_cfi import pixelTrackFilterByKinematics -from RecoPixelVertexing.PixelTrackFitting.PixelTracks_cfi import * -myTTRHBuilderWithoutAngle.StripCPE = 'Fake' -myTTRHBuilderWithoutAngle.ComponentName = 'PixelTTRHBuilderWithoutAngle' +from RecoPixelVertexing.PixelTrackFitting.pixelTrackCleanerBySharedHits_cfi import pixelTrackCleanerBySharedHits +from RecoPixelVertexing.PixelTrackFitting.pixelTracksDefault_cfi import pixelTracksDefault as _pixelTracksDefault +from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot +from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer +from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer +from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import * +import RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi +from RecoPixelVertexing.PixelTriplets.pixelQuadrupletMergerEDProducer_cfi import pixelQuadrupletMergerEDProducer as _pixelQuadrupletMergerEDProducer +from RecoPixelVertexing.PixelTriplets.quadrupletseedmerging_cff import * + +from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU +from Configuration.Eras.Modifier_trackingPhase1PU70_cff import trackingPhase1PU70 +from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 + +# TrackingRegion +pixelTracksTrackingRegions = _globalTrackingRegionFromBeamSpot.clone() +trackingPhase1PU70.toModify(pixelTracksTrackingRegions, RegionPSet = dict(originRadius = 0.02)) +trackingPhase2PU140.toModify(pixelTracksTrackingRegions, RegionPSet = dict(originRadius = 0.02)) + +# Hit ntuplets +pixelTracksHitDoublets = _hitPairEDProducer.clone( + clusterCheck = "", + seedingLayers = "PixelLayerTriplets", + trackingRegions = "pixelTracksTrackingRegions", + maxElement = 0, + produceIntermediateHitDoublets = True, +) +_seedingLayers = dict(seedingLayers = "PixelLayerTripletsPreSplitting") +trackingLowPU.toModify(pixelTracksHitDoublets, **_seedingLayers) +trackingPhase1PU70.toModify(pixelTracksHitDoublets, **_seedingLayers) +trackingPhase2PU140.toModify(pixelTracksHitDoublets, **_seedingLayers) + +pixelTracksHitTriplets = _pixelTripletHLTEDProducer.clone( + doublets = "pixelTracksHitDoublets", + produceSeedingHitSets = True, + SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() +) +_SeedComparitorPSet = dict(SeedComparitorPSet = dict(clusterShapeCacheSrc = "siPixelClusterShapeCachePreSplitting")) +trackingLowPU.toModify(pixelTracksHitTriplets, **_SeedComparitorPSet) +trackingPhase1PU70.toModify(pixelTracksHitTriplets, **_SeedComparitorPSet) +trackingPhase2PU140.toModify(pixelTracksHitTriplets, maxElement=0, **_SeedComparitorPSet) + +pixelTracksHitQuadruplets = _pixelQuadrupletMergerEDProducer.clone( + triplets = "pixelTracksHitTriplets", + layerList = dict(refToPSet_ = cms.string("PixelSeedMergerQuadruplets")), +) + +# Pixel tracks +pixelTracks = _pixelTracksDefault.clone() +_SeedingHitSets = dict(SeedingHitSets = "pixelTracksHitQuadruplets") +trackingPhase1PU70.toModify(pixelTracks, **_SeedingHitSets) +trackingPhase2PU140.toModify(pixelTracks, **_SeedingHitSets) pixelTracksSequence = cms.Sequence( + pixelTracksTrackingRegions + + pixelTracksHitDoublets + + pixelTracksHitTriplets + pixelFitterByHelixProjections + pixelTrackFilterByKinematics + pixelTracks ) +_pixelTracksSequence_quad = pixelTracksSequence.copy() +_pixelTracksSequence_quad.replace(pixelTracksHitTriplets, pixelTracksHitTriplets+pixelTracksHitQuadruplets) +trackingPhase1PU70.toReplaceWith(pixelTracksSequence, _pixelTracksSequence_quad) +trackingPhase2PU140.toReplaceWith(pixelTracksSequence, _pixelTracksSequence_quad) diff --git a/RecoPixelVertexing/PixelTrackFitting/python/PixelTracks_cfi.py b/RecoPixelVertexing/PixelTrackFitting/python/PixelTracks_cfi.py deleted file mode 100644 index 7a78fdb68f079..0000000000000 --- a/RecoPixelVertexing/PixelTrackFitting/python/PixelTracks_cfi.py +++ /dev/null @@ -1,10 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from RecoPixelVertexing.PixelTrackFitting.PixelTrackReconstruction_cfi import * - -pixelTracks = cms.EDProducer("PixelTrackProducer", - PixelTrackReconstructionBlock, - passLabel = cms.string('pixelTracks') -) - - diff --git a/RecoPixelVertexing/PixelTrackFitting/src/PixelTrackReconstruction.cc b/RecoPixelVertexing/PixelTrackFitting/src/PixelTrackReconstruction.cc index e5eb968e1240e..66dd68d6bd8a2 100644 --- a/RecoPixelVertexing/PixelTrackFitting/src/PixelTrackReconstruction.cc +++ b/RecoPixelVertexing/PixelTrackFitting/src/PixelTrackReconstruction.cc @@ -2,14 +2,12 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" - -#include "RecoTracker/TkTrackingRegions/interface/OrderedHitsGenerator.h" -#include "RecoTracker/TkTrackingRegions/interface/OrderedHitsGeneratorFactory.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h" -#include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducer.h" -#include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducerFactory.h" #include "RecoPixelVertexing/PixelTrackFitting/interface/PixelFitter.h" @@ -22,7 +20,7 @@ #include "DataFormats/TrackReco/interface/TrackFwd.h" #include "DataFormats/TrackReco/interface/TrackExtra.h" -#include "RecoPixelVertexing/PixelTriplets/interface/QuadrupletSeedMerger.h" +#include "RecoTracker/TkHitPairs/interface/RegionsSeedingHitSets.h" #include @@ -32,52 +30,32 @@ using edm::ParameterSet; PixelTrackReconstruction::PixelTrackReconstruction(const ParameterSet& cfg, edm::ConsumesCollector && iC) - : theFitterToken(iC.consumes(cfg.getParameter("Fitter"))), + : theHitSetsToken(iC.consumes(cfg.getParameter("SeedingHitSets"))), + theFitterToken(iC.consumes(cfg.getParameter("Fitter"))), theCleanerName(cfg.getParameter("Cleaner")) { - if ( cfg.exists("SeedMergerPSet") ) { - edm::ParameterSet mergerPSet = cfg.getParameter( "SeedMergerPSet" ); - std::string seedmergerTTRHBuilderLabel = mergerPSet.getParameter( "ttrhBuilderLabel" ); - edm::ParameterSet seedmergerLayerList = mergerPSet.getParameter( "layerList" ); - bool seedmergerAddTriplets = mergerPSet.getParameter( "addRemainingTriplets" ); - bool seedmergerMergeTriplets = mergerPSet.getParameter( "mergeTriplets" ); - theMerger_.reset(new QuadrupletSeedMerger(seedmergerLayerList, iC)); - theMerger_->setMergeTriplets( seedmergerMergeTriplets ); - theMerger_->setAddRemainingTriplets( seedmergerAddTriplets ); - theMerger_->setTTRHBuilderLabel( seedmergerTTRHBuilderLabel ); - } - edm::InputTag filterTag = cfg.getParameter("Filter"); if(filterTag.label() != "") { theFilterToken = iC.consumes(filterTag); } - - ParameterSet orderedPSet = - cfg.getParameter("OrderedHitsFactoryPSet"); - std::string orderedName = orderedPSet.getParameter("ComponentName"); - theGenerator.reset(OrderedHitsGeneratorFactory::get()->create( orderedName, orderedPSet, iC)); - - ParameterSet regfactoryPSet = cfg.getParameter("RegionFactoryPSet"); - std::string regfactoryName = regfactoryPSet.getParameter("ComponentName"); - theRegionProducer.reset(TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet, std::move(iC))); } PixelTrackReconstruction::~PixelTrackReconstruction() { } -void PixelTrackReconstruction::init(const edm::EventSetup& es) -{ - if (theMerger_) { - theMerger_->update( es ); - } +void PixelTrackReconstruction::fillDescriptions(edm::ParameterSetDescription& desc) { + desc.add("SeedingHitSets", edm::InputTag("pixelTracksHitTriplets")); + desc.add("Fitter", edm::InputTag("pixelFitterByHelixProjections")); + desc.add("Filter", edm::InputTag("pixelTrackFilterByKinematics")); + desc.add("Cleaner", "pixelTrackCleanerBySharedHits"); } void PixelTrackReconstruction::run(TracksWithTTRHs& tracks, edm::Event& ev, const edm::EventSetup& es) { - typedef std::vector > Regions; - typedef Regions::const_iterator IR; - Regions regions = theRegionProducer->regions(ev,es); + edm::Handle hhitSets; + ev.getByToken(theHitSetsToken, hhitSets); + const auto& hitSets = *hhitSets; edm::Handle hfitter; ev.getByToken(theFitterToken, hfitter); @@ -91,18 +69,10 @@ void PixelTrackReconstruction::run(TracksWithTTRHs& tracks, edm::Event& ev, cons } std::vector hits;hits.reserve(4); - for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) { - const TrackingRegion & region = **ir; - - const OrderedSeedingHits & triplets = theGenerator->run(region,ev,es); - const OrderedSeedingHits &tuplets= (theMerger_==0)? triplets : theMerger_->mergeTriplets( triplets, es ); - - unsigned int nTuplets = tuplets.size(); - tracks.reserve(tracks.size()+nTuplets); - // producing tracks - for (unsigned int iTuplet = 0; iTuplet < nTuplets; ++iTuplet) { - const SeedingHitSet & tuplet = tuplets[iTuplet]; + for(const auto& regionHitSets: hitSets) { + const TrackingRegion& region = regionHitSets.region(); + for(const SeedingHitSet& tuplet: regionHitSets) { /// FIXME at some point we need to migrate the fitter... auto nHits = tuplet.size(); hits.resize(nHits); for (unsigned int iHit = 0; iHit < nHits; ++iHit) hits[iHit] = tuplet[iHit]; @@ -120,7 +90,6 @@ void PixelTrackReconstruction::run(TracksWithTTRHs& tracks, edm::Event& ev, cons // add tracks tracks.emplace_back(track.release(), tuplet); } - theGenerator->clear(); } // skip ovelrapped tracks diff --git a/RecoPixelVertexing/PixelTriplets/test/trip_cfg.py b/RecoPixelVertexing/PixelTriplets/test/trip_cfg.py index cbbad0ea252c6..ea0e60312c00f 100644 --- a/RecoPixelVertexing/PixelTriplets/test/trip_cfg.py +++ b/RecoPixelVertexing/PixelTriplets/test/trip_cfg.py @@ -46,7 +46,6 @@ from RecoPixelVertexing.PixelTriplets.PixelTripletHLTGenerator_cfi import * from RecoPixelVertexing.PixelTriplets.PixelTripletLargeTipGenerator_cfi import * -from RecoPixelVertexing.PixelTrackFitting.PixelTracks_cfi import * from RecoTracker.TkTrackingRegions.GlobalTrackingRegion_cfi import * process.triplets = cms.EDAnalyzer("HitTripletProducer", From f8fe5eb668d4340675f787e6f7efc2b4b8db32de Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Wed, 30 Nov 2016 09:35:38 +0100 Subject: [PATCH 10/14] Migrate customiseFor*HLTPixelTracksByCellularAutomaton --- ...upletsHLTPixelTracksByCellularAutomaton.py | 40 +++---------------- ...ipletsHLTPixelTracksByCellularAutomaton.py | 35 +++------------- 2 files changed, 10 insertions(+), 65 deletions(-) diff --git a/RecoTracker/Configuration/python/customiseForQuadrupletsHLTPixelTracksByCellularAutomaton.py b/RecoTracker/Configuration/python/customiseForQuadrupletsHLTPixelTracksByCellularAutomaton.py index 56f1634b3c3ee..7b9bfb5c272f2 100644 --- a/RecoTracker/Configuration/python/customiseForQuadrupletsHLTPixelTracksByCellularAutomaton.py +++ b/RecoTracker/Configuration/python/customiseForQuadrupletsHLTPixelTracksByCellularAutomaton.py @@ -1,45 +1,15 @@ import FWCore.ParameterSet.Config as cms +from RecoTracker.Configuration.customiseForQuadrupletsByCellularAutomaton import customiseNewSeeding def producers_by_type(process, *types): return (module for module in process._Process__producers.values() if module._TypedParameterizable__type in types) def customiseForQuadrupletsHLTPixelTracksByCellularAutomaton(process): for module in producers_by_type(process, "PixelTrackProducer"): - if not hasattr(module, "OrderedHitsFactoryPSet"): - continue - pset = getattr(module, "OrderedHitsFactoryPSet") - if not hasattr(pset, "ComponentName"): - continue - if not (pset.ComponentName == "CombinedHitQuadrupletGenerator"): - continue - # Adjust seeding layers - seedingLayersName = module.OrderedHitsFactoryPSet.SeedingLayers.getModuleLabel() - + quadrupletModuleName = module.SeedingHitSets.getModuleLabel() + quadrupletModule = getattr(process, quadrupletModuleName) + if quadrupletModule._TypedParameterizable__type == "PixelQuadrupletEDProducer": + customiseNewSeeding(process, quadrupletModule) - - # Configure seed generator / pixel track producer - quadruplets = module.OrderedHitsFactoryPSet.clone() - from RecoPixelVertexing.PixelTriplets.CAHitQuadrupletGenerator_cfi import CAHitQuadrupletGenerator as _CAHitQuadrupletGenerator - - module.OrderedHitsFactoryPSet = _CAHitQuadrupletGenerator.clone( - ComponentName = cms.string("CAHitQuadrupletGenerator"), - extraHitRPhitolerance = quadruplets.GeneratorPSet.extraHitRPhitolerance, - maxChi2 = dict( - pt1 = 0.8, pt2 = 2, - value1 = 200, value2 = 100, - enabled = True, - ), - useBendingCorrection = True, - fitFastCircle = True, - fitFastCircleChi2Cut = True, - SeedingLayers = cms.InputTag(seedingLayersName), - CAThetaCut = cms.double(0.00125), - CAPhiCut = cms.double(0.1), - CAHardPtCut = cms.double(0), - - ) - - if hasattr(quadruplets.GeneratorPSet, "SeedComparitorPSet"): - module.OrderedHitsFactoryPSet.SeedComparitorPSet = quadruplets.GeneratorPSet.SeedComparitorPSet return process diff --git a/RecoTracker/Configuration/python/customiseForTripletsHLTPixelTracksByCellularAutomaton.py b/RecoTracker/Configuration/python/customiseForTripletsHLTPixelTracksByCellularAutomaton.py index 36db4785feb21..59e9db116734a 100755 --- a/RecoTracker/Configuration/python/customiseForTripletsHLTPixelTracksByCellularAutomaton.py +++ b/RecoTracker/Configuration/python/customiseForTripletsHLTPixelTracksByCellularAutomaton.py @@ -1,5 +1,6 @@ import FWCore.ParameterSet.Config as cms +from RecoTracker.Configuration.customiseForTripletsByCellularAutomaton import customiseNewSeeding def producers_by_type(process, *types): return (module for module in process._Process__producers.values() if module._TypedParameterizable__type in types) @@ -7,35 +8,9 @@ def producers_by_type(process, *types): def customiseForTripletsHLTPixelTracksByCellularAutomaton(process): for module in producers_by_type(process, "PixelTrackProducer"): - if not hasattr(module, "OrderedHitsFactoryPSet"): - continue - pset = getattr(module, "OrderedHitsFactoryPSet") - if not hasattr(pset, "ComponentName"): - continue - if not (pset.ComponentName == "StandardHitTripletGenerator"): - continue - # Adjust seeding layers - seedingLayersName = module.OrderedHitsFactoryPSet.SeedingLayers.getModuleLabel() - - # Configure seed generator / pixel track producer - triplets = module.OrderedHitsFactoryPSet.clone() - from RecoPixelVertexing.PixelTriplets.CAHitTripletGenerator_cfi import CAHitTripletGenerator as _CAHitTripletGenerator + tripletModuleName = module.SeedingHitSets.getModuleLabel() + tripletModule = getattr(process, tripletModuleName) + if tripletModule._TypedParameterizable__type in ["PixelTripletHLTEDProducer", "PixelTripletLargeTipEDProducer"]: + customiseNewSeeding(process, tripletModule) - module.OrderedHitsFactoryPSet = _CAHitTripletGenerator.clone( - ComponentName = cms.string("CAHitTripletGenerator"), - extraHitRPhitolerance = triplets.GeneratorPSet.extraHitRPhitolerance, - maxChi2 = cms.PSet( - pt1 = cms.double(0.9), pt2 = cms.double(2), - value1 = cms.double(20), value2 = cms.double(10), - enabled = cms.bool(True), - ), - useBendingCorrection = cms.bool(True), - SeedingLayers = cms.InputTag(seedingLayersName), - CAThetaCut = cms.double(0.0015), - CAPhiCut = cms.double(0.01), - CAHardPtCut = cms.double(0), - ) - - if hasattr(triplets.GeneratorPSet, "SeedComparitorPSet"): - module.OrderedHitsFactoryPSet.SeedComparitorPSet = triplets.GeneratorPSet.SeedComparitorPSet return process From 9bce3aae940e36bd4ff570710b034418f2cfcc4d Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Wed, 30 Nov 2016 10:56:51 +0100 Subject: [PATCH 11/14] Add PixelTrackProducer migration to customizeHLTforCMSSW --- .../python/customizeHLTforCMSSW.py | 156 +++++++++++++----- 1 file changed, 111 insertions(+), 45 deletions(-) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index 9b26e9494a31c..d369b0171bfdb 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -184,27 +184,7 @@ def _copy(old, new, skip=[]): if key not in skipSet: setattr(new, key, getattr(old, key)) - # Bit of a hack to replace a module with another, but works - # - # In principle setattr(process) could work too, but it expands the - # sequences and I don't want that - modifier = cms.Modifier() - modifier._setChosen() - - for producer in producers_by_type(process, "SeedGeneratorFromRegionHitsEDProducer"): - label = producer.label() - if "Seeds" in label: - regionLabel = label.replace("Seeds", "TrackingRegions") - clusterCheckLabel = label.replace("Seeds", "ClusterCheck") - doubletLabel = label.replace("Seeds", "HitDoublets") - tripletLabel = label.replace("Seeds", "HitTriplets") - else: - regionLabel = label + "TrackingRegions" - clusterCheckLabel = label + "ClusterCheck" - doubletLabel = label + "HitPairs" - tripletLabel = label + "HitTriplets" - - ## Construct new producers + def _regionHitSet(producer): # region regionProducer = { "GlobalRegionProducerFromBeamSpot": _globalTrackingRegionFromBeamSpot, @@ -213,28 +193,36 @@ def _copy(old, new, skip=[]): "CandidateSeededTrackingRegionsProducer": _seededTrackingRegionsFromBeamSpotFixedZLength, }.get(producer.RegionFactoryPSet.ComponentName.value(), None) if regionProducer is None: # got a region not migrated yet - #print "skipping", label, producer.RegionFactoryPSet.ComponentName.value() - continue + raise Exception("Encountered %s from module %s which is not yet migrated to the new seeding framework. Please migrate." % (producer.RegionFactoryPSet.ComponentName.value(), producer.label())) regionProducer = regionProducer.clone() - regionProducer.RegionPSet = producer.RegionFactoryPSet.RegionPSet - # some (all?) instances of TauRegionalPixelSeedGenerator have - # "precise" parameter, while the region producer itself does not have the parameter - if producer.RegionFactoryPSet.ComponentName.value() == "TauRegionalPixelSeedGenerator": - if hasattr(regionProducer.RegionPSet, "precise"): - del regionProducer.RegionPSet.precise - - # cluster check - clusterCheckProducer = _trackerClusterCheck.clone() - _copy(producer.ClusterCheckPSet, clusterCheckProducer) - - # hit doublet/triplet generator + # some instances of the following region producers have the + # following parameters in the HLT configuration, while the + # region producers themselves do not use these parameters + skip = { + "TauRegionalPixelSeedGenerator": ["precise", "JetMaxEta", "JetMaxN", "JetMinPt", "beamSpot", "originZPos", "useFakeVertices", "useMultipleScattering", "deltaEta", "deltaPhi"], + "GlobalRegionProducerFromBeamSpot": ["useFakeVertices"], + "GlobalTrackingRegionWithVerticesProducer": ["originHalfLength"], + "CandidateSeededTrackingRegionsProducer": ["useFakeVertices", "useMultipleScattering", "originZPos", "vertexSrc", "zErrorVertex"], + }.get(producer.RegionFactoryPSet.ComponentName.value(), []) + _copy(producer.RegionFactoryPSet.RegionPSet, regionProducer.RegionPSet, skip=skip) + if producer.RegionFactoryPSet.ComponentName.value() == "GlobalRegionProducerFromBeamSpot": + # to preserve old behaviour + # if nSigmaZ/originHalfLength was missing, it was internally set to 0 + if not hasattr(producer.RegionFactoryPSet.RegionPSet, "nSigmaZ"): + regionProducer.RegionPSet.nSigmaZ = 0 + if not hasattr(producer.RegionFactoryPSet.RegionPSet, "originHalfLength"): + regionProducer.RegionPSet.originHalfLength = 0 + + # hit doublet generator doubletProducer = _hitPairEDProducer.clone( seedingLayers = producer.OrderedHitsFactoryPSet.SeedingLayers.value(), trackingRegions = regionLabel, clusterCheck = clusterCheckLabel, ) + # hit triplet generator tripletProducer = None + skip = ["ComponentName"] if producer.OrderedHitsFactoryPSet.ComponentName.value() == "StandardHitPairGenerator": doubletProducer.produceSeedingHitSets = True doubletProducer.maxElement = producer.OrderedHitsFactoryPSet.maxElement.value() @@ -246,8 +234,7 @@ def _copy(old, new, skip=[]): "PixelTripletLargeTipGenerator": _pixelTripletLargeTipEDProducer, }.get(producer.OrderedHitsFactoryPSet.GeneratorPSet.ComponentName.value(), None) if tripletProducer is None: # got a triplet generator not migrated yet - #print "skipping", label, producer.OrderedHitsFactoryPSet.GeneratorPSet.ComponentName.value() - continue + raise Exception("Encountered %s from module %s which is not yet migrated to the new seeding framework. Please migrate." % (producer.OrderedHitsFactoryPSet.GeneratorPSet.ComponentName.value(), producer.label())) tripletProducer = tripletProducer.clone( doublets = doubletLabel, produceSeedingHitSets = True, @@ -259,11 +246,47 @@ def _copy(old, new, skip=[]): tripletProducer = _multiHitFromChi2EDProducer.clone( doublets = doubletLabel, ) + # some instances have "debug" parameter set while the producer does not use it + skip.append("debug") else: # got a hit generator not migrated yet - #print "skipping", label, producer.OrderedHitsFactoryPSet.ComponentName.value() - continue + raise Exception("Encountered %s from module %s which is not yet migrated to the new seeding framework. Please migrate." % (producer.OrderedHitsFactoryPSet.ComponentName.value(), producer.label())) if tripletProducer: - _copy(producer.OrderedHitsFactoryPSet.GeneratorPSet, tripletProducer, skip=["ComponentName"]) + _copy(producer.OrderedHitsFactoryPSet.GeneratorPSet, tripletProducer, skip=skip) + doubletProducer.maxElement = 0 # this was the old behaviour when calling doublet generator from triplet generator + + + return (regionProducer, doubletProducer, tripletProducer) + + + # Bit of a hack to replace a module with another, but works + # + # In principle setattr(process) could work too, but it expands the + # sequences and I don't want that + modifier = cms.Modifier() + modifier._setChosen() + + for producer in producers_by_type(process, "SeedGeneratorFromRegionHitsEDProducer"): + label = producer.label() + if "Seeds" in label: + regionLabel = label.replace("Seeds", "TrackingRegions") + clusterCheckLabel = label.replace("Seeds", "ClusterCheck") + doubletLabel = label.replace("Seeds", "HitDoublets") + tripletLabel = label.replace("Seeds", "HitTriplets") + else: + regionLabel = label + "TrackingRegions" + clusterCheckLabel = label + "ClusterCheck" + doubletLabel = label + "HitPairs" + tripletLabel = label + "HitTriplets" + + ## Construct new producers + # cluster check + clusterCheckProducer = _trackerClusterCheck.clone() + _copy(producer.ClusterCheckPSet, clusterCheckProducer) + if not hasattr(producer.ClusterCheckPSet, "cut"): + clusterCheckProducer.cut = "" # to preserve old behaviour + + # region and hit ntuplet + (regionProducer, doubletProducer, tripletProducer) = _regionHitSet(producer) # seed creator seedCreatorPSet = producer.SeedCreatorPSet @@ -273,10 +296,9 @@ def _copy(old, new, skip=[]): seedProducer = { "SeedFromConsecutiveHitsCreator": _seedCreatorFromRegionConsecutiveHitsEDProducer, "SeedFromConsecutiveHitsTripletOnlyCreator": _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer, - }.get(producer.SeedCreatorPSet.ComponentName.value(), None) + }.get(seedCreatorPSet.ComponentName.value(), None) if seedProducer is None: # got a seed creator not migrated yet - #print "skipping", label, producer.SeedCreatorPSet.ComponentName.value() - continue + raise Exception("Encountered %s from module %s which is not yet migrated to the new seeding framework. Please migrate." % (producer.SeedCreatorPSet.ComponentName.value(), producer.label())) seedProducer = seedProducer.clone( seedingHitSets = tripletLabel if tripletProducer else doubletLabel ) @@ -294,8 +316,6 @@ def _copy(old, new, skip=[]): setattr(process, tripletLabel, tripletProducer) modifier.toReplaceWith(producer, seedProducer) - print "Migrated", label - # Modify sequences (also paths to be sure, altough in practice # the seeding modules should be only in sequences in HLT?) for seqs in [process.sequences_(), process.paths_()]: @@ -322,6 +342,52 @@ def _copy(old, new, skip=[]): seq.insert(index, clusterCheckProducer) seq.insert(index, regionProducer) + + for producer in producers_by_type(process, "PixelTrackProducer"): + label = producer.label() + if "PixelTracks" in label: + regionLabel = label.replace("PixelTracks", "PixelTracksTrackingRegions") + doubletLabel = label.replace("PixelTracks", "PixelTracksHitDoublets") + tripletLabel = label.replace("PixelTracks", "PixelTracksHitTriplets") + else: + regionLabel = label + "TrackingRegions" + doubletLabel = label + "HitPairs" + tripletLabel = label + "HitTriplets" + + ## Construct new producers + # region and hit ntuplet + (regionProducer, doubletProducer, tripletProducer) = _regionHitSet(producer) + + # Disable cluster check as in legacy PixelTrackProducer + doubletProducer.clusterCheck = "" + + # Remove old PSets + del producer.RegionFactoryPSet + del producer.OrderedHitsFactoryPSet + + # Set ntuplet input + producer.SeedingHitSets = cms.InputTag(tripletLabel if tripletProducer else doubletLabel) + + # Set new producers to process + setattr(process, regionLabel, regionProducer) + setattr(process, doubletLabel, doubletProducer) + if tripletProducer: + setattr(process, tripletLabel, tripletProducer) + + for seqs in [process.sequences_(), process.paths_()]: + for seqName, seq in seqs.iteritems(): + try: + index = seq.index(producer) + except: + continue + + # Inserted on reverse order, succeeding module will be + # inserted before preceding one + if tripletProducer: + seq.insert(index, tripletProducer) + seq.insert(index, doubletProducer) + seq.insert(index, regionProducer) + return process # From 2e950954bc6abf4a23c9aecc13e0d5d56370fbd2 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Thu, 1 Dec 2016 16:24:35 +0100 Subject: [PATCH 12/14] Remove added region/doublet/triplet producers for pixel tracks from FastSim HLT --- .../Configuration/python/customizeHLTforMC.py | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/HLTrigger/Configuration/python/customizeHLTforMC.py b/HLTrigger/Configuration/python/customizeHLTforMC.py index 69d6e3a3d5701..39fbf1c227ecb 100644 --- a/HLTrigger/Configuration/python/customizeHLTforMC.py +++ b/HLTrigger/Configuration/python/customizeHLTforMC.py @@ -233,6 +233,63 @@ def customizeHLTforMC(process,_fastSim=False): "hltPixelTracksForSeedsTau3mu", "hltPixelTracksGlbDiTrkMuon", + "hltPixelTracksHitTripletsForMinBias", + "hltPixelTracksHitTripletsForMinBias01", + "hltPixelTracksHitTripletsForHighMult", + "hltRegionalPixelTracksHitTriplets", + "hltPixelTracksHitTripletsReg", + "hltPixelTracksHitTripletsL3Muon", + "hltPixelTracksHitTripletsGlbTrkMuon", + "hltPixelTracksHitTripletsHighPtTkMuIso", + "hltPixelTracksHitTripletsHybrid", + "hltPixelTracksHitTripletsForPhotons", + "hltPixelTracksHitTripletsForEgamma", + "hltPixelTracksHitTripletsElectrons", + "hltPixelTracksHitTripletsForHighPt", + "hltHighPtPixelTracksHitTriplets", + "hltPixelTracksHitTripletsForNoPU", + "hltPixelTracksHitTripletsForSeedsTau3mu", + "hltPixelTracksHitTripletsGlbDiTrkMuon", + "hltPixelTracksHitTriplets", + + "hltPixelTracksHitDoubletsForMinBias", + "hltPixelTracksHitDoubletsForMinBias01", + "hltPixelTracksHitDoubletsForHighMult", + "hltRegionalPixelTracksHitDoublets", + "hltPixelTracksHitDoubletsReg", + "hltPixelTracksHitDoubletsL3Muon", + "hltPixelTracksHitDoubletsGlbTrkMuon", + "hltPixelTracksHitDoubletsHighPtTkMuIso", + "hltPixelTracksHitDoubletsHybrid", + "hltPixelTracksHitDoubletsForPhotons", + "hltPixelTracksHitDoubletsForEgamma", + "hltPixelTracksHitDoubletsElectrons", + "hltPixelTracksHitDoubletsForHighPt", + "hltHighPtPixelTracksHitDoublets", + "hltPixelTracksHitDoubletsForNoPU", + "hltPixelTracksHitDoubletsForSeedsTau3mu", + "hltPixelTracksHitDoubletsGlbDiTrkMuon", + "hltPixelTracksHitDoublets", + + "hltPixelTracksTrackingRegionsForMinBias", + "hltPixelTracksTrackingRegionsForMinBias01", + "hltPixelTracksTrackingRegionsForHighMult", + "hltRegionalPixelTracksTrackingRegions", + "hltPixelTracksTrackingRegionsReg", + "hltPixelTracksTrackingRegionsL3Muon", + "hltPixelTracksTrackingRegionsGlbTrkMuon", + "hltPixelTracksTrackingRegionsHighPtTkMuIso", + "hltPixelTracksTrackingRegionsHybrid", + "hltPixelTracksTrackingRegionsForPhotons", + "hltPixelTracksTrackingRegionsForEgamma", + "hltPixelTracksTrackingRegionsElectrons", + "hltPixelTracksTrackingRegionsForHighPt", + "hltHighPtPixelTracksTrackingRegions", + "hltPixelTracksTrackingRegionsForNoPU", + "hltPixelTracksTrackingRegionsForSeedsTau3mu", + "hltPixelTracksTrackingRegionsGlbDiTrkMuon", + "hltPixelTracksTrackingRegions", + "hltFastPixelHitsVertex", "hltFastPixelTracks", "hltFastPixelTracksRecover", @@ -255,7 +312,13 @@ def customizeHLTforMC(process,_fastSim=False): "hltFastPrimaryVertex", "hltFastPVPixelVertexFilter", "hltFastPVPixelTracks", + "hltFastPVPixelTracksHitTriplets", + "hltFastPVPixelTracksHitDoublets", + "hltFastPVPixelTracksTrackingRegions", "hltFastPVPixelTracksRecover", + "hltFastPVPixelTracksHitTripletsRecover", + "hltFastPVPixelTracksHitDoubletsRecover", + "hltFastPVPixelTracksTrackingRegionsRecover", "hltPAGoodHighPurityFullTracks", From 9944fe14e67d440a0d3dcdcf3e732f3032bd6c24 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Thu, 12 Jan 2017 11:10:15 +0100 Subject: [PATCH 13/14] Migrate customizeHLTTrackingForPhaseI2017 --- .../customizeHLTTrackingForPhaseI2017.py | 108 +++++++++++------- 1 file changed, 67 insertions(+), 41 deletions(-) diff --git a/HLTrigger/Configuration/python/customizeHLTTrackingForPhaseI2017.py b/HLTrigger/Configuration/python/customizeHLTTrackingForPhaseI2017.py index df12e13ba0201..cb4170183e7b7 100644 --- a/HLTrigger/Configuration/python/customizeHLTTrackingForPhaseI2017.py +++ b/HLTrigger/Configuration/python/customizeHLTTrackingForPhaseI2017.py @@ -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, @@ -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), @@ -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 ) @@ -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( @@ -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 From 8f717e9e66fcc3f6a40c13cbe784b0ea5e345dc6 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Sun, 15 Jan 2017 14:04:24 +0100 Subject: [PATCH 14/14] Missed some pieces in HLT migration --- HLTrigger/Configuration/python/customizeHLTforCMSSW.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index d369b0171bfdb..74651692a047b 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -167,6 +167,7 @@ def customiseFor17170(process): from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cfi import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices from RecoTauTag.HLTProducers.tauRegionalPixelSeedTrackingRegions_cfi import tauRegionalPixelSeedTrackingRegions as _tauRegionalPixelSeedTrackingRegions from RecoTauTag.HLTProducers.seededTrackingRegionsFromBeamSpotFixedZLength_cfi import seededTrackingRegionsFromBeamSpotFixedZLength as _seededTrackingRegionsFromBeamSpotFixedZLength + from RecoHI.HiTracking.hiTrackingRegionFromClusterVtx_cfi import hiTrackingRegionFromClusterVtx as _hiTrackingRegionFromClusterVtx from RecoTracker.TkSeedGenerator.trackerClusterCheck_cfi import trackerClusterCheck as _trackerClusterCheck @@ -191,6 +192,7 @@ def _regionHitSet(producer): "GlobalTrackingRegionWithVerticesProducer": _globalTrackingRegionWithVertices, "TauRegionalPixelSeedGenerator": _tauRegionalPixelSeedTrackingRegions, "CandidateSeededTrackingRegionsProducer": _seededTrackingRegionsFromBeamSpotFixedZLength, + "HITrackingRegionForPrimaryVtxProducer": _hiTrackingRegionFromClusterVtx, }.get(producer.RegionFactoryPSet.ComponentName.value(), None) if regionProducer is None: # got a region not migrated yet raise Exception("Encountered %s from module %s which is not yet migrated to the new seeding framework. Please migrate." % (producer.RegionFactoryPSet.ComponentName.value(), producer.label())) @@ -202,7 +204,7 @@ def _regionHitSet(producer): "TauRegionalPixelSeedGenerator": ["precise", "JetMaxEta", "JetMaxN", "JetMinPt", "beamSpot", "originZPos", "useFakeVertices", "useMultipleScattering", "deltaEta", "deltaPhi"], "GlobalRegionProducerFromBeamSpot": ["useFakeVertices"], "GlobalTrackingRegionWithVerticesProducer": ["originHalfLength"], - "CandidateSeededTrackingRegionsProducer": ["useFakeVertices", "useMultipleScattering", "originZPos", "vertexSrc", "zErrorVertex"], + "CandidateSeededTrackingRegionsProducer": ["useFakeVertices", "useMultipleScattering", "originZPos", "vertexSrc", "zErrorVertex", "fixedError", "nSigmaZ", "sigmaZVertex", "useFixedError", "useFoundVertices"], }.get(producer.RegionFactoryPSet.ComponentName.value(), []) _copy(producer.RegionFactoryPSet.RegionPSet, regionProducer.RegionPSet, skip=skip) if producer.RegionFactoryPSet.ComponentName.value() == "GlobalRegionProducerFromBeamSpot":