Skip to content

Commit

Permalink
Merge pull request #30556 from jeongeun/syntax112Xup
Browse files Browse the repository at this point in the history
drop type specs in RecoTracker/{DeDx,FinalTrackSelectors}
  • Loading branch information
cmsbuild authored Jul 7, 2020
2 parents bc66282 + 6bb406b commit 7618222
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 206 deletions.
5 changes: 3 additions & 2 deletions RecoTracker/DeDx/python/dedxEstimatorsFromRefitter_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

from RecoTracker.TrackProducer.TrackRefitter_cfi import *

RefitterForDeDx = TrackRefitter.clone()
RefitterForDeDx.TrajectoryInEvent = True
RefitterForDeDx = TrackRefitter.clone(
TrajectoryInEvent = True
)

from RecoTracker.DeDx.dedxEstimators_cff import *

Expand Down
36 changes: 12 additions & 24 deletions RecoTracker/DeDx/python/dedxEstimators_Cosmics_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,31 @@

from RecoTracker.DeDx.dedxEstimators_cff import *

dedxHitInfoCTF = dedxHitInfo.clone()
dedxHitInfoCTF.tracks = cms.InputTag("ctfWithMaterialTracksP5")
dedxHitInfoCTF = dedxHitInfo.clone( tracks = "ctfWithMaterialTracksP5")

dedxTruncated40CTF = dedxTruncated40.clone()
dedxTruncated40CTF.tracks = cms.InputTag("ctfWithMaterialTracksP5")
dedxTruncated40CTF = dedxTruncated40.clone( tracks = "ctfWithMaterialTracksP5")

dedxHarmonic2CTF = dedxHarmonic2.clone()
dedxHarmonic2CTF.tracks = cms.InputTag("ctfWithMaterialTracksP5")
dedxHarmonic2CTF = dedxHarmonic2.clone( tracks = "ctfWithMaterialTracksP5")

dedxDiscrimASmiCTF = dedxDiscrimASmi.clone()
dedxDiscrimASmiCTF.tracks = cms.InputTag("ctfWithMaterialTracksP5")
dedxDiscrimASmiCTF = dedxDiscrimASmi.clone( tracks = "ctfWithMaterialTracksP5")

#TF
dedxHitInfoCosmicTF = dedxHitInfo.clone()
dedxHitInfoCosmicTF.tracks = cms.InputTag("cosmictrackfinderP5")
dedxHitInfoCosmicTF = dedxHitInfo.clone( tracks = "cosmictrackfinderP5")

dedxTruncated40CosmicTF = dedxTruncated40.clone()
dedxTruncated40CosmicTF.tracks = cms.InputTag("cosmictrackfinderP5")
dedxTruncated40CosmicTF = dedxTruncated40.clone( tracks = "cosmictrackfinderP5")

dedxHarmonic2CosmicTF = dedxHarmonic2.clone()
dedxHarmonic2CosmicTF.tracks = cms.InputTag("cosmictrackfinderP5")
dedxHarmonic2CosmicTF = dedxHarmonic2.clone( tracks = "cosmictrackfinderP5")

dedxDiscrimASmiCosmicTF = dedxDiscrimASmi.clone()
dedxDiscrimASmiCosmicTF.tracks = cms.InputTag("cosmictrackfinderP5")
dedxDiscrimASmiCosmicTF = dedxDiscrimASmi.clone( tracks = "cosmictrackfinderP5")

#CTF P5 LHC
dedxHitInfoCTFP5LHC = dedxHitInfo.clone()
dedxHitInfoCTFP5LHC.tracks = cms.InputTag("ctfWithMaterialTracksP5LHCNavigation")
dedxHitInfoCTFP5LHC = dedxHitInfo.clone( tracks = "ctfWithMaterialTracksP5LHCNavigation")

dedxTruncated40CTFP5LHC = dedxTruncated40.clone()
dedxTruncated40CTFP5LHC.tracks = cms.InputTag("ctfWithMaterialTracksP5LHCNavigation")
dedxTruncated40CTFP5LHC = dedxTruncated40.clone( tracks = "ctfWithMaterialTracksP5LHCNavigation")

