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",
781 cores = cms.InputTag(
""),
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 cores =
"highPtJetsForTrk" 938 trackValidatorSeedingTrackingOnly = _trackValidatorSeedingBuilding.clone(
939 dirName =
"Tracking/TrackSeeding/",
940 label = _seedSelectors,
942 doResolutionPlotsForLabels = [
"seedTracksjetCoreRegionalStepSeeds" ]
944 seedingDeepCore.toModify(trackValidatorSeedingTrackingOnly, doResolutionPlotsForLabels = [
"seedTracksjetCoreRegionalStepSeedsBarrel",
"seedTracksjetCoreRegionalStepSeedsEndcap"] )
946 trackValidatorSeedingPreSplittingTrackingOnly = trackValidatorSeedingTrackingOnly.clone(
947 associators = [
"quickTrackAssociatorByHitsPreSplitting"],
948 label = _seedSelectorsPreSplitting,
949 doSummaryPlots =
False,
953 trackValidatorJetCoreSeedingTrackingOnly = trackValidatorSeedingTrackingOnly.clone(
954 dirName =
"Tracking/JetCore/TrackSeeding/",
955 associators = [
"trackAssociatorByChi2"],
956 UseAssociators =
True,
960 for _eraName, _postfix, _era
in _relevantEras:
961 if 'jetCoreRegionalStep' in _cfg.iterationAlgos(_postfix) :
962 _setForEra(trackValidatorJetCoreSeedingTrackingOnly, _eraName, _era,
963 label = [
"seedTracksjetCoreRegionalStepSeedsBarrel",
"seedTracksjetCoreRegionalStepSeedsEndcap" ],
964 doResolutionPlotsForLabels = [
"seedTracksjetCoreRegionalStepSeedsBarrel",
"seedTracksjetCoreRegionalStepSeedsEndcap" ]
967 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
968 _setForEra(trackValidatorSeedingTrackingOnly, _eraName, _era, label = locals()[
"_seedSelectors"+_postfix])
969 for _eraName, _postfix, _era
in _relevantEras:
970 _setForEra(trackValidatorSeedingPreSplittingTrackingOnly, _eraName, _era, label = locals()[
"_seedSelectorsPreSplitting"+_postfix])
973 trackValidatorConversionTrackingOnly = trackValidatorConversion.clone(label = [x
for x
in trackValidatorConversion.label
if x
not in [
"ckfInOutTracksFromConversions",
"ckfOutInTracksFromConversions"]])
975 trackValidatorBHadronTrackingOnly = trackValidatorBHadron.clone(label = [x
for x
in trackValidatorTrackingOnly.label
if "Pt09" not in x])
977 trackValidatorTPPtLess09TrackingOnly = trackValidatorTPPtLess09Standalone.clone(cores =
"highPtJetsForTrk")
978 trackValidatorFromPVTrackingOnly = trackValidatorFromPVStandalone.clone(cores =
"highPtJetsForTrk")
979 trackValidatorFromPVAllTPTrackingOnly = trackValidatorFromPVAllTPStandalone.clone(cores =
"highPtJetsForTrk")
980 trackValidatorAllTPEfficTrackingOnly = trackValidatorAllTPEfficStandalone.clone(cores =
"highPtJetsForTrk")
982 tracksPreValidationTrackingOnly = tracksPreValidationStandalone.copy()
983 tracksPreValidationTrackingOnly.replace(tracksValidationSelectors, tracksValidationSelectorsTrackingOnly)
984 tracksPreValidationTrackingOnly.replace(highPtJets,highPtJetsForTrk)
986 trackValidatorsTrackingOnly = _trackValidatorsBase.copy()
987 trackValidatorsTrackingOnly.replace(trackValidatorStandalone, trackValidatorTrackingOnly)
988 trackValidatorsTrackingOnly.replace(trackValidatorTPPtLess09Standalone,trackValidatorTPPtLess09TrackingOnly)
989 trackValidatorsTrackingOnly.replace(trackValidatorFromPVStandalone,trackValidatorFromPVTrackingOnly)
990 trackValidatorsTrackingOnly.replace(trackValidatorFromPVAllTPStandalone,trackValidatorFromPVAllTPTrackingOnly)
991 trackValidatorsTrackingOnly.replace(trackValidatorAllTPEfficStandalone,trackValidatorAllTPEfficTrackingOnly)
992 trackValidatorsTrackingOnly += trackValidatorSeedingTrackingOnly
993 trackValidatorsTrackingOnly += trackValidatorSeedingPreSplittingTrackingOnly
994 trackValidatorsTrackingOnly += trackValidatorBuilding
995 trackValidatorsTrackingOnly += trackValidatorBuildingPreSplitting
996 trackValidatorsTrackingOnly.replace(trackValidatorConversionStandalone, trackValidatorConversionTrackingOnly)
997 trackValidatorsTrackingOnly.remove(trackValidatorGsfTracksStandalone)
998 trackValidatorsTrackingOnly.replace(trackValidatorBHadronStandalone, trackValidatorBHadronTrackingOnly)
1000 seedingDeepCore.toReplaceWith(trackValidatorsTrackingOnly, cms.Sequence(
1001 trackValidatorsTrackingOnly.copy()+
1002 trackValidatorJetCore+
1003 trackValidatorJetCoreSeedingTrackingOnly
1006 phase2_tracker.toReplaceWith(trackValidatorsTrackingOnly, trackValidatorsTrackingOnly.copyAndExclude([
1007 trackValidatorJetCore,
1008 trackValidatorJetCoreSeedingTrackingOnly
1011 displacedTrackValidation.toReplaceWith(trackValidatorsTrackingOnly, cms.Sequence(trackValidatorsTrackingOnly.copy()+trackValidatorDisplaced))
1013 fastSim.toReplaceWith(trackValidatorsTrackingOnly, trackValidatorsTrackingOnly.copyAndExclude([
1014 trackValidatorBuildingPreSplitting,
1015 trackValidatorSeedingPreSplittingTrackingOnly,
1016 trackValidatorConversionTrackingOnly,
1017 trackValidatorBHadronTrackingOnly
1019 tracksValidationTrackingOnly = cms.Sequence(
1020 trackValidatorsTrackingOnly,
1021 tracksPreValidationTrackingOnly,
1022 tracksValidationSelectorsStandalone,
1023 tracksValidationSeedSelectorsTrackingOnly
1027 tracksValidationHIonTrackingOnly = cms.Sequence(
1028 tracksValidation.copy(),
1029 tracksValidationHIonTask
1032 pp_on_AA.toReplaceWith(tracksValidationTrackingOnly,tracksValidationHIonTrackingOnly)
1037 trackingParticlePixelTrackAsssociation = trackingParticleRecoTrackAsssociation.clone(
1038 label_tr =
"pixelTracks",
1039 associator =
"quickTrackAssociatorByHitsPreSplitting",
1041 PixelVertexAssociatorByPositionAndTracks = VertexAssociatorByPositionAndTracks.clone(
1042 trackAssociation =
"trackingParticlePixelTrackAsssociation" 1045 _pixelTracksCustom = dict(
1046 src =
"pixelTracks",
1047 vertexTag =
"pixelVertices",
1050 trackRefSelector = cms.EDFilter(
'TrackRefSelector',
1051 src = cms.InputTag(
'pixelTracks'),
1052 cut = cms.string(
"")
1055 trackSelector = cms.EDFilter(
'TrackSelector',
1056 src = cms.InputTag(
'pixelTracks'),
1057 cut = cms.string(
"")
1060 cutstring =
"hitPattern.trackerLayersWithMeasurement == 3" 1061 pixelTracks3hits = trackRefSelector.clone( cut = cutstring )
1063 cutstring =
"hitPattern.trackerLayersWithMeasurement >= 4" 1064 pixelTracks4hits = trackRefSelector.clone( cut = cutstring )
1066 cutstring =
"pt > 0.9" 1067 pixelTracksPt09 = trackRefSelector.clone( cut = cutstring )
1070 pixelTracksFromPV = generalTracksFromPV.clone(quality =
"highPurity", ptMin = 0.0, ptMax = 99999., ptErrorCut = 99999., copyExtras =
True, **_pixelTracksCustom)
1072 pixelTracksFromPVPt09 = pixelTracksFromPV.clone(ptMin = 0.9)
1074 cutstring =
"hitPattern.trackerLayersWithMeasurement >= 4" 1076 pixelTracksFromPV4hits = pixelTracksFromPV.clone( numberOfValidPixelHits = 4 )
1079 trackValidatorPixelTrackingOnly = trackValidator.clone(
1080 dirName =
"Tracking/PixelTrack/",
1082 "pixelTracks",
"pixelTracksPt09",
"pixelTracks3hits",
"pixelTracks4hits",
1083 "pixelTracksL",
"pixelTracksPt09L",
"pixelTracks3hitsL",
"pixelTracks4hitsL",
1084 "pixelTracksT",
"pixelTracksPt09T",
"pixelTracks3hitsT",
"pixelTracks4hitsT",
1085 "pixelTracksHP",
"pixelTracksPt09HP",
"pixelTracks3hitsHP",
"pixelTracks4hitsHP",
1087 doResolutionPlotsForLabels = [],
1088 trackCollectionForDrCalculation =
"pixelTracks",
1089 associators = [
"trackingParticlePixelTrackAsssociation"],
1090 label_vertex =
"pixelVertices",
1091 vertexAssociator =
"PixelVertexAssociatorByPositionAndTracks",
1092 dodEdxPlots =
False,
1093 cores = cms.InputTag(
"")
1096 trackValidatorFromPVPixelTrackingOnly = trackValidatorPixelTrackingOnly.clone(
1097 dirName =
"Tracking/PixelTrackFromPV/",
1099 "pixelTracksFromPV",
"pixelTracksFromPVPt09",
"pixelTracksFromPV4hits",
1100 "pixelTracksFromPVL",
"pixelTracksFromPVT",
"pixelTracksFromPVHP",
1101 "pixelTracksFromPVPt09L",
"pixelTracksFromPVPt09T",
"pixelTracksFromPVPt09HP",
1102 "pixelTracksFromPV4hitsL",
"pixelTracksFromPV4hitsT",
"pixelTracksFromPV4hitsHP",
1104 label_tp_effic =
"trackingParticlesSignal",
1105 label_tp_fake =
"trackingParticlesSignal",
1106 label_tp_effic_refvector =
True,
1107 label_tp_fake_refvector =
True,
1108 trackCollectionForDrCalculation =
"pixelTracksFromPV",
1109 doPlotsOnlyForTruePV =
True,
1110 doPVAssociationPlots =
False,
1111 doResolutionPlotsForLabels = [
"disabled"],
1113 trackValidatorFromPVAllTPPixelTrackingOnly = trackValidatorFromPVPixelTrackingOnly.clone(
1114 dirName =
"Tracking/PixelTrackFromPVAllTP/",
1115 label_tp_effic = trackValidatorPixelTrackingOnly.label_tp_effic.value(),
1116 label_tp_fake = trackValidatorPixelTrackingOnly.label_tp_fake.value(),
1117 label_tp_effic_refvector =
False,
1118 label_tp_fake_refvector =
False,
1120 doSimTrackPlots =
False,
1122 trackValidatorBHadronPixelTrackingOnly = trackValidatorPixelTrackingOnly.clone(
1123 dirName =
"Tracking/PixelTrackBHadron/",
1125 "pixelTracks",
"pixelTracksPt09",
1126 "pixelTracksL",
"pixelTracks3hitsL",
"pixelTracks4hitsL",
1127 "pixelTracksT",
"pixelTracks3hitsT",
"pixelTracks4hitsT",
1128 "pixelTracksHP",
"pixelTracks3hitsHP",
"pixelTracks4hitsHP",
1130 label_tp_effic =
"trackingParticlesBHadron",
1131 label_tp_effic_refvector =
True,
1133 doRecoTrackPlots =
False,
1134 dodEdxPlots =
False,
1137 tracksValidationTruthPixelTrackingOnly = tracksValidationTruth.copy()
1138 tracksValidationTruthPixelTrackingOnly.replace(trackingParticleRecoTrackAsssociation, trackingParticlePixelTrackAsssociation)
1139 tracksValidationTruthPixelTrackingOnly.replace(VertexAssociatorByPositionAndTracks, PixelVertexAssociatorByPositionAndTracks)
1140 tracksValidationTruthPixelTrackingOnly.add(trackingParticlesBHadron)
1141 tracksValidationTruthPixelTrackingOnly.add( pixelTracks3hits )
1142 tracksValidationTruthPixelTrackingOnly.add( pixelTracks4hits )
1143 tracksValidationTruthPixelTrackingOnly.add( pixelTracksPt09 )
1144 tracksValidationTruthPixelTrackingOnly.add( pixelTracksFromPV )
1145 tracksValidationTruthPixelTrackingOnly.add( pixelTracksFromPVPt09 )
1146 tracksValidationTruthPixelTrackingOnly.add( pixelTracksFromPV4hits )
1148 tracksPreValidationPixelTrackingOnly = cms.Task(
1149 tracksValidationTruthPixelTrackingOnly,
1150 trackingParticlesSignal)
1154 "L" : (1,
"loose", [
"loose",
"tight",
"highPurity"]),
1155 "T" : (2,
"tight", [
"tight",
"highPurity"]),
1156 "HP" : (4,
"highPurity",[
"highPurity"]),
1159 for key,value
in quality.items():
1160 qualityName = value[1]
1161 qualityBit = value[0]
1162 qualityList = value[2]
1164 label =
"pixelTracks"+
str(key)
1165 cutstring =
"qualityMask <= 7 & qualityMask >= " +
str(qualityBit)
1166 locals()[label] = trackRefSelector.clone( cut = cutstring )
1167 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1169 label =
"pixelTracksFromPV"+key
1171 locals()[label] = pixelTracksFromPV.clone( quality = qualityName )
1172 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1174 cutstring =
"pt > 0.9 & qualityMask <= 7 & qualityMask >= " +
str(qualityBit)
1175 label =
"pixelTracksPt09"+key
1176 locals()[label] = trackRefSelector.clone( cut = cutstring )
1177 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1179 label =
"pixelTracksFromPVPt09"+key
1181 locals()[label] = pixelTracksFromPVPt09.clone( quality = qualityName )
1182 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1184 label =
"pixelTracks4hits"+key
1185 cutstring =
"hitPattern.trackerLayersWithMeasurement >= 4 & qualityMask <= 7 & qualityMask >= " +
str(qualityBit)
1186 locals()[label] = trackRefSelector.clone( cut = cutstring )
1187 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1189 label =
"pixelTracksFromPV4hits"+key
1191 locals()[label] = pixelTracksFromPV4hits.clone( quality = qualityName )
1192 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1194 label =
"pixelTracks3hits"+key
1195 cutstring =
"hitPattern.trackerLayersWithMeasurement == 3 & qualityMask <= 7 & qualityMask >= " +
str(qualityBit)
1196 locals()[label] = trackRefSelector.clone( cut = cutstring )
1197 tracksPreValidationPixelTrackingOnly.add(locals()[label])
1199 tracksValidationPixelTrackingOnly = cms.Sequence(
1200 trackValidatorPixelTrackingOnly +
1201 trackValidatorFromPVPixelTrackingOnly +
1202 trackValidatorFromPVAllTPPixelTrackingOnly +
1203 trackValidatorBHadronPixelTrackingOnly,
1204 tracksPreValidationPixelTrackingOnly
1209 trackValidatorLite = trackValidator.clone(
1210 label = [
"generalTracks",
"cutsRecoTracksHp"]
1212 tracksValidationLite = cms.Sequence(
1215 tracksValidationTruth
1219 from Configuration.Eras.Modifier_phase2_timing_layer_cff
import phase2_timing_layer
1220 phase2_timing_layer.toModify( generalTracksFromPV,
1221 timesTag = cms.InputTag(
'tofPID:t0'),
1222 timeResosTag = cms.InputTag(
'tofPID:sigmat0'),
1223 nSigmaDtVertex = cms.double(3) )
1224 phase2_timing_layer.toModify( trackValidatorStandalone,
1225 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
1226 phase2_timing_layer.toModify( trackValidatorFromPVStandalone,
1227 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
1228 phase2_timing_layer.toModify( trackValidatorFromPVAllTPStandalone,
1229 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
1230 phase2_timing_layer.toModify( trackValidatorConversionStandalone,
1231 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
1232 phase2_timing_layer.toModify( trackValidatorGsfTracks,
1233 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)