New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add customization function to switch the pixelTracks for the iterativ… #16563
Changes from 8 commits
5ff70cc
5a96f1a
e8d1b2a
e521710
efb9ef9
8e2e521
60fbbd9
ce64d34
5a4746f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,279 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
|
||
def producers_by_type(process, *types): | ||
return (module for module in process._Process__producers.values() if module._TypedParameterizable__type in types) | ||
|
||
def customizeHLTForPFTrackingPhaseI2017(process): | ||
|
||
|
||
process.ClusterShapeHitFilterESProducer.PixelShapeFile = 'RecoPixelVertexing/PixelLowPtUtilities/data/pixelShape_Phase1TkNewFPix.par' | ||
process.hltSiPixelDigis.UsePhase1 = cms.bool( True ) | ||
process.hltSiPixelDigisRegForBTag.UsePhase1 = cms.bool( True ) | ||
process.hltSiPixelDigisReg.UsePhase1 = cms.bool( True ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With grep I can see more than one instance of Wouldn't it be better to apply these changes to all instances of |
||
|
||
|
||
process.hltPixelLayerTriplets.layerList = cms.vstring( | ||
'BPix1+BPix2+BPix3', | ||
'BPix2+BPix3+BPix4', | ||
'BPix1+BPix3+BPix4', | ||
'BPix1+BPix2+BPix4', | ||
'BPix2+BPix3+FPix1_pos', | ||
'BPix2+BPix3+FPix1_neg', | ||
'BPix1+BPix2+FPix1_pos', | ||
'BPix1+BPix2+FPix1_neg', | ||
'BPix2+FPix1_pos+FPix2_pos', | ||
'BPix2+FPix1_neg+FPix2_neg', | ||
'BPix1+FPix1_pos+FPix2_pos', | ||
'BPix1+FPix1_neg+FPix2_neg', | ||
'FPix1_pos+FPix2_pos+FPix3_pos', | ||
'FPix1_neg+FPix2_neg+FPix3_neg' | ||
) | ||
|
||
process.hltPixelLayerQuadruplets = cms.EDProducer("SeedingLayersEDProducer", | ||
BPix = cms.PSet( | ||
useErrorsFromParam = cms.bool( True ), | ||
hitErrorRPhi = cms.double( 0.0027 ), | ||
TTRHBuilder = cms.string( "hltESPTTRHBuilderPixelOnly" ), | ||
HitProducer = cms.string( "hltSiPixelRecHits" ), | ||
hitErrorRZ = cms.double( 0.006 ) | ||
), | ||
FPix = cms.PSet( | ||
useErrorsFromParam = cms.bool( True ), | ||
hitErrorRPhi = cms.double( 0.0051 ), | ||
TTRHBuilder = cms.string( "hltESPTTRHBuilderPixelOnly" ), | ||
HitProducer = cms.string( "hltSiPixelRecHits" ), | ||
hitErrorRZ = cms.double( 0.0036 ) | ||
), | ||
MTEC = cms.PSet( ), | ||
MTIB = cms.PSet( ), | ||
MTID = cms.PSet( ), | ||
MTOB = cms.PSet( ), | ||
TEC = cms.PSet( ), | ||
TIB = cms.PSet( ), | ||
TID = cms.PSet( ), | ||
TOB = cms.PSet( ), | ||
layerList = cms.vstring( | ||
'BPix1+BPix2+BPix3+BPix4', | ||
'BPix1+BPix2+BPix3+FPix1_pos', | ||
'BPix1+BPix2+BPix3+FPix1_neg', | ||
'BPix1+BPix2+FPix1_pos+FPix2_pos', | ||
'BPix1+BPix2+FPix1_neg+FPix2_neg', | ||
'BPix1+FPix1_pos+FPix2_pos+FPix3_pos', | ||
'BPix1+FPix1_neg+FPix2_neg+FPix3_neg' | ||
) | ||
) | ||
|
||
|
||
|
||
|
||
|
||
# Configure seed generator / pixel track producer | ||
from RecoPixelVertexing.PixelTriplets.CAHitQuadrupletGenerator_cfi import CAHitQuadrupletGenerator as _CAHitQuadrupletGenerator | ||
|
||
process.hltPixelTracks.OrderedHitsFactoryPSet = _CAHitQuadrupletGenerator.clone( | ||
ComponentName = cms.string("CAHitQuadrupletGenerator"), | ||
extraHitRPhitolerance = cms.double(0.032), | ||
maxChi2 = dict( | ||
pt1 = 0.7, pt2 = 2, | ||
value1 = 200, value2 = 50, | ||
enabled = True, | ||
), | ||
useBendingCorrection = True, | ||
fitFastCircle = True, | ||
fitFastCircleChi2Cut = True, | ||
SeedingLayers = cms.InputTag("hltPixelLayerQuadruplets"), | ||
CAThetaCut = cms.double(0.0012), | ||
CAPhiCut = cms.double(0.2), | ||
CAHardPtCut = cms.double(0), | ||
SeedComparitorPSet = cms.PSet( | ||
ComponentName = cms.string( "LowPtClusterShapeSeedComparitor" ), | ||
clusterShapeCacheSrc = cms.InputTag( "hltSiPixelClustersCache" ) | ||
), | ||
|
||
) | ||
|
||
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.HLTDoRecoPixelTracksSequence = cms.Sequence( process.hltPixelLayerQuadruplets + process.hltPixelTracks ) | ||
|
||
process.HLTIter0PSetTrajectoryFilterIT.minimumNumberOfHits = cms.int32( 4 ) | ||
process.HLTIter0PSetTrajectoryFilterIT.minHitsMinPt = cms.int32( 4 ) | ||
process.hltIter0PFlowTrackCutClassifier.mva.minLayers = cms.vint32( 3, 3, 4 ) | ||
process.hltIter0PFlowTrackCutClassifier.mva.min3DLayers = cms.vint32( 0, 3, 4 ) | ||
process.hltIter0PFlowTrackCutClassifier.mva.minPixelHits = cms.vint32( 0, 3, 4 ) | ||
|
||
|
||
|
||
|
||
process.hltIter1PixelLayerTriplets = cms.EDProducer( "SeedingLayersEDProducer", | ||
layerList = cms.vstring( | ||
'BPix1+BPix2+BPix3', | ||
'BPix1+BPix2+FPix1_pos', | ||
'BPix1+BPix2+FPix1_neg', | ||
'BPix1+FPix1_pos+FPix2_pos', | ||
'BPix1+FPix1_neg+FPix2_neg' | ||
), | ||
MTOB = cms.PSet( ), | ||
TEC = cms.PSet( ), | ||
MTID = cms.PSet( ), | ||
FPix = cms.PSet( | ||
HitProducer = cms.string( "hltSiPixelRecHits" ), | ||
hitErrorRZ = cms.double( 0.0036 ), | ||
useErrorsFromParam = cms.bool( True ), | ||
TTRHBuilder = cms.string( "hltESPTTRHBuilderPixelOnly" ), | ||
skipClusters = cms.InputTag( "hltIter1ClustersRefRemoval" ), | ||
hitErrorRPhi = cms.double( 0.0051 ) | ||
), | ||
MTEC = cms.PSet( ), | ||
MTIB = cms.PSet( ), | ||
TID = cms.PSet( ), | ||
TOB = cms.PSet( ), | ||
BPix = cms.PSet( | ||
HitProducer = cms.string( "hltSiPixelRecHits" ), | ||
hitErrorRZ = cms.double( 0.006 ), | ||
useErrorsFromParam = cms.bool( True ), | ||
TTRHBuilder = cms.string( "hltESPTTRHBuilderPixelOnly" ), | ||
skipClusters = cms.InputTag( "hltIter1ClustersRefRemoval" ), | ||
hitErrorRPhi = cms.double( 0.0027 ) | ||
), | ||
TIB = cms.PSet( ) | ||
) | ||
|
||
process.HLTIter1PSetTrajectoryFilterIT = cms.PSet( | ||
ComponentType = cms.string('CkfBaseTrajectoryFilter'), | ||
chargeSignificance = cms.double(-1.0), | ||
constantValueForLostHitsFractionFilter = cms.double(2.0), | ||
extraNumberOfHitsBeforeTheFirstLoop = cms.int32(4), | ||
maxCCCLostHits = cms.int32(0), # offline (2), | ||
maxConsecLostHits = cms.int32(1), | ||
maxLostHits = cms.int32(1), # offline (999), | ||
maxLostHitsFraction = cms.double(0.1), | ||
maxNumberOfHits = cms.int32(100), | ||
minGoodStripCharge = cms.PSet( refToPSet_ = cms.string( "HLTSiStripClusterChargeCutNone" ) ), | ||
minHitsMinPt = cms.int32(3), | ||
minNumberOfHitsForLoopers = cms.int32(13), | ||
minNumberOfHitsPerLoop = cms.int32(4), | ||
minPt = cms.double(0.2), | ||
minimumNumberOfHits = cms.int32(4), # 3 online | ||
nSigmaMinPt = cms.double(5.0), | ||
pixelSeedExtension = cms.bool(True), | ||
seedExtension = cms.int32(1), | ||
seedPairPenalty = cms.int32(0), | ||
strictSeedExtension = cms.bool(True) | ||
) | ||
|
||
process.HLTIter1PSetTrajectoryFilterInOutIT = cms.PSet( | ||
ComponentType = cms.string('CkfBaseTrajectoryFilter'), | ||
chargeSignificance = cms.double(-1.0), | ||
constantValueForLostHitsFractionFilter = cms.double(2.0), | ||
extraNumberOfHitsBeforeTheFirstLoop = cms.int32(4), | ||
maxCCCLostHits = cms.int32(0), # offline (2), | ||
maxConsecLostHits = cms.int32(1), | ||
maxLostHits = cms.int32(1), # offline (999), | ||
maxLostHitsFraction = cms.double(0.1), | ||
maxNumberOfHits = cms.int32(100), | ||
minGoodStripCharge = cms.PSet( refToPSet_ = cms.string( "HLTSiStripClusterChargeCutNone" ) ), | ||
minHitsMinPt = cms.int32(3), | ||
minNumberOfHitsForLoopers = cms.int32(13), | ||
minNumberOfHitsPerLoop = cms.int32(4), | ||
minPt = cms.double(0.2), | ||
minimumNumberOfHits = cms.int32(4), # 3 online | ||
nSigmaMinPt = cms.double(5.0), | ||
pixelSeedExtension = cms.bool(True), | ||
seedExtension = cms.int32(1), | ||
seedPairPenalty = cms.int32(0), | ||
strictSeedExtension = cms.bool(True) | ||
) | ||
|
||
process.HLTIter1PSetTrajectoryBuilderIT = cms.PSet( | ||
inOutTrajectoryFilter = cms.PSet( refToPSet_ = cms.string('HLTIter1PSetTrajectoryFilterInOutIT') ), | ||
propagatorAlong = cms.string( "PropagatorWithMaterialParabolicMf" ), | ||
trajectoryFilter = cms.PSet( refToPSet_ = cms.string( "HLTIter1PSetTrajectoryFilterIT" ) ), | ||
maxCand = cms.int32( 2 ), | ||
ComponentType = cms.string( "CkfTrajectoryBuilder" ), | ||
propagatorOpposite = cms.string( "PropagatorWithMaterialParabolicMfOpposite" ), | ||
MeasurementTrackerName = cms.string( "hltIter1ESPMeasurementTracker" ), | ||
estimator = cms.string( "hltESPChi2ChargeMeasurementEstimator16" ), | ||
TTRHBuilder = cms.string( "hltESPTTRHBWithTrackAngle" ), | ||
updator = cms.string( "hltESPKFUpdator" ), | ||
alwaysUseInvalidHits = cms.bool( False ), | ||
intermediateCleaning = cms.bool( True ), | ||
lostHitPenalty = cms.double( 30.0 ), | ||
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.hltIter2PixelLayerTriplets = cms.EDProducer( "SeedingLayersEDProducer", | ||
layerList = cms.vstring( | ||
'BPix1+BPix2+BPix3', | ||
'BPix1+BPix2+FPix1_pos', | ||
'BPix1+BPix2+FPix1_neg', | ||
'BPix1+FPix1_pos+FPix2_pos', | ||
'BPix1+FPix1_neg+FPix2_neg' | ||
), | ||
MTOB = cms.PSet( ), | ||
TEC = cms.PSet( ), | ||
MTID = cms.PSet( ), | ||
FPix = cms.PSet( | ||
HitProducer = cms.string( "hltSiPixelRecHits" ), | ||
hitErrorRZ = cms.double( 0.0036 ), | ||
useErrorsFromParam = cms.bool( True ), | ||
TTRHBuilder = cms.string( "hltESPTTRHBuilderPixelOnly" ), | ||
skipClusters = cms.InputTag( "hltIter2ClustersRefRemoval" ), | ||
hitErrorRPhi = cms.double( 0.0051 ) | ||
), | ||
MTEC = cms.PSet( ), | ||
MTIB = cms.PSet( ), | ||
TID = cms.PSet( ), | ||
TOB = cms.PSet( ), | ||
BPix = cms.PSet( | ||
HitProducer = cms.string( "hltSiPixelRecHits" ), | ||
hitErrorRZ = cms.double( 0.006 ), | ||
useErrorsFromParam = cms.bool( True ), | ||
TTRHBuilder = cms.string( "hltESPTTRHBuilderPixelOnly" ), | ||
skipClusters = cms.InputTag( "hltIter2ClustersRefRemoval" ), | ||
hitErrorRPhi = cms.double( 0.0027 ) | ||
), | ||
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" ) | ||
) | ||
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 ) | ||
|
||
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) | ||
return process |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
|
||
def customizeHLTPhaseIPixelGeom(process): | ||
|
||
process.ClusterShapeHitFilterESProducer.PixelShapeFile = 'RecoPixelVertexing/PixelLowPtUtilities/data/pixelShape_Phase1TkNewFPix.par' | ||
process.hltSiPixelDigis.UsePhase1 = cms.bool( True ) | ||
process.hltSiPixelDigisRegForBTag.UsePhase1 = cms.bool( True ) | ||
process.hltSiPixelDigisReg.UsePhase1 = cms.bool( True ) | ||
|
||
|
||
return process |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And a more general comment. Could we have some central place to to put all these nice helpers instead of copy-pasting them around?
@Dr15Jones