dedxDiscrimASmiCTFP5LHC = dedxDiscrimASmi.clone()
dedxDiscrimASmiCTFP5LHC.tracks = cms.InputTag("ctfWithMaterialTracksP5LHCNavigation")
dedxDiscrimASmiCTFP5LHC = dedxDiscrimASmi.clone( tracks = "ctfWithMaterialTracksP5LHCNavigation")

dedxHarmonic2CTFP5LHC = dedxHarmonic2.clone()
dedxHarmonic2CTFP5LHC.tracks = cms.InputTag("ctfWithMaterialTracksP5LHCNavigation")
dedxHarmonic2CTFP5LHC = dedxHarmonic2.clone( tracks = "ctfWithMaterialTracksP5LHCNavigation")

doAlldEdXEstimatorsCTFTask = cms.Task(dedxTruncated40CTF , dedxHitInfoCTF , dedxHarmonic2CTF)
doAlldEdXEstimatorsCTF = cms.Sequence(doAlldEdXEstimatorsCTFTask)
Expand Down
25 changes: 9 additions & 16 deletions RecoTracker/DeDx/python/dedxEstimators_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
fastSim.toReplaceWith(dedxHarmonic2,
FastSimulation.SimplifiedGeometryPropagator.FastTrackDeDxProducer_cfi.FastTrackDeDxProducer.clone(
ShapeTest = False,
simHit2RecHitMap = cms.InputTag("fastMatchedTrackerRecHits","simHit2RecHitMap"),
simHits = cms.InputTag("fastSimProducer","TrackerHits"),
simHit2RecHitMap = "fastMatchedTrackerRecHits:simHit2RecHitMap",
simHits = "fastSimProducer:TrackerHits",
)
)

Expand All @@ -69,26 +69,19 @@
exponent = -2.0, # Harmonic02
)

dedxTruncated40 = dedxHarmonic2.clone()
dedxTruncated40.estimator = cms.string('truncated')
dedxTruncated40 = dedxHarmonic2.clone(estimator = 'truncated')

dedxMedian = dedxHarmonic2.clone()
dedxMedian.estimator = cms.string('median')
dedxMedian = dedxHarmonic2.clone(estimator = 'median')

dedxUnbinned = dedxHarmonic2.clone()
dedxUnbinned.estimator = cms.string('unbinnedFit')
dedxUnbinned = dedxHarmonic2.clone(estimator = 'unbinnedFit')

dedxDiscrimProd = dedxHarmonic2.clone()
dedxDiscrimProd.estimator = cms.string('productDiscrim')
dedxDiscrimProd = dedxHarmonic2.clone(estimator = 'productDiscrim')

dedxDiscrimBTag = dedxHarmonic2.clone()
dedxDiscrimBTag.estimator = cms.string('btagDiscrim')
dedxDiscrimBTag = dedxHarmonic2.clone(estimator = 'btagDiscrim')

dedxDiscrimSmi = dedxHarmonic2.clone()
dedxDiscrimSmi.estimator = cms.string('smirnovDiscrim')
dedxDiscrimSmi = dedxHarmonic2.clone(estimator = 'smirnovDiscrim')

dedxDiscrimASmi = dedxHarmonic2.clone()
dedxDiscrimASmi.estimator = cms.string('asmirnovDiscrim')
dedxDiscrimASmi = dedxHarmonic2.clone(estimator = 'asmirnovDiscrim')

doAlldEdXEstimatorsTask = cms.Task(dedxTruncated40 , dedxHarmonic2 , dedxPixelHarmonic2 , dedxPixelAndStripHarmonic2T085 , dedxHitInfo)
doAlldEdXEstimators = cms.Sequence(doAlldEdXEstimatorsTask)
Expand Down
3 changes: 1 addition & 2 deletions RecoTracker/DeDx/python/hltDeDxEstimatorProducer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@

from RecoTracker.DeDx.dedxEstimators_cff import *

DeDxEstimatorProducer = dedxHarmonic2.clone()
DeDxEstimatorProducer.tracks=cms.InputTag("hltIter4Merged")
DeDxEstimatorProducer = dedxHarmonic2.clone(tracks = "hltIter4Merged")
74 changes: 38 additions & 36 deletions RecoTracker/FinalTrackSelectors/python/MergeTrackCollections_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,39 @@
MaxChi2 = 100,
)

