1 from __future__
import absolute_import
2 import FWCore.ParameterSet.Config
as cms
8 from Validation.RecoTrack.trajectorySeedTracks_cfi
import trajectorySeedTracks
as _trajectorySeedTracks
15 from CommonTools.RecoAlgos.trackingParticleRefSelector_cfi
import trackingParticleRefSelector
as _trackingParticleRefSelector
16 from CommonTools.RecoAlgos.trackingParticleConversionRefSelector_cfi
import trackingParticleConversionRefSelector
as _trackingParticleConversionRefSelector
17 from SimTracker.TrackHistory.trackingParticleBHadronRefSelector_cfi
import trackingParticleBHadronRefSelector
as _trackingParticleBHadronRefSelector
19 from CommonTools.RecoAlgos.recoChargedRefCandidateToTrackRefProducer_cfi
import recoChargedRefCandidateToTrackRefProducer
as _recoChargedRefCandidateToTrackRefProducer
21 import RecoTracker.IterativeTracking.iterativeTkConfig
as _cfg
22 import RecoTracker.IterativeTracking.iterativeTkUtils
as _utils
23 from Configuration.Eras.Modifier_fastSim_cff
import fastSim
27 for _eraName, _postfix, _era
in _cfg.allEras():
28 _seedProd = [
"initialStepSeedsPreSplitting"]
29 _trackProd = [
"initialStepTracksPreSplitting"]
30 if _eraName
in [
"trackingLowPU",
"trackingPhase2PU140"]:
34 locals()[
"_algos"+_postfix] = [
"generalTracks"] + _cfg.iterationAlgos(_postfix) + [
"duplicateMerge"]
35 locals()[
"_seedProducersPreSplitting"+_postfix] = _seedProd
36 locals()[
"_trackProducersPreSplitting"+_postfix] = _trackProd
37 locals()[
"_seedProducers"+_postfix] = _cfg.seedProducers(_postfix)
38 locals()[
"_trackProducers"+_postfix] = _cfg.trackProducers(_postfix)
40 if _eraName !=
"trackingPhase2PU140":
41 locals()[
"_electronSeedProducers"+_postfix] = [
"tripletElectronSeeds",
"pixelPairElectronSeeds",
"stripPairElectronSeeds"]
43 locals()[
"_electronSeedProducers"+_postfix] = [
"tripletElectronSeeds"]
45 _removeForFastSimSeedProducers =[
"initialStepSeedsPreSplitting",
46 "jetCoreRegionalStepSeeds",
47 "jetCoreRegionalStepSeedsBarrel",
"jetCoreRegionalStepSeedsEndcap",
48 "displacedRegionalStepSeeds",
49 "muonSeededSeedsInOut",
50 "muonSeededSeedsOutIn"]
52 _seedProducers_fastSim = [ x
for x
in _seedProducers
if x
not in _removeForFastSimSeedProducers]
54 _removeForFastTrackProducers = [
"initialStepTracksPreSplitting",
55 "jetCoreRegionalStepTracks",
56 "displacedRegionalStepTracks",
57 "muonSeededTracksInOut",
58 "muonSeededTracksOutIn"]
59 _trackProducers_fastSim = [ x
for x
in _trackProducers
if x
not in _removeForFastTrackProducers]
63 if algo !=
"generalTracks":
64 sel = algo[0].upper()+algo[1:]
65 return "cutsRecoTracks"+sel
71 if algo ==
"generalTracks":
74 if modName
not in modDict:
75 mod = cutsRecoTracks_cfi.cutsRecoTracks.clone(
79 modDict[modName] = mod
81 mod = modDict[modName]
90 modNameHp = modName+
"Hp" 91 if modNameHp
not in modDict:
92 if algo ==
"generalTracks":
93 mod = cutsRecoTracks_cfi.cutsRecoTracks.clone(quality=[
"highPurity"])
95 mod = modDict[modName].
clone(quality=[
"highPurity"])
96 modDict[modNameHp] = mod
98 mod = modDict[modNameHp]
99 names.append(modNameHp)
105 for modName
in modules:
106 modNameNew = modName.replace(
"cutsRecoTracks",
"cutsRecoTracks"+midfix)
107 if modNameNew
not in modDict:
108 mod = modDict[modName].
clone(src=src)
109 modDict[modNameNew] = mod
111 mod = modDict[modNameNew]
112 names.append(modNameNew)
118 for modName
in modules:
119 if modName[-2:] ==
"Hp":
120 modNameNew = modName[:-2] + midfix +
"Hp" 122 modNameNew = modName + midfix
123 if modNameNew
not in modDict:
124 mod = modDict[modName].
clone()
125 setattr(mod, algoParam, mod.algorithm.value())
127 modDict[modNameNew] = mod
129 mod = modDict[modNameNew]
130 names.append(modNameNew)
136 for seed
in seedProducers:
137 modName =
"seedTracks"+seed
138 if modName
not in modDict:
139 mod = _trajectorySeedTracks.clone(src=seed)
140 modDict[modName] = mod
142 mod = modDict[modName]
143 names.append(modName)
147 _relevantEras = _cfg.allEras()
148 _relevantErasAndFastSim = _relevantEras + [(
"fastSim",
"_fastSim", fastSim)]
152 if isinstance(arg, list):
155 ret.append(modDict[arg+postfix])
157 def _taskForEachEra(function, args, names, task, modDict, plainArgs=[], modifyTask=None, includeFastSim=False):
159 raise Exception(
"Task name is expected to begin with _")
161 _eras = _relevantErasAndFastSim
if includeFastSim
else _relevantEras
162 for eraName, postfix, _era
in _eras:
164 _args.extend(plainArgs)
165 ret =
function(*_args, modDict=modDict)
167 raise Exception(
"_taskForEachEra is expected to return 2 values, but function returned %d" % len(ret))
168 modDict[names+postfix] = ret[0]
169 modDict[task+postfix] = ret[1]
172 defaultTaskName = task+_eras[0][0]
173 defaultTask = modDict[defaultTaskName]
174 modDict[defaultTaskName[1:]] = defaultTask
177 if modifyTask
is not None:
178 for eraName, postfix, _era
in _eras:
182 for _eraName, _postfix, _era
in _eras[1:]:
183 _era.toReplaceWith(defaultTask, modDict[task+_postfix])
186 for key, value
in kwargs.items():
187 setattr(module, key, value)
189 era.toModify(module, **kwargs)
193 def _findSeedingLayers(name):
194 prod = getattr(config, name)
195 if hasattr(prod,
"triplets"):
196 if hasattr(prod,
"layerList"):
197 return prod.layerList.refToPSet_.value()
198 return _findSeedingLayers(prod.triplets.getModuleLabel())
199 elif hasattr(prod,
"doublets"):
200 return _findSeedingLayers(prod.doublets.getModuleLabel())
201 label = prod.trackingRegionsSeedingLayers.getModuleLabel()
204 return prod.seedingLayers.getModuleLabel()
206 seedingLayersMerged = []
207 for seedName
in seedProducers:
208 seedProd = getattr(config, seedName)
209 seedingLayersName =
None 211 if hasattr(seedProd,
"OrderedHitsFactoryPSet"):
212 seedingLayersName = seedProd.OrderedHitsFactoryPSet.SeedingLayers.getModuleLabel()
213 elif hasattr(seedProd,
"seedingHitSets"):
214 seedingLayersName = _findSeedingLayers(seedProd.seedingHitSets.getModuleLabel())
215 elif hasattr(seedProd,
"layerList"):
216 seedingLayers = seedProd.layerList.value()
220 if seedingLayersName
is not None:
221 seedingLayers = getattr(config, seedingLayersName).layerList.value()
222 for layerSet
in seedingLayers:
223 if layerSet
not in seedingLayersMerged:
224 seedingLayersMerged.append(layerSet)
226 return seedingLayersMerged
229 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
232 if "_electronSeedProducers"+_postfix
in locals():
233 for _layer
in _getSeedingLayers(locals()[
"_electronSeedProducers"+_postfix], _ElectronSeeds_cff):
234 if _layer
not in _stdLayers:
235 _eleLayers.append(_layer)
237 locals()[
"_seedingLayerSets"+_postfix] = _stdLayers
238 locals()[
"_seedingLayerSetsForElectrons"+_postfix] = _eleLayers
243 mvaSel = _utils.getMVASelectors(postfix)
245 pset = cms.untracked.PSet()
246 for iteration, (trackProducer, classifiers)
in mvaSel.items():
247 setattr(pset, trackProducer, cms.untracked.vstring(classifiers))
249 for _eraName, _postfix, _era
in _relevantEras:
253 _taskForEachEra(_addSelectorsByAlgo, args=[
"_algos"], names=
"_selectorsByAlgo", task=
"_tracksValidationSelectorsByAlgo", modDict=globals())
256 _taskForEachEra(_addSelectorsByHp, args=[
"_algos"], names=
"_selectorsByAlgoHp", task=
"_tracksValidationSelectorsByAlgoHp", modDict=globals())
259 for _eraName, _postfix, _era
in _relevantEras:
260 locals()[
"_selectorsByAlgoAndHp"+_postfix] = locals()[
"_selectorsByAlgo"+_postfix] + locals()[
"_selectorsByAlgoHp"+_postfix]
262 locals()[
"_selectorsByAlgoAndHpNoGenTk"+_postfix] = [n
for n
in locals()[
"_selectorsByAlgoAndHp"+_postfix]
if n
not in [
"generalTracks",
"cutsRecoTracksHp"]]
264 locals()[
"_selectorsByAlgoAndHpNoGenTkDupMerge"+_postfix] = [n
for n
in locals()[
"_selectorsByAlgoAndHpNoGenTk"+_postfix]
if n
not in [
"cutsRecoTracksDuplicateMerge",
"cutsRecoTracksDuplicateMergeHp"]]
266 args = [
"_selectorsByAlgoAndHpNoGenTkDupMerge"], plainArgs = [
"ByOriginalAlgo",
"originalAlgorithm"],
267 names =
"_selectorsByOriginalAlgo", task =
"_tracksValidationSelectorsByOriginalAlgo")
270 for _eraName, _postfix, _era
in _relevantEras:
271 selectors = locals()[
"_selectorsByAlgoHp"+_postfix]
272 locals()[
"_generalTracksHp"+_postfix] = selectors[0]
273 locals()[
"_selectorsByAlgoHp"+_postfix] = selectors[1:]
276 import PhysicsTools.RecoAlgos.btvTracks_cfi
as btvTracks_cfi
277 cutsRecoTracksBtvLike = btvTracks_cfi.btvTrackRefs.clone()
281 ak4JetTracksAssociatorExplicitAll = ak4JTA_cff.ak4JetTracksAssociatorExplicit.clone(
285 import JetMETCorrections.JetCorrector.jetTracksAssociationToTrackRefs_cfi
as jetTracksAssociationToTrackRefs_cfi
286 cutsRecoTracksAK4PFJets = jetTracksAssociationToTrackRefs_cfi.jetTracksAssociationToTrackRefs.clone(
287 association =
"ak4JetTracksAssociatorExplicitAll",
294 trackingParticlesSignal = _trackingParticleRefSelector.clone(
304 trackingParticlesInTime = trackingParticlesSignal.clone(
310 generalTracksPt09 = cutsRecoTracks_cfi.cutsRecoTracks.clone(ptMin=0.9)
313 args=[[
"_generalTracksHp"]],
314 plainArgs=[
"Pt09",
"generalTracksPt09"],
315 names=
"_selectorsPt09", task=
"_tracksValidationSelectorsPt09",
316 modifyTask=
lambda task:task.add(generalTracksPt09))
320 generalTracksFromPV = _trackWithVertexRefSelector.clone(
321 src =
"generalTracks",
326 vertexTag =
"offlinePrimaryVertices",
334 args=[[
"_generalTracksHp"]],
335 plainArgs=[
"FromPV",
"generalTracksFromPV"],
336 names=
"_selectorsFromPV", task=
"_tracksValidationSelectorsFromPV",
337 modifyTask=
lambda task: task.add(generalTracksFromPV))
340 generalTracksFromPVPt09 = generalTracksPt09.clone(src=
"generalTracksFromPV")
343 args=[[
"_generalTracksHp"]],
344 plainArgs=[
"FromPVPt09",
"generalTracksFromPVPt09"],
345 names=
"_selectorsFromPVPt09", task=
"_tracksValidationSelectorsFromPVPt09",
346 modifyTask=
lambda task: task.add(generalTracksFromPVPt09))
349 trackingParticlesConversion = _trackingParticleConversionRefSelector.clone()
352 trackingParticlesElectron = _trackingParticleRefSelector.clone(
363 highPtJets = cms.EDFilter(
"CandPtrSelector", src = cms.InputTag(
"ak4CaloJets"), cut = cms.string(
"pt()>1000"))
364 highPtJetsForTrk = highPtJets.clone(src =
"ak4CaloJetsForTrk")
367 trackingParticlesBHadron = _trackingParticleBHadronRefSelector.clone()
370 trackValidator = Validation.RecoTrack.MultiTrackValidator_cfi.multiTrackValidator.clone(
371 useLogPt = cms.untracked.bool(
True),
373 doPVAssociationPlots =
True 378 fastSim.toModify(trackValidator,
381 for _eraName, _postfix, _era
in _relevantEras:
383 label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix]] +
384 locals()[
"_selectorsByAlgo"+_postfix] + locals()[
"_selectorsByAlgoHp"+_postfix] +
385 locals()[
"_selectorsByOriginalAlgo"+_postfix] +
386 [
"generalTracksPt09"] + locals()[
"_selectorsPt09"+_postfix] +
388 "cutsRecoTracksBtvLike",
389 "cutsRecoTracksAK4PFJets" 391 doResolutionPlotsForLabels = [
393 locals()[
"_generalTracksHp"+_postfix],
395 "cutsRecoTracksBtvLike",
396 "cutsRecoTracksJetCoreRegionalStepByOriginalAlgo" 399 _setForEra(trackValidator.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=locals()[
"_seedingLayerSets"+_postfix])
402 trackValidatorTPPtLess09 = trackValidator.clone(
403 dirName =
"Tracking/TrackTPPtLess09/",
404 label = [x
for x
in trackValidator.label.value()
if (
"Pt09" not in x)
and (
"BtvLike" not in x)
and (
"AK4PFJets" not in x)],
406 histoProducerAlgoBlock = dict(
407 TpSelectorForEfficiencyVsEta = dict(ptMin=0.05),
408 TpSelectorForEfficiencyVsPhi = dict(ptMin=0.05),
409 TpSelectorForEfficiencyVsVTXR = dict(ptMin=0.05),
410 TpSelectorForEfficiencyVsVTXZ = dict(ptMin=0.05),
413 doRecoTrackPlots =
False,
414 doResolutionPlotsForLabels = [
"disabled"],
418 trackingParticlesEtaGreater2p7 = _trackingParticleRefSelector.clone(
419 signalOnly = cms.bool(
False),
424 invertRapidityCut = cms.bool(
True),
430 generalTracksEtaGreater2p7 = cutsRecoTracks_cfi.cutsRecoTracks.clone(
431 minRapidity = cms.double(-2.7),
432 maxRapidity = cms.double( 2.7),
433 invertRapidityCut = cms.bool(
True)
437 args=[[
"_generalTracksHp"]],
438 plainArgs=[
"EtaGreater2p7",
"generalTracksEtaGreater2p7"],
439 names=
"_selectorsEtaGreater2p7", task=
"_tracksValidationSelectorsEtaGreater2p7",
440 modifyTask=
lambda task: task.add(generalTracksEtaGreater2p7))
443 trackValidatorTPEtaGreater2p7 = trackValidator.clone(
444 dirName =
"Tracking/TrackTPEtaGreater2p7/",
445 label_tp_effic =
"trackingParticlesEtaGreater2p7",
446 label_tp_fake =
"trackingParticlesEtaGreater2p7",
447 label_tp_effic_refvector =
True,
448 label_tp_fake_refvector =
True,
451 minRapidityTP = -2.7,
453 invertRapidityCutTP =
True,
455 histoProducerAlgoBlock = dict(
456 TpSelectorForEfficiencyVsPt = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=
True),
457 TpSelectorForEfficiencyVsEta = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=
True),
458 TpSelectorForEfficiencyVsPhi = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=
True),
459 TpSelectorForEfficiencyVsVTXR = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=
True),
460 TpSelectorForEfficiencyVsVTXZ = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=
True),
461 generalTpSelector = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=
True),
468 doRecoTrackPlots =
True,
469 doResolutionPlotsForLabels = [
"disabled"]
471 for _eraName, _postfix, _era
in _relevantEras:
472 _setForEra(trackValidatorTPEtaGreater2p7, _eraName, _era,
473 label = [
"generalTracksEtaGreater2p7"] + locals()[
"_selectorsEtaGreater2p7"+_postfix] +
474 locals()[
"_selectorsByAlgo"+_postfix] + locals()[
"_selectorsByAlgoHp"+_postfix],
475 doResolutionPlotsForLabels = [
"generalTracksEtaGreater2p7"] + locals()[
"_selectorsEtaGreater2p7"+_postfix]
480 trackValidatorFromPV = trackValidator.clone(
481 dirName =
"Tracking/TrackFromPV/",
482 label_tp_effic =
"trackingParticlesSignal",
483 label_tp_fake =
"trackingParticlesSignal",
484 label_tp_effic_refvector =
True,
485 label_tp_fake_refvector =
True,
486 trackCollectionForDrCalculation =
"generalTracksFromPV",
487 doPlotsOnlyForTruePV =
True,
488 doPVAssociationPlots =
False,
489 doResolutionPlotsForLabels = [
"disabled"],
491 for _eraName, _postfix, _era
in _relevantEras:
492 _setForEra(trackValidatorFromPV, _eraName, _era,
493 label = [
"generalTracksFromPV"] + locals()[
"_selectorsFromPV"+_postfix] + [
"generalTracksFromPVPt09"] + locals()[
"_selectorsFromPVPt09"+_postfix],
494 doResolutionPlotsForLabels = []
499 trackValidatorFromPVAllTP = trackValidatorFromPV.clone(
500 dirName =
"Tracking/TrackFromPVAllTP/",
501 label_tp_effic = trackValidator.label_tp_effic.value(),
502 label_tp_fake = trackValidator.label_tp_fake.value(),
503 label_tp_effic_refvector =
False,
504 label_tp_fake_refvector =
False,
506 doSimTrackPlots =
False,
507 doResolutionPlotsForLabels = [
"disabled"],
511 trackValidatorAllTPEffic = trackValidator.clone(
512 dirName =
"Tracking/TrackAllTPEffic/",
513 label = [x
for x
in trackValidator.label.value()
if "Pt09" not in x],
515 doRecoTrackPlots =
True,
516 doPVAssociationPlots =
False,
517 doResolutionPlotsForLabels = [
"disabled"],
519 trackValidatorAllTPEffic.histoProducerAlgoBlock.generalTpSelector.signalOnly =
False 520 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsEta.signalOnly =
False 521 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPhi.signalOnly =
False 522 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPt.signalOnly =
False 523 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXR.signalOnly =
False 524 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXZ.signalOnly =
False 525 for _eraName, _postfix, _era
in _relevantEras:
526 _setForEra(trackValidatorAllTPEffic, _eraName, _era, label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix]])
529 tpClusterProducerPreSplitting = tpClusterProducer.clone(pixelClusterSrc =
"siPixelClustersPreSplitting")
530 quickTrackAssociatorByHitsPreSplitting = quickTrackAssociatorByHits.clone(cluster2TPSrc =
"tpClusterProducerPreSplitting")
531 _trackValidatorSeedingBuilding = trackValidator.clone(
532 associators = [
"quickTrackAssociatorByHits"],
533 UseAssociators =
True,
535 doPVAssociationPlots =
False,
537 doResolutionPlotsForLabels = [
"disabled"]
539 trackValidatorBuilding = _trackValidatorSeedingBuilding.clone(
540 dirName =
"Tracking/TrackBuilding/",
542 doResolutionPlotsForLabels = [
'jetCoreRegionalStepTracks']
544 trackValidatorBuildingPreSplitting = trackValidatorBuilding.clone(
545 associators = [
"quickTrackAssociatorByHitsPreSplitting"],
547 doSummaryPlots =
False,
549 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
550 _setForEra(trackValidatorBuilding, _eraName, _era, label = locals()[
"_trackProducers"+_postfix])
551 fastSim.toModify(trackValidatorBuilding, doMVAPlots=
False)
552 for _eraName, _postfix, _era
in _relevantEras:
553 _setForEra(trackValidatorBuilding, _eraName, _era, mvaLabels = locals()[
"_mvaSelectors"+_postfix])
554 _setForEra(trackValidatorBuildingPreSplitting, _eraName, _era, label = locals()[
"_trackProducersPreSplitting"+_postfix])
558 trackValidatorConversion = trackValidator.clone(
559 dirName =
"Tracking/TrackConversion/",
562 "conversionStepTracks",
563 "ckfInOutTracksFromConversions",
564 "ckfOutInTracksFromConversions",
566 label_tp_effic =
"trackingParticlesConversion",
567 label_tp_effic_refvector =
True,
568 associators = [
"quickTrackAssociatorByHits"],
569 UseAssociators =
True,
572 doPVAssociationPlots =
False,
573 calculateDrSingleCollection =
False,
577 firstLayers = [layerSet.split(
"+")[0]
for layerSet
in layerList]
579 for l
in firstLayers:
584 if l.startswith(
"TEC"):
590 trackValidatorConversion.histoProducerAlgoBlock.seedingLayerSets =
_uniqueFirstLayers(_convLayerPairs.layerList.value())
592 for n
in [
"Eta",
"Phi",
"Pt",
"VTXR",
"VTXZ"]:
593 pset = getattr(trackValidatorConversion.histoProducerAlgoBlock,
"TpSelectorForEfficiencyVs"+n)
594 pset.lip = trackValidatorConversion.lipTP.value()
595 pset.tip = trackValidatorConversion.tipTP.value()
598 trackValidatorGsfTracks = trackValidatorConversion.clone(
599 dirName =
"Tracking/TrackGsf/",
600 label = [
"electronGsfTracks"],
601 label_tp_effic =
"trackingParticlesElectron",
604 for _eraName, _postfix, _era
in _relevantEras:
605 _setForEra(trackValidatorGsfTracks.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=trackValidator.histoProducerAlgoBlock.seedingLayerSets.value()+locals()[
"_seedingLayerSetsForElectrons"+_postfix])
608 trackValidatorJetCore = trackValidator.clone(
609 dirName =
"Tracking/JetCore/",
610 useLogPt = cms.untracked.bool(
True),
612 associators= [
"trackAssociatorByChi2"],
613 UseAssociators =
True,
614 doPVAssociationPlots =
True,
615 label_tp_effic =
"trackingParticlesInTime",
616 label_tp_fake =
"trackingParticlesInTime",
617 label_tp_effic_refvector =
True,
618 label_tp_fake_refvector =
True,
620 for _eraName, _postfix, _era
in _relevantEras:
621 if 'jetCoreRegionalStep' in _cfg.iterationAlgos(_postfix) :
622 _setForEra(trackValidatorJetCore, _eraName, _era,
623 label = [
"generalTracks",
"jetCoreRegionalStepTracks",
624 "cutsRecoTracksJetCoreRegionalStepByOriginalAlgo",
"cutsRecoTracksJetCoreRegionalStepByOriginalAlgoHp",
625 "cutsRecoTracksJetCoreRegionalStep",
"cutsRecoTracksJetCoreRegionalStepHp"],
626 doResolutionPlotsForLabels =[
"generalTracks",
"jetCoreRegionalStepTracks",
627 "cutsRecoTracksJetCoreRegionalStepByOriginalAlgo",
"cutsRecoTracksJetCoreRegionalStepByOriginalAlgoHp",
628 "cutsRecoTracksJetCoreRegionalStep",
"cutsRecoTracksJetCoreRegionalStepHp"],
632 trackValidatorBHadron = trackValidator.clone(
633 dirName =
"Tracking/TrackBHadron/",
634 label_tp_effic =
"trackingParticlesBHadron",
635 label_tp_effic_refvector =
True,
637 doRecoTrackPlots =
False,
640 for _eraName, _postfix, _era
in _relevantEras:
641 _setForEra(trackValidatorBHadron, _eraName, _era,
642 label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix],
"cutsRecoTracksBtvLike"]
647 trackValidatorDisplaced = trackValidator.clone(
648 dirName =
"Tracking/TrackDisplaced/",
649 label = [x
for x
in trackValidator.label.value()
if (
"Pt09" not in x)
and (
"BtvLike" not in x)
and (
"AK4PFJets" not in x)],
652 invertRapidityCutTP =
False,
653 histoProducerAlgoBlock = dict(
654 TpSelectorForEfficiencyVsPt = dict(ptMin=0.005, signalOnly=
True, tip=1e5, lip=1e5),
655 TpSelectorForEfficiencyVsEta = dict(ptMin=0.005, signalOnly=
True, tip=1e5, lip=1e5),
656 TpSelectorForEfficiencyVsPhi = dict(ptMin=0.005, signalOnly=
True, tip=1e5, lip=1e5),
657 TpSelectorForEfficiencyVsVTXR = dict(ptMin=0.005, signalOnly=
True, tip=1e5, lip=1e5),
658 TpSelectorForEfficiencyVsVTXZ = dict(ptMin=0.005, signalOnly=
True, tip=1e5, lip=1e5),
659 generalTpSelector = dict(ptMin=0.005, signalOnly=
True, tip=1e5, lip=1e5),
673 tracksValidationSelectors = cms.Task(
674 tracksValidationSelectorsByAlgo,
675 tracksValidationSelectorsByAlgoHp,
676 tracksValidationSelectorsByOriginalAlgo,
677 cutsRecoTracksBtvLike,
678 ak4JetTracksAssociatorExplicitAll,
679 cutsRecoTracksAK4PFJets
681 phase2_tracker.toModify(tracksValidationSelectors,
lambda x: x.add(generalTracksEtaGreater2p7))
682 phase2_tracker.toModify(tracksValidationSelectors,
lambda x: x.add(cutsRecoTracksEtaGreater2p7Hp))
687 names=
"_selectorsByAlgo", task=
"_tracksEtaGreater2p7ValidationSelectorsByAlgo" 693 names=
"_selectorsByAlgoHp", task=
"_tracksEtaGreater2p7ValidationSelectorsByAlgoHp" 696 for _eraName, _postfix, _era
in _relevantEras:
697 selectors = locals()[
"_selectorsByAlgoHp"+_postfix]
698 locals()[
"_generalTracksHp"+_postfix] = selectors[0]
699 locals()[
"_selectorsByAlgoHp"+_postfix] = selectors[1:]
701 phase2_tracker.toModify(tracksValidationSelectors,
lambda x: x.add(tracksEtaGreater2p7ValidationSelectorsByAlgo))
702 phase2_tracker.toModify(tracksValidationSelectors,
lambda x: x.add(tracksEtaGreater2p7ValidationSelectorsByAlgoHp))
704 tracksValidationTruth = cms.Task(
706 tpClusterProducerPreSplitting,
707 trackAssociatorByChi2,
708 quickTrackAssociatorByHits,
709 quickTrackAssociatorByHitsPreSplitting,
710 trackingParticleRecoTrackAsssociation,
711 VertexAssociatorByPositionAndTracks,
712 trackingParticleNumberOfLayersProducer
716 from Configuration.ProcessModifiers.pp_on_AA_cff
import pp_on_AA
718 trackingParticleHIPixelTrackAssociation = trackingParticleRecoTrackAsssociation.clone(
719 label_tr =
"hiConformalPixelTracks",
720 associator =
"quickTrackAssociatorByHits",
723 from Configuration.ProcessModifiers.pixelNtupletFit_cff
import pixelNtupletFit
725 pixelNtupletFit.toModify(trackingParticleHIPixelTrackAssociation,
726 associator =
"quickTrackAssociatorByHitsPreSplitting")
728 HIPixelVertexAssociatorByPositionAndTracks = VertexAssociatorByPositionAndTracks.clone(
729 trackAssociation =
"trackingParticleHIPixelTrackAssociation" 732 pp_on_AA.toReplaceWith(tracksValidationTruth, cms.Task(
733 tracksValidationTruth.copy(),
734 trackingParticleHIPixelTrackAssociation,
735 HIPixelVertexAssociatorByPositionAndTracks
737 fastSim.toModify(tracksValidationTruth,
lambda x: x.remove(tpClusterProducer))
739 tracksPreValidation = cms.Task(
741 tracksValidationSelectors,
742 tracksValidationSelectorsPt09,
743 tracksValidationSelectorsFromPV,
744 tracksValidationSelectorsFromPVPt09,
745 tracksValidationTruth,
746 trackingParticlesSignal,
747 trackingParticlesInTime,
748 trackingParticlesElectron,
749 trackingParticlesConversion
751 fastSim.toReplaceWith(tracksPreValidation, tracksPreValidation.copyAndExclude([
752 trackingParticlesElectron,
753 trackingParticlesConversion,
758 tracksValidation = cms.Sequence(
760 trackValidatorTPPtLess09 +
761 trackValidatorFromPV +
762 trackValidatorFromPVAllTP +
763 trackValidatorAllTPEffic +
764 trackValidatorBuilding +
765 trackValidatorBuildingPreSplitting +
766 trackValidatorConversion +
767 trackValidatorGsfTracks,
771 trackValidatorHILowPtConformalValidator = trackValidator.clone(
772 dirName =
"Tracking/HIPixelTrack/",
774 "hiConformalPixelTracks",
776 doResolutionPlotsForLabels = [
"hiConformalPixelTracks"],
777 trackCollectionForDrCalculation =
"hiConformalPixelTracks",
778 associators = [
"trackingParticleHIPixelTrackAssociation"],
779 vertexAssociator =
"HIPixelVertexAssociatorByPositionAndTracks",
784 tracksValidationHIonTask = cms.Task(trackValidatorHILowPtConformalValidator)
786 tracksValidationHIon = cms.Sequence(
787 tracksValidation.copy(),
788 tracksValidationHIonTask
791 pp_on_AA.toReplaceWith(tracksValidation,tracksValidationHIon)
794 from Configuration.ProcessModifiers.seedingDeepCore_cff
import seedingDeepCore
795 seedingDeepCore.toReplaceWith(tracksValidation, cms.Sequence(tracksValidation.copy()+trackValidatorJetCore))
797 from Configuration.ProcessModifiers.displacedTrackValidation_cff
import displacedTrackValidation
798 displacedTrackValidation.toReplaceWith(tracksValidation, cms.Sequence(tracksValidation.copy()+trackValidatorDisplaced))
800 from Configuration.Eras.Modifier_phase2_tracker_cff
import phase2_tracker
801 tracksPreValidationPhase2 = tracksPreValidation.copy()
802 tracksPreValidationPhase2.add(trackingParticlesEtaGreater2p7)
803 phase2_tracker.toReplaceWith(tracksPreValidation, tracksPreValidationPhase2)
805 tracksValidationPhase2 = tracksValidation.copyAndExclude([
806 trackValidatorJetCore
808 tracksValidationPhase2+=trackValidatorTPEtaGreater2p7
809 phase2_tracker.toReplaceWith(tracksValidation, tracksValidationPhase2)
811 fastSim.toReplaceWith(tracksValidation, tracksValidation.copyAndExclude([
812 trackValidatorBuildingPreSplitting,
813 trackValidatorConversion,
814 trackValidatorGsfTracks,
821 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"ByAlgoMask",
"algorithmMaskContains"],
822 names =
"_selectorsByAlgoMask", task =
"_tracksValidationSelectorsByAlgoMaskStandalone")
827 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"Pt09",
"generalTracksPt09"],
828 names =
"_selectorsPt09Standalone", task =
"_tracksValidationSelectorsPt09Standalone")
833 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"FromPV",
"generalTracksFromPV"],
834 names =
"_selectorsFromPVStandalone", task =
"_tracksValidationSelectorsFromPVStandalone")
839 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"FromPVPt09",
"generalTracksFromPVPt09"],
840 names =
"_selectorsFromPVPt09Standalone", task =
"_tracksValidationSelectorsFromPVPt09Standalone")
843 trackValidatorStandalone = trackValidator.clone(
846 trackValidatorTPPtLess09Standalone = trackValidatorTPPtLess09.clone(
849 for _eraName, _postfix, _era
in _relevantEras:
850 _setForEra(trackValidatorStandalone, _eraName, _era, label = trackValidator.label + locals()[
"_selectorsByAlgoMask"+_postfix] + locals()[
"_selectorsPt09Standalone"+_postfix])
851 _setForEra(trackValidatorTPPtLess09Standalone, _eraName, _era, label = trackValidatorTPPtLess09.label + locals()[
"_selectorsByAlgoMask"+_postfix] + locals()[
"_selectorsPt09Standalone"+_postfix])
853 trackValidatorFromPVStandalone = trackValidatorFromPV.clone(
856 for _eraName, _postfix, _era
in _relevantEras:
857 _setForEra(trackValidatorFromPVStandalone, _eraName, _era, label = trackValidatorFromPV.label + locals()[
"_selectorsFromPVStandalone"+_postfix] + locals()[
"_selectorsFromPVPt09Standalone"+_postfix])
860 trackValidatorFromPVAllTPStandalone = trackValidatorFromPVAllTP.clone(
861 label = trackValidatorFromPVStandalone.label.value(),
865 trackValidatorAllTPEfficStandalone = trackValidatorAllTPEffic.clone(
866 label = [ x
for x
in trackValidator.label.value()
if x
not in [
"cutsRecoTracksBtvLike",
"cutsRecoTracksAK4PFJets"]
and "Pt09" not in x],
870 trackValidatorConversionStandalone = trackValidatorConversion.clone(
871 label = [x
for x
in trackValidatorConversion.label
if x !=
"convStepTracks"],
875 trackValidatorBHadronStandalone = trackValidatorBHadron.clone(
876 label = [x
for x
in trackValidatorStandalone.label
if "Pt09" not in x],
880 trackValidatorGsfTracksStandalone = trackValidatorGsfTracks.clone(
885 tracksPreValidationStandalone = tracksPreValidation.copy()
886 tracksPreValidationStandalone.add(trackingParticlesBHadron)
887 tracksPreValidationStandalone.replace(highPtJetsForTrk,highPtJets)
888 fastSim.toReplaceWith(tracksPreValidationStandalone, tracksPreValidation)
890 tracksValidationSelectorsStandalone = cms.Task(
891 tracksValidationSelectorsByAlgoMaskStandalone,
892 tracksValidationSelectorsPt09Standalone,
893 tracksValidationSelectorsFromPVStandalone,
894 tracksValidationSelectorsFromPVPt09Standalone
899 _trackValidatorsBase = cms.Sequence(
900 trackValidatorStandalone +
901 trackValidatorTPPtLess09Standalone +
902 trackValidatorFromPVStandalone +
903 trackValidatorFromPVAllTPStandalone +
904 trackValidatorAllTPEfficStandalone +
905 trackValidatorConversionStandalone +
906 trackValidatorGsfTracksStandalone +
907 trackValidatorBHadronStandalone
910 _trackValidatorsBasePhase2 = _trackValidatorsBase.copy()
911 _trackValidatorsBasePhase2+=trackValidatorTPEtaGreater2p7
912 phase2_tracker.toReplaceWith(_trackValidatorsBase, _trackValidatorsBasePhase2)
914 trackValidatorsStandalone = _trackValidatorsBase.copy()
915 fastSim.toModify(trackValidatorsStandalone,
lambda x: x.remove(trackValidatorConversionStandalone) )
917 tracksValidationStandalone = cms.Sequence(
918 ak4PFL1FastL2L3CorrectorChain +
919 trackValidatorsStandalone,
920 tracksPreValidationStandalone,
921 tracksValidationSelectorsStandalone
927 tracksValidationSelectorsTrackingOnly = tracksValidationSelectors.copyAndExclude([ak4JetTracksAssociatorExplicitAll,cutsRecoTracksAK4PFJets])
928 _taskForEachEra(_addSeedToTrackProducers, args=[
"_seedProducers"], names=
"_seedSelectors", task=
"_tracksValidationSeedSelectorsTrackingOnly", includeFastSim=
True, modDict=globals())
929 _taskForEachEra(_addSeedToTrackProducers, args=[
"_seedProducersPreSplitting"], names=
"_seedSelectorsPreSplitting", task=
"_tracksValidationSeedSelectorsPreSplittingTrackingOnly", modDict=globals())
930 tracksValidationSeedSelectorsTrackingOnly.add(tracksValidationSeedSelectorsPreSplittingTrackingOnly)
933 trackValidatorTrackingOnly = trackValidatorStandalone.clone(
934 label = [ x
for x
in trackValidatorStandalone.label
if x !=
"cutsRecoTracksAK4PFJets"],
935 doResolutionPlotsForLabels = trackValidatorStandalone.doResolutionPlotsForLabels + locals()[
"_selectorsByOriginalAlgo"+_postfix],
936 cores =
"highPtJetsForTrk" 939 trackValidatorSeedingTrackingOnly = _trackValidatorSeedingBuilding.clone(
940 dirName =
"Tracking/TrackSeeding/",
941 label = _seedSelectors,
943 doResolutionPlotsForLabels = [
"seedTracksjetCoreRegionalStepSeeds" ]
945 seedingDeepCore.toModify(trackValidatorSeedingTrackingOnly, doResolutionPlotsForLabels = [
"seedTracksjetCoreRegionalStepSeedsBarrel",
"seedTracksjetCoreRegionalStepSeedsEndcap"] )
947 trackValidatorSeedingPreSplittingTrackingOnly = trackValidatorSeedingTrackingOnly.clone(
948 associators = [
"quickTrackAssociatorByHitsPreSplitting"],
949 label = _seedSelectorsPreSplitting,
950 doSummaryPlots =
False,
954 trackValidatorJetCoreSeedingTrackingOnly = trackValidatorSeedingTrackingOnly.clone(
955 dirName =
"Tracking/JetCore/TrackSeeding/",
956 associators = [
"trackAssociatorByChi2"],
957 UseAssociators =
True,
961 for _eraName, _postfix, _era
in _relevantEras:
962 if 'jetCoreRegionalStep' in _cfg.iterationAlgos(_postfix) :
963 _setForEra(trackValidatorJetCoreSeedingTrackingOnly, _eraName, _era,
964 label = [
"seedTracksjetCoreRegionalStepSeedsBarrel",
"seedTracksjetCoreRegionalStepSeedsEndcap" ],
965 doResolutionPlotsForLabels = [
"seedTracksjetCoreRegionalStepSeedsBarrel",
"seedTracksjetCoreRegionalStepSeedsEndcap" ]
968 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
969 _setForEra(trackValidatorSeedingTrackingOnly, _eraName, _era, label = locals()[
"_seedSelectors"+_postfix])
970 for _eraName, _postfix, _era
in _relevantEras:
971 _setForEra(trackValidatorSeedingPreSplittingTrackingOnly, _eraName, _era, label = locals()[
"_seedSelectorsPreSplitting"+_postfix])
974 trackValidatorConversionTrackingOnly = trackValidatorConversion.clone(label = [x
for x
in trackValidatorConversion.label
if x
not in [
"ckfInOutTracksFromConversions",
"ckfOutInTracksFromConversions"]])
976 trackValidatorBHadronTrackingOnly = trackValidatorBHadron.clone(label = [x
for x
in trackValidatorTrackingOnly.label
if "Pt09" not in x])
978 trackValidatorTPPtLess09TrackingOnly = trackValidatorTPPtLess09Standalone.clone(cores =
"highPtJetsForTrk")
979 trackValidatorFromPVTrackingOnly = trackValidatorFromPVStandalone.clone(cores =
"highPtJetsForTrk")
980 trackValidatorFromPVAllTPTrackingOnly = trackValidatorFromPVAllTPStandalone.clone(cores =
"highPtJetsForTrk")
981 trackValidatorAllTPEfficTrackingOnly = trackValidatorAllTPEfficStandalone.clone(cores =
"highPtJetsForTrk")
983 tracksPreValidationTrackingOnly = tracksPreValidationStandalone.copy()
984 tracksPreValidationTrackingOnly.replace(tracksValidationSelectors, tracksValidationSelectorsTrackingOnly)
985 tracksPreValidationTrackingOnly.replace(highPtJets,highPtJetsForTrk)
987 trackValidatorsTrackingOnly = _trackValidatorsBase.copy()
988 trackValidatorsTrackingOnly.replace(trackValidatorStandalone, trackValidatorTrackingOnly)
989 trackValidatorsTrackingOnly.replace(trackValidatorTPPtLess09Standalone,trackValidatorTPPtLess09TrackingOnly)
990 trackValidatorsTrackingOnly.replace(trackValidatorFromPVStandalone,trackValidatorFromPVTrackingOnly)
991 trackValidatorsTrackingOnly.replace(trackValidatorFromPVAllTPStandalone,trackValidatorFromPVAllTPTrackingOnly)
992 trackValidatorsTrackingOnly.replace(trackValidatorAllTPEfficStandalone,trackValidatorAllTPEfficTrackingOnly)
993 trackValidatorsTrackingOnly += trackValidatorSeedingTrackingOnly
994 trackValidatorsTrackingOnly += trackValidatorSeedingPreSplittingTrackingOnly
995 trackValidatorsTrackingOnly += trackValidatorBuilding
996 trackValidatorsTrackingOnly += trackValidatorBuildingPreSplitting
997 trackValidatorsTrackingOnly.replace(trackValidatorConversionStandalone, trackValidatorConversionTrackingOnly)
998 trackValidatorsTrackingOnly.remove(trackValidatorGsfTracksStandalone)
999 trackValidatorsTrackingOnly.replace(trackValidatorBHadronStandalone, trackValidatorBHadronTrackingOnly)
1001 (seedingDeepCore & ~fastSim).toReplaceWith(trackValidatorsTrackingOnly, cms.Sequence(
1002 trackValidatorsTrackingOnly.copy()+
1003 trackValidatorJetCore+
1004 trackValidatorJetCoreSeedingTrackingOnly
1007 phase2_tracker.toReplaceWith(trackValidatorsTrackingOnly, trackValidatorsTrackingOnly.copyAndExclude([
1008 trackValidatorJetCore,
1009 trackValidatorJetCoreSeedingTrackingOnly
1012 displacedTrackValidation.toReplaceWith(trackValidatorsTrackingOnly, cms.Sequence(trackValidatorsTrackingOnly.copy()+trackValidatorDisplaced))
1014 fastSim.toReplaceWith(trackValidatorsTrackingOnly, trackValidatorsTrackingOnly.copyAndExclude([
1015 trackValidatorBuildingPreSplitting,
1016 trackValidatorSeedingPreSplittingTrackingOnly,
1017 trackValidatorConversionTrackingOnly,
1018 trackValidatorBHadronTrackingOnly
1020 tracksValidationTrackingOnly = cms.Sequence(
1021 trackValidatorsTrackingOnly,
1022 tracksPreValidationTrackingOnly,
1023 tracksValidationSelectorsStandalone,
1024 tracksValidationSeedSelectorsTrackingOnly
1028 tracksValidationHIonTrackingOnly = cms.Sequence(
1029 tracksValidation.copy(),
1030 tracksValidationHIonTask
1033 pp_on_AA.toReplaceWith(tracksValidationTrackingOnly,tracksValidationHIonTrackingOnly)
1038 trackingParticlePixelTrackAsssociation = trackingParticleRecoTrackAsssociation.clone(
1039 label_tr =
"pixelTracks",
1040 associator =
"quickTrackAssociatorByHitsPreSplitting",
1042 PixelVertexAssociatorByPositionAndTracks = VertexAssociatorByPositionAndTracks.clone(
1043 trackAssociation =
"trackingParticlePixelTrackAsssociation" 1046 _pixelTracksCustom = dict(
1047 src =
"pixelTracks",
1048 vertexTag =
"pixelVertices",
1051 trackRefSelector = cms.EDFilter(
'TrackRefSelector',
1052 src = cms.InputTag(
'pixelTracks'),
1053 cut = cms.string(
"")
1056 trackSelector = cms.EDFilter(
'TrackSelector',
1057 src = cms.InputTag(
'pixelTracks'),
1058 cut = cms.string(
"")
1061 cutstring =
"hitPattern.trackerLayersWithMeasurement == 3" 1062 pixelTracks3hits = trackRefSelector.clone( cut = cutstring )
1064 cutstring =
"hitPattern.trackerLayersWithMeasurement >= 4" 1065 pixelTracks4hits = trackRefSelector.clone( cut = cutstring )
1067 cutstring =
"pt > 0.9" 1068 pixelTracksPt09 = trackRefSelector.clone( cut = cutstring )
1071 pixelTracksFromPV = generalTracksFromPV.clone(quality =
"highPurity", ptMin = 0.0, ptMax = 99999., ptErrorCut = 99999., copyExtras =
True, **_pixelTracksCustom)
1073 pixelTracksFromPVPt09 = pixelTracksFromPV.clone(ptMin = 0.9)
1075 cutstring =
"hitPattern.trackerLayersWithMeasurement >= 4" 1077 pixelTracksFromPV4hits = pixelTracksFromPV.clone( numberOfValidPixelHits = 4 )
1080 trackValidatorPixelTrackingOnly = trackValidator.clone(
1081 dirName =
"Tracking/PixelTrack/",
1083 "pixelTracks",
"pixelTracksPt09",
"pixelTracks3hits",
"pixelTracks4hits",
1084 "pixelTracksL",
"pixelTracksPt09L",
"pixelTracks3hitsL",
"pixelTracks4hitsL",
1085 "pixelTracksT",
"pixelTracksPt09T",
"pixelTracks3hitsT",
"pixelTracks4hitsT",
1086 "pixelTracksHP",
"pixelTracksPt09HP",
"pixelTracks3hitsHP",
"pixelTracks4hitsHP",
1088 doResolutionPlotsForLabels = [],
1089 trackCollectionForDrCalculation =
"pixelTracks",
1090 associators = [
"trackingParticlePixelTrackAsssociation"],
1091 label_vertex =
"pixelVertices",
1092 vertexAssociator =
"PixelVertexAssociatorByPositionAndTracks",
1093 dodEdxPlots =
False,
1097 trackValidatorFromPVPixelTrackingOnly = trackValidatorPixelTrackingOnly.clone(
1098 dirName =
"Tracking/PixelTrackFromPV/",
1100 "pixelTracksFromPV",
"pixelTracksFromPVPt09",
"pixelTracksFromPV4hits",
1101 "pixelTracksFromPVL",
"pixelTracksFromPVT",
"pixelTracksFromPVHP",
1102 "pixelTracksFromPVPt09L",
"pixelTracksFromPVPt09T",
"pixelTracksFromPVPt09HP",
1103 "pixelTracksFromPV4hitsL",
"pixelTracksFromPV4hitsT",
"pixelTracksFromPV4hitsHP",
1105 label_tp_effic =
"trackingParticlesSignal",
1106 label_tp_fake =
"trackingParticlesSignal",
1107 label_tp_effic_refvector =
True,
1108 label_tp_fake_refvector =
True,
1109 trackCollectionForDrCalculation =
"pixelTracksFromPV",
1110 doPlotsOnlyForTruePV =
True,
1111 doPVAssociationPlots =
False,
1112 doResolutionPlotsForLabels = [
"disabled"],
1114 trackValidatorFromPVAllTPPixelTrackingOnly = trackValidatorFromPVPixelTrackingOnly.clone(
1115 dirName =
"Tracking/PixelTrackFromPVAllTP/",
1116 label_tp_effic = trackValidatorPixelTrackingOnly.label_tp_effic.value(),
1117 label_tp_fake = trackValidatorPixelTrackingOnly.label_tp_fake.value(),
1118 label_tp_effic_refvector =
False,
1119 label_tp_fake_refvector =
False,
1121 doSimTrackPlots =
False,
1123 trackValidatorBHadronPixelTrackingOnly = trackValidatorPixelTrackingOnly.clone(
1124 dirName =
"Tracking/PixelTrackBHadron/",
1126 "pixelTracks",
"pixelTracksPt09",
1127 "pixelTracksL",
"pixelTracks3hitsL",
"pixelTracks4hitsL",
1128 "pixelTracksT",
"pixelTracks3hitsT",
"pixelTracks4hitsT",
1129 "pixelTracksHP",
"pixelTracks3hitsHP",
"pixelTracks4hitsHP",
1131 label_tp_effic =
"trackingParticlesBHadron",
1132 label_tp_effic_refvector =
True,
1134 doRecoTrackPlots =
False,
1135 dodEdxPlots =
False,
1138 tracksValidationTruthPixelTrackingOnly = tracksValidationTruth.copy()
1139 tracksValidationTruthPixelTrackingOnly.replace(trackingParticleRecoTrackAsssociation, trackingParticlePixelTrackAsssociation)
1140 tracksValidationTruthPixelTrackingOnly.replace(VertexAssociatorByPositionAndTracks, PixelVertexAssociatorByPositionAndTracks)
1141 tracksValidationTruthPixelTrackingOnly.add(trackingParticlesBHadron)
1142 tracksValidationTruthPixelTrackingOnly.add( pixelTracks3hits )
1143 tracksValidationTruthPixelTrackingOnly.add( pixelTracks4hits )
1144 tracksValidationTruthPixelTrackingOnly.add( pixelTracksPt09 )
1145 tracksValidationTruthPixelTrackingOnly.add( pixelTracksFromPV )
1146 tracksValidationTruthPixelTrackingOnly.add( pixelTracksFromPVPt09 )
1147 tracksValidationTruthPixelTrackingOnly.add( pixelTracksFromPV4hits )
1149 tracksPreValidationPixelTrackingOnly = cms.Task(
1150 tracksValidationTruthPixelTrackingOnly,
1151 trackingParticlesSignal)
1155 "L" : (1,
"loose", [
"loose",
"tight",
"highPurity"]),
1156 "T" : (2,
"tight", [
"tight",
"highPurity"]),
1157 "HP" : (4,
"highPurity",[
"highPurity"]),
1160 for key,value
in quality.items():
1161 qualityName = value[1]
1162 qualityBit = value[0]
1163 qualityList = value[2]
1165 label =
"pixelTracks"+
str(key)
1166 cutstring =
"qualityMask <= 7 & qualityMask >= " +
str(qualityBit)
1167 locals()[label] = trackRefSelector.clone( cut = cutstring )
1168 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1170 label =
"pixelTracksFromPV"+key
1172 locals()[label] = pixelTracksFromPV.clone( quality = qualityName )
1173 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1175 cutstring =
"pt > 0.9 & qualityMask <= 7 & qualityMask >= " +
str(qualityBit)
1176 label =
"pixelTracksPt09"+key
1177 locals()[label] = trackRefSelector.clone( cut = cutstring )
1178 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1180 label =
"pixelTracksFromPVPt09"+key
1182 locals()[label] = pixelTracksFromPVPt09.clone( quality = qualityName )
1183 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1185 label =
"pixelTracks4hits"+key
1186 cutstring =
"hitPattern.trackerLayersWithMeasurement >= 4 & qualityMask <= 7 & qualityMask >= " +
str(qualityBit)
1187 locals()[label] = trackRefSelector.clone( cut = cutstring )
1188 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1190 label =
"pixelTracksFromPV4hits"+key
1192 locals()[label] = pixelTracksFromPV4hits.clone( quality = qualityName )
1193 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1195 label =
"pixelTracks3hits"+key
1196 cutstring =
"hitPattern.trackerLayersWithMeasurement == 3 & qualityMask <= 7 & qualityMask >= " +
str(qualityBit)
1197 locals()[label] = trackRefSelector.clone( cut = cutstring )
1198 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1200 tracksValidationPixelTrackingOnly = cms.Sequence(
1201 trackValidatorPixelTrackingOnly +
1202 trackValidatorFromPVPixelTrackingOnly +
1203 trackValidatorFromPVAllTPPixelTrackingOnly +
1204 trackValidatorBHadronPixelTrackingOnly,
1205 tracksPreValidationPixelTrackingOnly
1210 trackValidatorLite = trackValidator.clone(
1211 label = [
"generalTracks",
"cutsRecoTracksHp"]
1213 tracksValidationLite = cms.Sequence(
1216 tracksValidationTruth
1220 from Configuration.Eras.Modifier_phase2_timing_layer_cff
import phase2_timing_layer
1221 phase2_timing_layer.toModify( trackValidatorStandalone,
1222 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
1223 phase2_timing_layer.toModify( trackValidatorFromPVStandalone,
1224 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
1225 phase2_timing_layer.toModify( trackValidatorFromPVAllTPStandalone,
1226 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
1227 phase2_timing_layer.toModify( trackValidatorConversionStandalone,
1228 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
1229 phase2_timing_layer.toModify( trackValidatorGsfTracks,
1230 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
def _getMVASelectors(postfix)
def _setForEra(module, eraName, era, kwargs)
def _translateArgs(args, postfix, modDict)
def _uniqueFirstLayers(layerList)
_addSelectorsByOriginalAlgoMask
Then define stuff for standalone mode (i.e.
def _getSeedingLayers(seedProducers, config)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
def _algoToSelector(algo)
def _taskForEachEra(function, args, names, task, modDict, plainArgs=[], modifyTask=None, includeFastSim=False)