1 import FWCore.ParameterSet.Config
as cms
7 from Validation.RecoTrack.trajectorySeedTracks_cfi
import trajectorySeedTracks
as _trajectorySeedTracks
11 import cutsRecoTracks_cfi
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
28 for _eraName, _postfix, _era
in _cfg.allEras():
29 _seedProd = [
"initialStepSeedsPreSplitting"]
30 _trackProd = [
"initialStepTracksPreSplitting"]
31 if _eraName
in [
"trackingLowPU",
"trackingPhase2PU140"]:
35 locals()[
"_algos"+_postfix] = [
"generalTracks"] + _cfg.iterationAlgos(_postfix) + [
"duplicateMerge"]
36 locals()[
"_seedProducers"+_postfix] = _seedProd + _cfg.seedProducers(_postfix)
37 locals()[
"_trackProducers"+_postfix] = _trackProd + _cfg.trackProducers(_postfix)
39 if _eraName !=
"trackingPhase2PU140":
40 locals()[
"_electronSeedProducers"+_postfix] = [
"tripletElectronSeeds",
"pixelPairElectronSeeds",
"stripPairElectronSeeds"]
42 locals()[
"_electronSeedProducers"+_postfix] = [
"tripletElectronSeeds"]
44 _removeForFastSimSeedProducers =[
"initialStepSeedsPreSplitting",
45 "jetCoreRegionalStepSeeds",
46 "muonSeededSeedsInOut",
47 "muonSeededSeedsOutIn"]
48 _seedProducers_fastSim = [ x
for x
in _seedProducers
if x
not in _removeForFastSimSeedProducers]
50 _removeForFastTrackProducers = [
"initialStepTracksPreSplitting",
51 "jetCoreRegionalStepTracks",
52 "muonSeededTracksInOut",
53 "muonSeededTracksOutIn"]
54 _trackProducers_fastSim = [ x
for x
in _trackProducers
if x
not in _removeForFastTrackProducers]
58 if algo !=
"generalTracks":
59 sel = algo[0].
upper()+algo[1:]
60 return "cutsRecoTracks"+sel
66 if algo ==
"generalTracks":
69 if modName
not in modDict:
70 mod = cutsRecoTracks_cfi.cutsRecoTracks.clone(algorithm=[algo])
71 modDict[modName] = mod
73 mod = modDict[modName]
82 modNameHp = modName+
"Hp" 83 if modNameHp
not in modDict:
84 if algo ==
"generalTracks":
85 mod = cutsRecoTracks_cfi.cutsRecoTracks.clone(quality=[
"highPurity"])
87 mod = modDict[modName].
clone(quality=[
"highPurity"])
88 modDict[modNameHp] = mod
90 mod = modDict[modNameHp]
91 names.append(modNameHp)
97 for modName
in modules:
98 modNameNew = modName.replace(
"cutsRecoTracks",
"cutsRecoTracks"+midfix)
99 if modNameNew
not in modDict:
100 mod = modDict[modName].
clone(src=src)
101 modDict[modNameNew] = mod
103 mod = modDict[modNameNew]
104 names.append(modNameNew)
110 for modName
in modules:
111 if modName[-2:] ==
"Hp":
112 modNameNew = modName[:-2] + midfix +
"Hp" 114 modNameNew = modName + midfix
115 if modNameNew
not in modDict:
116 mod = modDict[modName].
clone()
117 setattr(mod, algoParam, mod.algorithm.value())
119 modDict[modNameNew] = mod
121 mod = modDict[modNameNew]
122 names.append(modNameNew)
128 for seed
in seedProducers:
129 modName =
"seedTracks"+seed
130 if modName
not in modDict:
131 mod = _trajectorySeedTracks.clone(src=seed)
132 modDict[modName] = mod
134 mod = modDict[modName]
135 names.append(modName)
139 _relevantEras = _cfg.allEras()
140 _relevantErasAndFastSim = _relevantEras + [(
"fastSim",
"_fastSim", fastSim)]
144 if isinstance(arg, list):
147 ret.append(modDict[arg+postfix])
149 def _sequenceForEachEra(function, args, names, sequence, modDict, plainArgs=[], modifySequence=None, includeFastSim=False):
150 if sequence[0] !=
"_":
151 raise Exception(
"Sequence name is expected to begin with _")
153 _eras = _relevantErasAndFastSim
if includeFastSim
else _relevantEras
154 for eraName, postfix, _era
in _eras:
156 _args.extend(plainArgs)
157 ret =
function(*_args, modDict=modDict)
159 raise Exception(
"_sequenceForEachEra is expected to return 2 values, but function returned %d" % len(ret))
160 modDict[names+postfix] = ret[0]
161 modDict[sequence+postfix] = ret[1]
164 defaultSequenceName = sequence+_eras[0][0]
165 defaultSequence = modDict[defaultSequenceName]
166 modDict[defaultSequenceName[1:]] = defaultSequence
169 if modifySequence
is not None:
170 for eraName, postfix, _era
in _eras:
174 for _eraName, _postfix, _era
in _eras[1:]:
175 _era.toReplaceWith(defaultSequence, modDict[sequence+_postfix])
178 for key, value
in six.iteritems(kwargs):
179 setattr(module, key, value)
181 era.toModify(module, **kwargs)
185 def _findSeedingLayers(name):
186 prod = getattr(config, name)
187 if hasattr(prod,
"triplets"):
188 if hasattr(prod,
"layerList"):
189 return prod.layerList.refToPSet_.value()
190 return _findSeedingLayers(prod.triplets.getModuleLabel())
191 elif hasattr(prod,
"doublets"):
192 return _findSeedingLayers(prod.doublets.getModuleLabel())
193 label = prod.trackingRegionsSeedingLayers.getModuleLabel()
196 return prod.seedingLayers.getModuleLabel()
198 seedingLayersMerged = []
199 for seedName
in seedProducers:
200 seedProd = getattr(config, seedName)
201 seedingLayersName =
None 203 if hasattr(seedProd,
"OrderedHitsFactoryPSet"):
204 seedingLayersName = seedProd.OrderedHitsFactoryPSet.SeedingLayers.getModuleLabel()
205 elif hasattr(seedProd,
"seedingHitSets"):
206 seedingLayersName = _findSeedingLayers(seedProd.seedingHitSets.getModuleLabel())
207 elif hasattr(seedProd,
"layerList"):
208 seedingLayers = seedProd.layerList.value()
212 if seedingLayersName
is not None:
213 seedingLayers = getattr(config, seedingLayersName).layerList.value()
214 for layerSet
in seedingLayers:
215 if layerSet
not in seedingLayersMerged:
216 seedingLayersMerged.append(layerSet)
218 return seedingLayersMerged
221 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
224 if "_electronSeedProducers"+_postfix
in locals():
225 for _layer
in _getSeedingLayers(locals()[
"_electronSeedProducers"+_postfix], _ElectronSeeds_cff):
226 if _layer
not in _stdLayers:
227 _eleLayers.append(_layer)
229 locals()[
"_seedingLayerSets"+_postfix] = _stdLayers
230 locals()[
"_seedingLayerSetsForElectrons"+_postfix] = _eleLayers
235 mvaSel = _utils.getMVASelectors(postfix)
237 pset = cms.untracked.PSet()
238 for iteration, (trackProducer, classifiers)
in six.iteritems(mvaSel):
239 setattr(pset, trackProducer, cms.untracked.vstring(classifiers))
241 for _eraName, _postfix, _era
in _relevantEras:
245 _sequenceForEachEra(_addSelectorsByAlgo, args=[
"_algos"], names=
"_selectorsByAlgo", sequence=
"_tracksValidationSelectorsByAlgo", modDict=globals())
248 _sequenceForEachEra(_addSelectorsByHp, args=[
"_algos"], names=
"_selectorsByAlgoHp", sequence=
"_tracksValidationSelectorsByAlgoHp", modDict=globals())
251 for _eraName, _postfix, _era
in _relevantEras:
252 locals()[
"_selectorsByAlgoAndHp"+_postfix] = locals()[
"_selectorsByAlgo"+_postfix] + locals()[
"_selectorsByAlgoHp"+_postfix]
254 locals()[
"_selectorsByAlgoAndHpNoGenTk"+_postfix] = [n
for n
in locals()[
"_selectorsByAlgoAndHp"+_postfix]
if n
not in [
"generalTracks",
"cutsRecoTracksHp"]]
256 locals()[
"_selectorsByAlgoAndHpNoGenTkDupMerge"+_postfix] = [n
for n
in locals()[
"_selectorsByAlgoAndHpNoGenTk"+_postfix]
if n
not in [
"cutsRecoTracksDuplicateMerge",
"cutsRecoTracksDuplicateMergeHp"]]
258 args = [
"_selectorsByAlgoAndHpNoGenTkDupMerge"], plainArgs = [
"ByOriginalAlgo",
"originalAlgorithm"],
259 names =
"_selectorsByOriginalAlgo", sequence =
"_tracksValidationSelectorsByOriginalAlgo")
262 for _eraName, _postfix, _era
in _relevantEras:
263 selectors = locals()[
"_selectorsByAlgoHp"+_postfix]
264 locals()[
"_generalTracksHp"+_postfix] = selectors[0]
265 locals()[
"_selectorsByAlgoHp"+_postfix] = selectors[1:]
268 import PhysicsTools.RecoAlgos.btvTracks_cfi
as btvTracks_cfi
269 cutsRecoTracksBtvLike = btvTracks_cfi.btvTrackRefs.clone()
273 ak4JetTracksAssociatorExplicitAll = ak4JTA_cff.ak4JetTracksAssociatorExplicit.clone(
277 import CommonTools.RecoAlgos.jetTracksAssociationToTrackRefs_cfi
as jetTracksAssociationToTrackRefs_cfi
278 cutsRecoTracksAK4PFJets = jetTracksAssociationToTrackRefs_cfi.jetTracksAssociationToTrackRefs.clone(
279 association =
"ak4JetTracksAssociatorExplicitAll",
286 trackingParticlesSignal = _trackingParticleRefSelector.clone(
297 generalTracksPt09 = cutsRecoTracks_cfi.cutsRecoTracks.clone(ptMin=0.9)
300 args=[[
"_generalTracksHp"]],
301 plainArgs=[
"Pt09",
"generalTracksPt09"],
302 names=
"_selectorsPt09", sequence=
"_tracksValidationSelectorsPt09",
303 modifySequence=
lambda seq:seq.insert(0, generalTracksPt09))
307 generalTracksFromPV = _trackWithVertexRefSelector.clone(
308 src =
"generalTracks",
313 vertexTag =
"offlinePrimaryVertices",
321 args=[[
"_generalTracksHp"]],
322 plainArgs=[
"FromPV",
"generalTracksFromPV"],
323 names=
"_selectorsFromPV", sequence=
"_tracksValidationSelectorsFromPV",
324 modifySequence=
lambda seq: seq.insert(0, generalTracksFromPV))
327 generalTracksFromPVPt09 = generalTracksPt09.clone(src=
"generalTracksFromPV")
330 args=[[
"_generalTracksHp"]],
331 plainArgs=[
"FromPVPt09",
"generalTracksFromPVPt09"],
332 names=
"_selectorsFromPVPt09", sequence=
"_tracksValidationSelectorsFromPVPt09",
333 modifySequence=
lambda seq: seq.insert(0, generalTracksFromPVPt09))
336 trackingParticlesConversion = _trackingParticleConversionRefSelector.clone()
339 trackingParticlesElectron = _trackingParticleRefSelector.clone(
350 trackingParticlesBHadron = _trackingParticleBHadronRefSelector.clone()
353 trackValidator = Validation.RecoTrack.MultiTrackValidator_cfi.multiTrackValidator.clone(
354 useLogPt = cms.untracked.bool(
True),
356 doPVAssociationPlots =
True 361 fastSim.toModify(trackValidator,
364 for _eraName, _postfix, _era
in _relevantEras:
366 label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix]] +
367 locals()[
"_selectorsByAlgo"+_postfix] + locals()[
"_selectorsByAlgoHp"+_postfix] +
368 locals()[
"_selectorsByOriginalAlgo"+_postfix] +
369 [
"generalTracksPt09"] + locals()[
"_selectorsPt09"+_postfix] +
371 "cutsRecoTracksBtvLike",
372 "cutsRecoTracksAK4PFJets" 374 doResolutionPlotsForLabels = [
376 locals()[
"_generalTracksHp"+_postfix],
378 "cutsRecoTracksBtvLike",
381 _setForEra(trackValidator.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=locals()[
"_seedingLayerSets"+_postfix])
384 trackValidatorTPPtLess09 = trackValidator.clone(
385 dirName =
"Tracking/TrackTPPtLess09/",
386 label = [x
for x
in trackValidator.label.value()
if (
"Pt09" not in x)
and (
"BtvLike" not in x)
and (
"AK4PFJets" not in x)],
388 histoProducerAlgoBlock =
dict(
389 TpSelectorForEfficiencyVsEta =
dict(ptMin=0.05),
390 TpSelectorForEfficiencyVsPhi =
dict(ptMin=0.05),
391 TpSelectorForEfficiencyVsVTXR =
dict(ptMin=0.05),
392 TpSelectorForEfficiencyVsVTXZ =
dict(ptMin=0.05),
395 doRecoTrackPlots =
False,
396 doResolutionPlotsForLabels = [
"disabled"],
401 trackValidatorFromPV = trackValidator.clone(
402 dirName =
"Tracking/TrackFromPV/",
403 label_tp_effic =
"trackingParticlesSignal",
404 label_tp_fake =
"trackingParticlesSignal",
405 label_tp_effic_refvector =
True,
406 label_tp_fake_refvector =
True,
407 trackCollectionForDrCalculation =
"generalTracksFromPV",
408 doPlotsOnlyForTruePV =
True,
409 doPVAssociationPlots =
False,
410 doResolutionPlotsForLabels = [
"disabled"],
412 for _eraName, _postfix, _era
in _relevantEras:
413 _setForEra(trackValidatorFromPV, _eraName, _era,
414 label = [
"generalTracksFromPV"] + locals()[
"_selectorsFromPV"+_postfix] + [
"generalTracksFromPVPt09"] + locals()[
"_selectorsFromPVPt09"+_postfix],
415 doResolutionPlotsForLabels = []
420 trackValidatorFromPVAllTP = trackValidatorFromPV.clone(
421 dirName =
"Tracking/TrackFromPVAllTP/",
422 label_tp_effic = trackValidator.label_tp_effic.value(),
423 label_tp_fake = trackValidator.label_tp_fake.value(),
424 label_tp_effic_refvector =
False,
425 label_tp_fake_refvector =
False,
427 doSimTrackPlots =
False,
428 doResolutionPlotsForLabels = [
"disabled"],
432 trackValidatorAllTPEffic = trackValidator.clone(
433 dirName =
"Tracking/TrackAllTPEffic/",
434 label = [x
for x
in trackValidator.label.value()
if "Pt09" not in x],
436 doRecoTrackPlots =
True,
437 doPVAssociationPlots =
False,
438 doResolutionPlotsForLabels = [
"disabled"],
440 trackValidatorAllTPEffic.histoProducerAlgoBlock.generalTpSelector.signalOnly =
False 441 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsEta.signalOnly =
False 442 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPhi.signalOnly =
False 443 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPt.signalOnly =
False 444 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXR.signalOnly =
False 445 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXZ.signalOnly =
False 446 for _eraName, _postfix, _era
in _relevantEras:
447 _setForEra(trackValidatorAllTPEffic, _eraName, _era, label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix]])
450 _trackValidatorSeedingBuilding = trackValidator.clone(
451 associators = [
"quickTrackAssociatorByHits"],
452 UseAssociators =
True,
454 doPVAssociationPlots =
False,
456 doResolutionPlotsForLabels = [
"disabled"],
458 trackValidatorBuilding = _trackValidatorSeedingBuilding.clone(
459 dirName =
"Tracking/TrackBuilding/",
462 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
463 _setForEra(trackValidatorBuilding, _eraName, _era, label = locals()[
"_trackProducers"+_postfix])
464 fastSim.toModify(trackValidatorBuilding, doMVAPlots=
False)
465 for _eraName, _postfix, _era
in _relevantEras:
466 _setForEra(trackValidatorBuilding, _eraName, _era, mvaLabels = locals()[
"_mvaSelectors"+_postfix])
470 trackValidatorConversion = trackValidator.clone(
471 dirName =
"Tracking/TrackConversion/",
474 "conversionStepTracks",
475 "ckfInOutTracksFromConversions",
476 "ckfOutInTracksFromConversions",
478 label_tp_effic =
"trackingParticlesConversion",
479 label_tp_effic_refvector =
True,
480 associators = [
"quickTrackAssociatorByHits"],
481 UseAssociators =
True,
484 doPVAssociationPlots =
False,
485 calculateDrSingleCollection =
False,
489 firstLayers = [layerSet.split(
"+")[0]
for layerSet
in layerList]
491 for l
in firstLayers:
496 if l.startswith(
"TEC"):
502 trackValidatorConversion.histoProducerAlgoBlock.seedingLayerSets =
_uniqueFirstLayers(_convLayerPairs.layerList.value())
504 for n
in [
"Eta",
"Phi",
"Pt",
"VTXR",
"VTXZ"]:
505 pset = getattr(trackValidatorConversion.histoProducerAlgoBlock,
"TpSelectorForEfficiencyVs"+n)
506 pset.lip = trackValidatorConversion.lipTP.value()
507 pset.tip = trackValidatorConversion.tipTP.value()
510 trackValidatorGsfTracks = trackValidatorConversion.clone(
511 dirName =
"Tracking/TrackGsf/",
512 label = [
"electronGsfTracks"],
513 label_tp_effic =
"trackingParticlesElectron",
516 for _eraName, _postfix, _era
in _relevantEras:
517 _setForEra(trackValidatorGsfTracks.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=trackValidator.histoProducerAlgoBlock.seedingLayerSets.value()+locals()[
"_seedingLayerSetsForElectrons"+_postfix])
522 trackValidatorBHadron = trackValidator.clone(
523 dirName =
"Tracking/TrackBHadron/",
524 label_tp_effic =
"trackingParticlesBHadron",
525 label_tp_effic_refvector =
True,
527 doRecoTrackPlots =
False,
530 for _eraName, _postfix, _era
in _relevantEras:
531 _setForEra(trackValidatorBHadron, _eraName, _era,
532 label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix],
"cutsRecoTracksBtvLike"]
537 tracksValidationSelectors = cms.Sequence(
538 tracksValidationSelectorsByAlgo +
539 tracksValidationSelectorsByAlgoHp +
540 tracksValidationSelectorsByOriginalAlgo +
541 cutsRecoTracksBtvLike +
542 ak4JetTracksAssociatorExplicitAll +
543 cutsRecoTracksAK4PFJets
545 tracksValidationTruth = cms.Sequence(
547 quickTrackAssociatorByHits +
548 trackingParticleRecoTrackAsssociation +
549 VertexAssociatorByPositionAndTracks +
550 trackingParticleNumberOfLayersProducer
552 fastSim.toModify(tracksValidationTruth,
lambda x: x.remove(tpClusterProducer))
554 tracksPreValidation = cms.Sequence(
555 tracksValidationSelectors +
556 tracksValidationSelectorsPt09 +
557 tracksValidationSelectorsFromPV +
558 tracksValidationSelectorsFromPVPt09 +
559 tracksValidationTruth +
560 cms.ignore(trackingParticlesSignal) +
561 cms.ignore(trackingParticlesElectron) +
562 trackingParticlesConversion
564 fastSim.toReplaceWith(tracksPreValidation, tracksPreValidation.copyAndExclude([
565 trackingParticlesElectron,
566 trackingParticlesConversion,
569 tracksValidation = cms.Sequence(
570 tracksPreValidation +
572 trackValidatorTPPtLess09 +
573 trackValidatorFromPV +
574 trackValidatorFromPVAllTP +
575 trackValidatorAllTPEffic +
576 trackValidatorBuilding +
577 trackValidatorConversion +
578 trackValidatorGsfTracks
580 fastSim.toReplaceWith(tracksValidation, tracksValidation.copyAndExclude([
581 trackValidatorConversion,
582 trackValidatorGsfTracks,
589 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"ByAlgoMask",
"algorithmMaskContains"],
590 names =
"_selectorsByAlgoMask", sequence =
"_tracksValidationSelectorsByAlgoMaskStandalone")
595 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"Pt09",
"generalTracksPt09"],
596 names =
"_selectorsPt09Standalone", sequence =
"_tracksValidationSelectorsPt09Standalone")
601 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"FromPV",
"generalTracksFromPV"],
602 names =
"_selectorsFromPVStandalone", sequence =
"_tracksValidationSelectorsFromPVStandalone")
607 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"FromPVPt09",
"generalTracksFromPVPt09"],
608 names =
"_selectorsFromPVPt09Standalone", sequence =
"_tracksValidationSelectorsFromPVPt09Standalone")
611 trackValidatorStandalone = trackValidator.clone()
612 trackValidatorTPPtLess09Standalone = trackValidatorTPPtLess09.clone()
613 for _eraName, _postfix, _era
in _relevantEras:
614 _setForEra(trackValidatorStandalone, _eraName, _era, label = trackValidator.label + locals()[
"_selectorsByAlgoMask"+_postfix] + locals()[
"_selectorsPt09Standalone"+_postfix])
615 _setForEra(trackValidatorTPPtLess09Standalone, _eraName, _era, label = trackValidatorTPPtLess09.label + locals()[
"_selectorsByAlgoMask"+_postfix] + locals()[
"_selectorsPt09Standalone"+_postfix])
617 trackValidatorFromPVStandalone = trackValidatorFromPV.clone()
618 for _eraName, _postfix, _era
in _relevantEras:
619 _setForEra(trackValidatorFromPVStandalone, _eraName, _era, label = trackValidatorFromPV.label + locals()[
"_selectorsFromPVStandalone"+_postfix] + locals()[
"_selectorsFromPVPt09Standalone"+_postfix])
622 trackValidatorFromPVAllTPStandalone = trackValidatorFromPVAllTP.clone(
623 label = trackValidatorFromPVStandalone.label.value()
625 trackValidatorAllTPEfficStandalone = trackValidatorAllTPEffic.clone(
626 label = [ x
for x
in trackValidator.label.value()
if x
not in [
"cutsRecoTracksBtvLike",
"cutsRecoTracksAK4PFJets"]
and "Pt09" not in x]
629 trackValidatorConversionStandalone = trackValidatorConversion.clone( label = [x
for x
in trackValidatorConversion.label
if x !=
"convStepTracks"])
631 trackValidatorBHadronStandalone = trackValidatorBHadron.clone(label = [x
for x
in trackValidatorStandalone.label
if "Pt09" not in x])
634 tracksPreValidationStandalone = tracksPreValidation.copy()
635 tracksPreValidationStandalone += trackingParticlesBHadron
636 fastSim.toReplaceWith(tracksPreValidationStandalone, tracksPreValidation)
638 tracksValidationSelectorsStandalone = cms.Sequence(
639 tracksValidationSelectorsByAlgoMaskStandalone +
640 tracksValidationSelectorsPt09Standalone +
641 tracksValidationSelectorsFromPVStandalone +
642 tracksValidationSelectorsFromPVPt09Standalone
647 _trackValidatorsBase = cms.Sequence(
648 trackValidatorStandalone +
649 trackValidatorTPPtLess09Standalone +
650 trackValidatorFromPVStandalone +
651 trackValidatorFromPVAllTPStandalone +
652 trackValidatorAllTPEfficStandalone +
653 trackValidatorConversionStandalone +
654 trackValidatorGsfTracks +
655 trackValidatorBHadronStandalone
657 trackValidatorsStandalone = _trackValidatorsBase.copy()
658 fastSim.toModify(trackValidatorsStandalone,
lambda x: x.remove(trackValidatorConversionStandalone) )
660 tracksValidationStandalone = cms.Sequence(
661 ak4PFL1FastL2L3CorrectorChain +
662 tracksPreValidationStandalone +
663 tracksValidationSelectorsStandalone +
664 trackValidatorsStandalone
670 tracksValidationSelectorsTrackingOnly = tracksValidationSelectors.copyAndExclude([ak4JetTracksAssociatorExplicitAll,cutsRecoTracksAK4PFJets])
671 _sequenceForEachEra(_addSeedToTrackProducers, args=[
"_seedProducers"], names=
"_seedSelectors", sequence=
"_tracksValidationSeedSelectorsTrackingOnly", includeFastSim=
True, modDict=globals())
674 trackValidatorTrackingOnly = trackValidatorStandalone.clone(label = [ x
for x
in trackValidatorStandalone.label
if x !=
"cutsRecoTracksAK4PFJets"] )
676 trackValidatorSeedingTrackingOnly = _trackValidatorSeedingBuilding.clone(
677 dirName =
"Tracking/TrackSeeding/",
678 label = _seedSelectors,
681 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
682 _setForEra(trackValidatorSeedingTrackingOnly, _eraName, _era, label = locals()[
"_seedSelectors"+_postfix])
685 trackValidatorConversionTrackingOnly = trackValidatorConversion.clone(label = [x
for x
in trackValidatorConversion.label
if x
not in [
"ckfInOutTracksFromConversions",
"ckfOutInTracksFromConversions"]])
687 trackValidatorBHadronTrackingOnly = trackValidatorBHadron.clone(label = [x
for x
in trackValidatorTrackingOnly.label
if "Pt09" not in x])
690 tracksPreValidationTrackingOnly = tracksPreValidationStandalone.copy()
691 tracksPreValidationTrackingOnly.replace(tracksValidationSelectors, tracksValidationSelectorsTrackingOnly)
693 trackValidatorsTrackingOnly = _trackValidatorsBase.copy()
694 trackValidatorsTrackingOnly.replace(trackValidatorStandalone, trackValidatorTrackingOnly)
695 trackValidatorsTrackingOnly += trackValidatorSeedingTrackingOnly
696 trackValidatorsTrackingOnly += trackValidatorBuilding
697 trackValidatorsTrackingOnly.replace(trackValidatorConversionStandalone, trackValidatorConversionTrackingOnly)
698 trackValidatorsTrackingOnly.remove(trackValidatorGsfTracks)
699 trackValidatorsTrackingOnly.replace(trackValidatorBHadronStandalone, trackValidatorBHadronTrackingOnly)
700 fastSim.toModify(trackValidatorsTrackingOnly,
lambda x: x.remove(trackValidatorConversionTrackingOnly))
701 fastSim.toModify(trackValidatorsTrackingOnly,
lambda x: x.remove(trackValidatorBHadronTrackingOnly))
704 tracksValidationTrackingOnly = cms.Sequence(
705 tracksPreValidationTrackingOnly +
706 tracksValidationSelectorsStandalone +
707 tracksValidationSeedSelectorsTrackingOnly +
708 trackValidatorsTrackingOnly
713 tpClusterProducerPixelTrackingOnly = tpClusterProducer.clone(
714 pixelClusterSrc =
"siPixelClustersPreSplitting" 716 quickTrackAssociatorByHitsPixelTrackingOnly = quickTrackAssociatorByHits.clone(
717 cluster2TPSrc =
"tpClusterProducerPixelTrackingOnly" 719 trackingParticlePixelTrackAsssociation = trackingParticleRecoTrackAsssociation.clone(
720 label_tr =
"pixelTracks",
721 associator =
"quickTrackAssociatorByHitsPixelTrackingOnly",
723 PixelVertexAssociatorByPositionAndTracks = VertexAssociatorByPositionAndTracks.clone(
724 trackAssociation =
"trackingParticlePixelTrackAsssociation" 727 trackValidatorPixelTrackingOnly = trackValidator.clone(
728 dirName =
"Tracking/PixelTrack/",
729 label = [
"pixelTracks"],
730 doResolutionPlotsForLabels = [],
731 trackCollectionForDrCalculation =
"pixelTracks",
732 associators = [
"trackingParticlePixelTrackAsssociation"],
733 label_vertex =
"pixelVertices",
734 vertexAssociator =
"PixelVertexAssociatorByPositionAndTracks",
738 tracksValidationTruthPixelTrackingOnly = tracksValidationTruth.copy()
739 tracksValidationTruthPixelTrackingOnly.replace(tpClusterProducer, tpClusterProducerPixelTrackingOnly)
740 tracksValidationTruthPixelTrackingOnly.replace(quickTrackAssociatorByHits, quickTrackAssociatorByHitsPixelTrackingOnly)
741 tracksValidationTruthPixelTrackingOnly.replace(trackingParticleRecoTrackAsssociation, trackingParticlePixelTrackAsssociation)
742 tracksValidationTruthPixelTrackingOnly.replace(VertexAssociatorByPositionAndTracks, PixelVertexAssociatorByPositionAndTracks)
743 tracksValidationPixelTrackingOnly = cms.Sequence(
744 tracksValidationTruthPixelTrackingOnly +
745 trackValidatorPixelTrackingOnly
750 trackValidatorLite = trackValidator.clone(
751 label = [
"generalTracks",
"cutsRecoTracksHp"]
753 tracksValidationLite = cms.Sequence(
755 tracksValidationTruth +
760 from Configuration.Eras.Modifier_phase2_timing_layer_cff
import phase2_timing_layer
761 phase2_timing_layer.toModify( generalTracksFromPV,
762 vertexTag = cms.InputTag(
'offlinePrimaryVertices4D'),
763 timesTag = cms.InputTag(
'trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel'),
764 timeResosTag = cms.InputTag(
'trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution'),
765 nSigmaDtVertex = cms.double(3) )
766 phase2_timing_layer.toModify( trackValidatorStandalone,
767 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
768 phase2_timing_layer.toModify( trackValidatorFromPVStandalone,
769 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
770 phase2_timing_layer.toModify( trackValidatorFromPVAllTPStandalone,
771 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
772 phase2_timing_layer.toModify( trackValidatorConversionStandalone,
773 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
774 phase2_timing_layer.toModify( trackValidatorGsfTracks,
775 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
def _getMVASelectors(postfix)
def _sequenceForEachEra(function, args, names, sequence, modDict, plainArgs=[], modifySequence=None, includeFastSim=False)
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)