duplicateTrackCandidates = DuplicateTrackMerger.clone()
duplicateTrackCandidates.source = cms.InputTag("preDuplicateMergingGeneralTracks")
duplicateTrackCandidates.useInnermostState = True
duplicateTrackCandidates.ttrhBuilderName = "WithAngleAndTemplate"
duplicateTrackCandidates.chi2EstimatorName = "duplicateTrackCandidatesChi2Est"

duplicateTrackCandidates = DuplicateTrackMerger.clone(
source = "preDuplicateMergingGeneralTracks",
useInnermostState = True,
ttrhBuilderName = "WithAngleAndTemplate",
chi2EstimatorName = "duplicateTrackCandidatesChi2Est"
)

import RecoTracker.TrackProducer.TrackProducer_cfi
mergedDuplicateTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone()
mergedDuplicateTracks.src = cms.InputTag("duplicateTrackCandidates","candidates")
mergedDuplicateTracks.Fitter='RKFittingSmoother' # no outlier rejection!
mergedDuplicateTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
src = "duplicateTrackCandidates:candidates",
Fitter='RKFittingSmoother' # no outlier rejection!
)

from RecoTracker.FinalTrackSelectors.TrackCutClassifier_cff import *
duplicateTrackClassifier = TrackCutClassifier.clone()
duplicateTrackClassifier.src='mergedDuplicateTracks'
duplicateTrackClassifier.mva.minPixelHits = [0,0,0]
duplicateTrackClassifier.mva.maxChi2 = [9999.,9999.,9999.]
duplicateTrackClassifier.mva.maxChi2n = [10.,1.0,0.4] # [9999.,9999.,9999.]
duplicateTrackClassifier.mva.minLayers = [0,0,0]
duplicateTrackClassifier.mva.min3DLayers = [0,0,0]
duplicateTrackClassifier.mva.maxLostLayers = [99,99,99]

generalTracks = DuplicateListMerger.clone()
generalTracks.originalSource = cms.InputTag("preDuplicateMergingGeneralTracks")
generalTracks.originalMVAVals = cms.InputTag("preDuplicateMergingGeneralTracks","MVAValues")
generalTracks.mergedSource = cms.InputTag("mergedDuplicateTracks")
generalTracks.mergedMVAVals = cms.InputTag("duplicateTrackClassifier","MVAValues")
generalTracks.candidateSource = cms.InputTag("duplicateTrackCandidates","candidates")
generalTracks.candidateComponents = cms.InputTag("duplicateTrackCandidates","candidateMap")
duplicateTrackClassifier = TrackCutClassifier.clone(
src='mergedDuplicateTracks',
mva = dict(
minPixelHits = [0,0,0],
maxChi2 = [9999.,9999.,9999.],
maxChi2n = [10.,1.0,0.4], # [9999.,9999.,9999.]
minLayers = [0,0,0],
min3DLayers = [0,0,0],
maxLostLayers = [99,99,99])
)

generalTracks = DuplicateListMerger.clone(
originalSource = "preDuplicateMergingGeneralTracks",
originalMVAVals = "preDuplicateMergingGeneralTracks:MVAValues",
mergedSource = "mergedDuplicateTracks",
mergedMVAVals = "duplicateTrackClassifier:MVAValues",
candidateSource = "duplicateTrackCandidates:candidates",
candidateComponents = "duplicateTrackCandidates:candidateMap"
)

generalTracksTask = cms.Task(
duplicateTrackCandidates,
Expand All @@ -50,25 +54,23 @@

from Configuration.Eras.Modifier_fastSim_cff import fastSim
fastSim.toReplaceWith(generalTracksTask,
cms.Task(
duplicateTrackCandidates,
mergedDuplicateTracks,
duplicateTrackClassifier
)
cms.Task(duplicateTrackCandidates,
mergedDuplicateTracks,
duplicateTrackClassifier)
)

def _fastSimGeneralTracks(process):
from FastSimulation.Configuration.DigiAliases_cff import loadGeneralTracksAlias
loadGeneralTracksAlias(process)
modifyMergeTrackCollections_fastSimGeneralTracks = fastSim.makeProcessModifier( _fastSimGeneralTracks )

import RecoTracker.FinalTrackSelectors.trackListMerger_cfi
conversionStepTracks = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
TrackProducers = cms.VInputTag(cms.InputTag('convStepTracks')),
hasSelector=cms.vint32(1),
selectedTrackQuals = cms.VInputTag(cms.InputTag("convStepSelector","convStep")
),
TrackProducers = ['convStepTracks'],
hasSelector = [1],
selectedTrackQuals = ['convStepSelector:convStep'],
setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(1), pQual=cms.bool(True) )
),
copyExtras = True,
makeReKeyedSeeds = cms.untracked.bool(False)
)
makeReKeyedSeeds = cms.untracked.bool(False),
)
61 changes: 29 additions & 32 deletions RecoTracker/FinalTrackSelectors/python/classifierTest_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,42 @@
from RecoTracker.FinalTrackSelectors.TrackMVAClassifierPrompt_cfi import *
from RecoTracker.FinalTrackSelectors.TrackMVAClassifierDetached_cfi import *



