1 import FWCore.ParameterSet.Config
as cms
7 from Validation.RecoTrack.trajectorySeedTracks_cfi
import trajectorySeedTracks
as _trajectorySeedTracks
11 import cutsRecoTracks_cfi
15 from PhysicsTools.RecoAlgos.trackingParticleSelector_cfi
import trackingParticleSelector
as _trackingParticleSelector
16 from CommonTools.RecoAlgos.trackingParticleConversionSelector_cfi
import trackingParticleConversionSelector
as _trackingParticleConversionSelector
18 from CommonTools.RecoAlgos.recoChargedRefCandidateToTrackRefProducer_cfi
import recoChargedRefCandidateToTrackRefProducer
as _recoChargedRefCandidateToTrackRefProducer
20 from Configuration.StandardSequences.Eras
import eras
29 "detachedTripletStep",
33 "jetCoreRegionalStep",
34 "muonSeededStepInOut",
35 "muonSeededStepOutIn",
38 _algosForPhase1Pixel = [
48 "muonSeededStepInOut",
49 "muonSeededStepOutIn",
53 "initialStepSeedsPreSplitting",
55 "detachedTripletStepSeeds",
56 "lowPtTripletStepSeeds",
58 "mixedTripletStepSeedsA",
59 "mixedTripletStepSeedsB",
61 "tobTecStepSeedsPair",
62 "tobTecStepSeedsTripl",
63 "jetCoreRegionalStepSeeds",
64 "muonSeededSeedsInOut",
65 "muonSeededSeedsOutIn",
68 _removeForFastSimSeedProducers =[
"initialStepSeedsPreSplitting",
69 "jetCoreRegionalStepSeeds",
70 "muonSeededSeedsInOut",
71 "muonSeededSeedsOutIn"]
72 _seedProducersForFastSim = [ x
for x
in _seedProducers
if x
not in _removeForFastSimSeedProducers]
75 _seedProducersForPhase1Pixel = [
77 "highPtTripletStepSeeds",
79 "lowPtTripletStepSeeds",
80 "detachedQuadStepSeeds",
81 "mixedTripletStepSeedsA",
82 "mixedTripletStepSeedsB",
85 "muonSeededSeedsInOut",
86 "muonSeededSeedsOutIn",
91 "initialStepTracksPreSplitting",
93 "lowPtTripletStepTracks",
94 "pixelPairStepTracks",
95 "detachedTripletStepTracks",
96 "mixedTripletStepTracks",
97 "pixelLessStepTracks",
99 "jetCoreRegionalStepTracks",
100 "muonSeededTracksInOut",
101 "muonSeededTracksOutIn",
103 _removeForFastTrackProducers = [
"initialStepTracksPreSplitting",
104 "jetCoreRegionalStepTracks",
105 "muonSeededTracksInOut",
106 "muonSeededTracksOutIn"]
107 _trackProducersForFastSim = [ x
for x
in _trackProducers
if x
not in _removeForFastTrackProducers]
109 _trackProducersForPhase1Pixel = [
111 "highPtTripletStepTracks",
112 "lowPtQuadStepTracks",
113 "lowPtTripletStepTracks",
114 "detachedQuadStepTracks",
115 "mixedTripletStepTracks",
116 "pixelPairStepTracks",
118 "muonSeededTracksInOut",
119 "muonSeededTracksOutIn",
124 if algo !=
"generalTracks":
125 sel = algo[0].
upper()+algo[1:]
126 return "cutsRecoTracks"+sel
132 if algo ==
"generalTracks":
135 if modName
not in modDict:
136 mod = cutsRecoTracks_cfi.cutsRecoTracks.clone(algorithm=[algo])
137 modDict[modName] = mod
139 mod = modDict[modName]
140 names.append(modName)
148 modNameHp = modName+
"Hp"
149 if modNameHp
not in modDict:
150 if algo ==
"generalTracks":
151 mod = cutsRecoTracks_cfi.cutsRecoTracks.clone(quality=[
"highPurity"])
153 mod = modDict[modName].
clone(quality=[
"highPurity"])
154 modDict[modNameHp] = mod
156 mod = modDict[modNameHp]
157 names.append(modNameHp)
163 for modName
in modules:
164 modNameNew = modName.replace(
"cutsRecoTracks",
"cutsRecoTracks"+midfix)
165 if modNameNew
not in modDict:
166 mod = modDict[modName].
clone(src=src)
167 modDict[modNameNew] = mod
169 mod = modDict[modNameNew]
170 names.append(modNameNew)
176 for modName
in modules:
177 if modName[-2:] ==
"Hp":
178 modNameNew = modName[:-2] + midfix +
"Hp"
180 modNameNew = modName + midfix
181 if modNameNew
not in modDict:
182 mod = modDict[modName].
clone()
183 setattr(mod, algoParam, mod.algorithm.value())
185 modDict[modNameNew] = mod
187 mod = modDict[modNameNew]
188 names.append(modNameNew)
194 for seed
in seedProducers:
195 modName =
"seedTracks"+seed
196 if modName
not in modDict:
197 mod = _trajectorySeedTracks.clone(src=seed)
198 globals()[modName] = mod
200 mod = modDict[modName]
201 names.append(modName)
206 (_selectorsByAlgo, tracksValidationSelectorsByAlgo) =
_addSelectorsByAlgo(_algos, globals())
207 (_selectorsByAlgo_phase1Pixel, _tracksValidationSelectorsByAlgo_phase1Pixel) =
_addSelectorsByAlgo(_algosForPhase1Pixel, globals())
208 eras.phase1Pixel.toReplaceWith(tracksValidationSelectorsByAlgo, _tracksValidationSelectorsByAlgo_phase1Pixel)
211 (_selectorsByAlgoHp, tracksValidationSelectorsByAlgoHp) =
_addSelectorsByHp(_algos,globals())
212 (_selectorsByAlgoHp_phase1Pixel, _tracksValidationSelectorsByAlgoHp_phase1Pixel) =
_addSelectorsByHp(_algosForPhase1Pixel,globals())
213 eras.phase1Pixel.toReplaceWith(tracksValidationSelectorsByAlgoHp, _tracksValidationSelectorsByAlgoHp_phase1Pixel)
215 _generalTracksHp = _selectorsByAlgoHp[0]
216 _generalTracksHp_phase1Pixel = _selectorsByAlgoHp_phase1Pixel[0]
217 _selectorsByAlgoHp = _selectorsByAlgoHp[1:]
218 _selectorsByAlgoHp_phase1Pixel = _selectorsByAlgoHp_phase1Pixel[1:]
221 import PhysicsTools.RecoAlgos.btvTracks_cfi
as btvTracks_cfi
222 cutsRecoTracksBtvLike = btvTracks_cfi.btvTrackRefs.clone()
226 ak4JetTracksAssociatorExplicitAll = ak4JTA_cff.ak4JetTracksAssociatorExplicit.clone(
230 import CommonTools.RecoAlgos.jetTracksAssociationToTrackRefs_cfi
as jetTracksAssociationToTrackRefs_cfi
231 cutsRecoTracksAK4PFJets = jetTracksAssociationToTrackRefs_cfi.jetTracksAssociationToTrackRefs.clone(
232 association =
"ak4JetTracksAssociatorExplicitAll",
239 trackingParticlesSignal = _trackingParticleSelector.clone(
248 tpClusterProducerSignal = tpClusterProducer.clone(
249 trackingParticleSrc =
"trackingParticlesSignal"
251 quickTrackAssociatorByHitsSignal = quickTrackAssociatorByHits.clone(
252 cluster2TPSrc =
"tpClusterProducerSignal"
254 trackingParticleRecoTrackAsssociationSignal = trackingParticleRecoTrackAsssociation.clone(
255 label_tp =
"trackingParticlesSignal",
256 associator =
"quickTrackAssociatorByHitsSignal"
261 generalTracksFromPV = _trackWithVertexRefSelector.clone(
262 src =
"generalTracks",
267 vertexTag =
"offlinePrimaryVertices",
274 (_selectorsFromPV, tracksValidationSelectorsFromPV) =
_addSelectorsBySrc([_generalTracksHp],
"FromPV",
"generalTracksFromPV", globals())
275 tracksValidationSelectorsFromPV.insert(0, generalTracksFromPV)
276 (_selectorsFromPV_phase1Pixel, _tracksValidationSelectorsFromPV_phase1Pixel) =
_addSelectorsBySrc([_generalTracksHp_phase1Pixel],
"FromPV",
"generalTracksFromPV", globals())
277 _tracksValidationSelectorsFromPV_phase1Pixel.insert(0, generalTracksFromPV)
278 eras.phase1Pixel.toReplaceWith(tracksValidationSelectorsFromPV, _tracksValidationSelectorsFromPV_phase1Pixel)
282 trackingParticlesConversion = _trackingParticleConversionSelector.clone()
283 tpClusterProducerConversion = tpClusterProducer.clone(
284 trackingParticleSrc =
"trackingParticlesConversion",
286 quickTrackAssociatorByHitsConversion = quickTrackAssociatorByHits.clone(
287 cluster2TPSrc =
"tpClusterProducerConversion"
292 trackValidator = Validation.RecoTrack.MultiTrackValidator_cfi.multiTrackValidator.clone(
293 label = [
"generalTracks", _generalTracksHp] + _selectorsByAlgo + _selectorsByAlgoHp + [
294 "cutsRecoTracksBtvLike",
295 "cutsRecoTracksAK4PFJets"],
296 useLogPt = cms.untracked.bool(
True),
298 doPVAssociationPlots =
True
303 eras.fastSim.toModify(trackValidator,
305 eras.phase1Pixel.toModify(trackValidator,
306 label = [
"generalTracks", _generalTracksHp_phase1Pixel] + _selectorsByAlgo_phase1Pixel + _selectorsByAlgoHp_phase1Pixel + [
307 "cutsRecoTracksBtvLike",
308 "cutsRecoTracksAK4PFJets"])
312 trackValidatorFromPV = trackValidator.clone(
313 dirName =
"Tracking/TrackFromPV/",
314 label = [
"generalTracksFromPV"]+_selectorsFromPV,
315 label_tp_effic =
"trackingParticlesSignal",
316 label_tp_fake =
"trackingParticlesSignal",
317 associators = [
"trackingParticleRecoTrackAsssociationSignal"],
318 trackCollectionForDrCalculation =
"generalTracksFromPV",
319 doPlotsOnlyForTruePV =
True,
320 doPVAssociationPlots =
False,
322 eras.phase1Pixel.toModify(trackValidatorFromPV, label = [
"generalTracksFromPV"]+_selectorsFromPV_phase1Pixel)
326 trackValidatorFromPVAllTP = trackValidatorFromPV.clone(
327 dirName =
"Tracking/TrackFromPVAllTP/",
328 label_tp_effic = trackValidator.label_tp_effic.value(),
329 label_tp_fake = trackValidator.label_tp_fake.value(),
330 associators = trackValidator.associators.value(),
332 doSimTrackPlots =
False,
336 trackValidatorAllTPEffic = trackValidator.clone(
337 dirName =
"Tracking/TrackAllTPEffic/",
343 doRecoTrackPlots =
False,
344 doPVAssociationPlots =
False,
346 trackValidatorAllTPEffic.histoProducerAlgoBlock.generalTpSelector.signalOnly =
False
347 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsEta.signalOnly =
False
348 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPhi.signalOnly =
False
349 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPt.signalOnly =
False
350 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXR.signalOnly =
False
351 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXZ.signalOnly =
False
352 eras.phase1Pixel.toModify(trackValidatorAllTPEffic, label = [
"generalTracks", _generalTracksHp_phase1Pixel])
355 trackValidatorConversion = trackValidator.clone(
356 dirName =
"Tracking/TrackConversion/",
359 "conversionStepTracks",
360 "ckfInOutTracksFromConversions",
361 "ckfOutInTracksFromConversions",
363 label_tp_effic =
"trackingParticlesConversion",
364 label_tp_fake =
"trackingParticlesConversion",
365 associators = [
"quickTrackAssociatorByHitsConversion"],
366 UseAssociators =
True,
369 doPVAssociationPlots =
False,
370 calculateDrSingleCollection =
False,
373 for n
in [
"Eta",
"Phi",
"Pt",
"VTXR",
"VTXZ"]:
374 pset = getattr(trackValidatorConversion.histoProducerAlgoBlock,
"TpSelectorForEfficiencyVs"+n)
375 pset.lip = trackValidatorConversion.lipTP.value()
376 pset.tip = trackValidatorConversion.tipTP.value()
380 tracksValidationSelectors = cms.Sequence(
381 tracksValidationSelectorsByAlgo +
382 tracksValidationSelectorsByAlgoHp +
383 cutsRecoTracksBtvLike +
384 ak4JetTracksAssociatorExplicitAll +
385 cutsRecoTracksAK4PFJets
387 tracksValidationTruth = cms.Sequence(
389 quickTrackAssociatorByHits +
390 trackingParticleRecoTrackAsssociation +
391 VertexAssociatorByPositionAndTracks
393 eras.fastSim.toModify(tracksValidationTruth,
lambda x: x.remove(tpClusterProducer))
395 tracksValidationTruthSignal = cms.Sequence(
396 cms.ignore(trackingParticlesSignal) +
397 tpClusterProducerSignal +
398 quickTrackAssociatorByHitsSignal +
399 trackingParticleRecoTrackAsssociationSignal
401 eras.fastSim.toModify(tracksValidationTruthSignal,
lambda x: x.remove(tpClusterProducerSignal))
404 tracksValidationTruthConversion = cms.Sequence(
405 trackingParticlesConversion +
406 tpClusterProducerConversion +
407 quickTrackAssociatorByHitsConversion
410 tracksPreValidation = cms.Sequence(
411 tracksValidationSelectors +
412 tracksValidationSelectorsFromPV +
413 tracksValidationTruth +
414 tracksValidationTruthSignal +
415 tracksValidationTruthConversion
417 eras.fastSim.toModify(tracksPreValidation,
lambda x: x.remove(tracksValidationTruthConversion))
419 tracksValidation = cms.Sequence(
420 tracksPreValidation +
422 trackValidatorFromPV +
423 trackValidatorFromPVAllTP +
424 trackValidatorAllTPEffic +
425 trackValidatorConversion
427 eras.fastSim.toModify(tracksValidation,
lambda x: x.remove(trackValidatorConversion))
433 _selectorsByAlgoAndHp = _selectorsByAlgo+_selectorsByAlgoHp
434 _selectorsByAlgoAndHp_phase1Pixel = _selectorsByAlgo_phase1Pixel+_selectorsByAlgoHp_phase1Pixel
435 (_selectorsByOriginalAlgo, tracksValidationSelectorsByOriginalAlgoStandalone) =
_addSelectorsByOriginalAlgoMask(_selectorsByAlgoAndHp,
"ByOriginalAlgo",
"originalAlgorithm",globals())
436 (_selectorsByOriginalAlgo_phase1Pixel, _tracksValidationSelectorsByOriginalAlgoStandalone_phase1Pixel) =
_addSelectorsByOriginalAlgoMask(_selectorsByAlgoAndHp_phase1Pixel,
"ByOriginalAlgo",
"originalAlgorithm",globals())
437 eras.phase1Pixel.toReplaceWith(tracksValidationSelectorsByOriginalAlgoStandalone, _tracksValidationSelectorsByOriginalAlgoStandalone_phase1Pixel)
439 (_selectorsByAlgoMask, tracksValidationSelectorsByAlgoMaskStandalone) =
_addSelectorsByOriginalAlgoMask(_selectorsByAlgoAndHp,
"ByAlgoMask",
"algorithmMaskContains",globals())
440 (_selectorsByAlgoMask_phase1Pixel, _tracksValidationSelectorsByAlgoMaskStandalone_phase1Pixel) =
_addSelectorsByOriginalAlgoMask(_selectorsByAlgoAndHp_phase1Pixel,
"ByAlgoMask",
"algorithmMaskContains",globals())
441 eras.phase1Pixel.toReplaceWith(tracksValidationSelectorsByAlgoMaskStandalone, _tracksValidationSelectorsByAlgoMaskStandalone_phase1Pixel)
444 (_selectorsFromPVStandalone, tracksValidationSelectorsFromPVStandalone) =
_addSelectorsBySrc(_selectorsByAlgoAndHp,
"FromPV",
"generalTracksFromPV",globals())
445 (_selectorsFromPVStandalone_phase1Pixel, _tracksValidationSelectorsFromPVStandalone_phase1Pixel) =
_addSelectorsBySrc(_selectorsByAlgoAndHp_phase1Pixel,
"FromPV",
"generalTracksFromPV",globals())
446 eras.phase1Pixel.toReplaceWith(tracksValidationSelectorsFromPVStandalone, _tracksValidationSelectorsFromPVStandalone_phase1Pixel)
449 trackValidatorStandalone = trackValidator.clone( label = trackValidator.label+ _selectorsByOriginalAlgo + _selectorsByAlgoMask)
450 eras.phase1Pixel.toModify(trackValidatorStandalone, label = trackValidator.label+ _selectorsByOriginalAlgo_phase1Pixel + _selectorsByAlgoMask_phase1Pixel)
452 trackValidatorFromPVStandalone = trackValidatorFromPV.clone( label = trackValidatorFromPV.label+_selectorsFromPVStandalone)
453 eras.phase1Pixel.toModify(trackValidatorFromPVStandalone, label = trackValidatorFromPV.label+_selectorsFromPVStandalone_phase1Pixel)
455 trackValidatorFromPVAllTPStandalone = trackValidatorFromPVAllTP.clone(
456 label = trackValidatorFromPVStandalone.label.value()
458 trackValidatorAllTPEfficStandalone = trackValidatorAllTPEffic.clone(
459 label = [ x
for x
in trackValidator.label.value()
if x
not in [
"cutsRecoTracksBtvLike",
"cutsRecoTracksAK4PFJets"]]
462 trackValidatorConversionStandalone = trackValidatorConversion.clone( label = [x
for x
in trackValidatorConversion.label
if x !=
"convStepTracks"])
465 tracksValidationSelectorsStandalone = cms.Sequence(
466 tracksValidationSelectorsByOriginalAlgoStandalone +
467 tracksValidationSelectorsByAlgoMaskStandalone +
468 tracksValidationSelectorsFromPVStandalone
473 _trackValidatorsBase = cms.Sequence(
474 trackValidatorStandalone +
475 trackValidatorFromPVStandalone +
476 trackValidatorFromPVAllTPStandalone +
477 trackValidatorAllTPEfficStandalone +
478 trackValidatorConversionStandalone
480 trackValidatorsStandalone = _trackValidatorsBase.copy()
481 eras.fastSim.toModify(trackValidatorsStandalone,
lambda x: x.remove(trackValidatorConversionStandalone) )
483 tracksValidationStandalone = cms.Sequence(
484 ak4PFL1FastL2L3CorrectorChain +
485 tracksPreValidation +
486 tracksValidationSelectorsStandalone +
487 trackValidatorsStandalone
493 tracksValidationSelectorsTrackingOnly = tracksValidationSelectors.copyAndExclude([ak4JetTracksAssociatorExplicitAll,cutsRecoTracksAK4PFJets])
495 (_fastSimSeedSelectors, _fastSimTracksValidationSeedSelectorsTrackingOnly) =
_addSeedToTrackProducers(_seedProducersForFastSim, globals())
496 (_phase1PixelSeedSelectors, _phase1PixelTracksValidationSeedSelectorsTrackingOnly) =
_addSeedToTrackProducers(_seedProducersForPhase1Pixel, globals())
497 eras.fastSim.toReplaceWith(tracksValidationSeedSelectorsTrackingOnly, _fastSimTracksValidationSeedSelectorsTrackingOnly)
498 eras.phase1Pixel.toReplaceWith(tracksValidationSeedSelectorsTrackingOnly, _phase1PixelTracksValidationSeedSelectorsTrackingOnly)
501 trackValidatorTrackingOnly = trackValidatorStandalone.clone(label = [ x
for x
in trackValidatorStandalone.label
if x !=
"cutsRecoTracksAK4PFJets"] )
503 trackValidatorBuildingTrackingOnly = trackValidatorTrackingOnly.clone(
504 dirName =
"Tracking/TrackBuilding/",
505 associators = [
"quickTrackAssociatorByHits"],
506 UseAssociators =
True,
507 label = _trackProducers,
509 doPVAssociationPlots =
False,
513 eras.fastSim.toModify(trackValidatorBuildingTrackingOnly, label = _trackProducersForFastSim )
514 eras.phase1Pixel.toModify(trackValidatorBuildingTrackingOnly, label = _trackProducersForPhase1Pixel)
516 trackValidatorSeedingTrackingOnly = trackValidatorBuildingTrackingOnly.clone(
517 dirName =
"Tracking/TrackSeeding/",
518 label = _seedSelectors,
521 eras.fastSim.toModify(trackValidatorSeedingTrackingOnly, label= _fastSimSeedSelectors)
522 eras.phase1Pixel.toModify(trackValidatorSeedingTrackingOnly, label= _phase1PixelSeedSelectors)
525 trackValidatorConversionTrackingOnly = trackValidatorConversion.clone(label = [x
for x
in trackValidatorConversion.label
if x
not in [
"ckfInOutTracksFromConversions",
"ckfOutInTracksFromConversions"]])
528 tracksPreValidationTrackingOnly = tracksPreValidation.copy()
529 tracksPreValidationTrackingOnly.replace(tracksValidationSelectors, tracksValidationSelectorsTrackingOnly)
531 trackValidatorsTrackingOnly = _trackValidatorsBase.copy()
532 trackValidatorsTrackingOnly.replace(trackValidatorStandalone, trackValidatorTrackingOnly)
533 trackValidatorsTrackingOnly += (
534 trackValidatorSeedingTrackingOnly +
535 trackValidatorBuildingTrackingOnly
537 trackValidatorsTrackingOnly.replace(trackValidatorConversionStandalone, trackValidatorConversionTrackingOnly)
538 eras.fastSim.toModify(trackValidatorsTrackingOnly,
lambda x: x.remove(trackValidatorConversionTrackingOnly))
541 tracksValidationTrackingOnly = cms.Sequence(
542 tracksPreValidationTrackingOnly +
543 tracksValidationSelectorsStandalone +
544 tracksValidationSeedSelectorsTrackingOnly +
545 trackValidatorsTrackingOnly
551 trackValidatorLite = trackValidator.clone(
552 label = [
"generalTracks",
"cutsRecoTracksHp"]
554 tracksValidationLite = cms.Sequence(
556 tracksValidationTruth +
def _addSelectorsByOriginalAlgoMask
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
def _addSeedToTrackProducers