testTrackClassifier1 = TrackMVAClassifierPrompt.clone()
testTrackClassifier1.src = 'initialStepTracks'
testTrackClassifier1.mva.GBRForestLabel = 'MVASelectorIter0_13TeV'
testTrackClassifier1.qualityCuts = [-0.9,-0.8,-0.7]


testTrackClassifier2 = TrackCutClassifier.clone()
testTrackClassifier2.src = 'initialStepTracks'
testTrackClassifier2.mva.minPixelHits = [0,1,1]

testTrackClassifier1 = TrackMVAClassifierPrompt.clone(
src = 'initialStepTracks',
mva = dict(GBRForestLabel = 'MVASelectorIter0_13TeV'),
qualityCuts = [-0.9,-0.8,-0.7]
)

testTrackClassifier2 = TrackCutClassifier.clone(
src = 'initialStepTracks',
mva = dict(minPixelHits = [0,1,1])
)

from RecoTracker.FinalTrackSelectors.ClassifierMerger_cfi import *
testMergedClassifier = ClassifierMerger.clone()
testMergedClassifier.inputClassifiers=['testTrackClassifier1','testTrackClassifier2']
testMergedClassifier = ClassifierMerger.clone(
inputClassifiers=['testTrackClassifier1','testTrackClassifier2']
)

from RecoTracker.FinalTrackSelectors.TrackCollectionMerger_cfi import *
testTrackMerger = TrackCollectionMerger.clone()
testTrackMerger.trackProducers = ['initialStepTracks']
testTrackMerger.inputClassifiers =['testMergedClassifier']
testTrackMerger.minQuality = 'tight'

testTrackClassifier3 = TrackMVAClassifierDetached.clone()
testTrackClassifier3.src = 'detachedTripletStepTracks'
testTrackClassifier3.mva.GBRForestLabel = 'MVASelectorIter3_13TeV'
testTrackClassifier3.qualityCuts = [-0.5,0.0,0.5]

testTrackMerger = TrackCollectionMerger.clone(
trackProducers = ['initialStepTracks'],
inputClassifiers =['testMergedClassifier'],
minQuality = 'tight'
)

testTrackClassifier3 = TrackMVAClassifierDetached.clone(
src = 'detachedTripletStepTracks',
mva = dict(GBRForestLabel = 'MVASelectorIter3_13TeV'),
qualityCuts = [-0.5,0.0,0.5]
)

from RecoTracker.FinalTrackSelectors.trackAlgoPriorityOrder_cfi import trackAlgoPriorityOrder
from RecoTracker.FinalTrackSelectors.TrackCollectionMerger_cfi import *
testTrackMerger2 = TrackCollectionMerger.clone()
testTrackMerger2.trackProducers = ['initialStepTracks','detachedTripletStepTracks']
testTrackMerger2.inputClassifiers =['testMergedClassifier','testTrackClassifier3']
testTrackMerger2.minQuality = 'tight'




testTrackMerger2 = TrackCollectionMerger.clone(
trackProducers = ['initialStepTracks','detachedTripletStepTracks'],
inputClassifiers =['testMergedClassifier','testTrackClassifier3'],
minQuality = 'tight'
)

testTrackCloning = cms.Sequence(testTrackClassifier1*testTrackClassifier2*testTrackClassifier3*
testMergedClassifier*testTrackMerger*testTrackMerger2)
Loading

0 comments on commit 7618222

Please sign in to comment.