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
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()[
"_seedProducers"+_postfix] = _seedProd + _cfg.seedProducers(_postfix)
36 locals()[
"_trackProducers"+_postfix] = _trackProd + _cfg.trackProducers(_postfix)
38 if _eraName !=
"trackingPhase2PU140":
39 locals()[
"_electronSeedProducers"+_postfix] = [
"tripletElectronSeeds",
"pixelPairElectronSeeds",
"stripPairElectronSeeds"]
41 locals()[
"_electronSeedProducers"+_postfix] = [
"tripletElectronSeeds"]
43 _removeForFastSimSeedProducers =[
"initialStepSeedsPreSplitting",
44 "jetCoreRegionalStepSeeds",
45 "muonSeededSeedsInOut",
46 "muonSeededSeedsOutIn"]
47 _seedProducers_fastSim = [ x
for x
in _seedProducers
if x
not in _removeForFastSimSeedProducers]
49 _removeForFastTrackProducers = [
"initialStepTracksPreSplitting",
50 "jetCoreRegionalStepTracks",
51 "muonSeededTracksInOut",
52 "muonSeededTracksOutIn"]
53 _trackProducers_fastSim = [ x
for x
in _trackProducers
if x
not in _removeForFastTrackProducers]
57 if algo !=
"generalTracks":
58 sel = algo[0].
upper()+algo[1:]
59 return "cutsRecoTracks"+sel
65 if algo ==
"generalTracks":
68 if modName
not in modDict:
69 mod = cutsRecoTracks_cfi.cutsRecoTracks.clone(algorithm=[algo])
70 modDict[modName] = mod
72 mod = modDict[modName]
81 modNameHp = modName+
"Hp" 82 if modNameHp
not in modDict:
83 if algo ==
"generalTracks":
84 mod = cutsRecoTracks_cfi.cutsRecoTracks.clone(quality=[
"highPurity"])
86 mod = modDict[modName].
clone(quality=[
"highPurity"])
87 modDict[modNameHp] = mod
89 mod = modDict[modNameHp]
90 names.append(modNameHp)
96 for modName
in modules:
97 modNameNew = modName.replace(
"cutsRecoTracks",
"cutsRecoTracks"+midfix)
98 if modNameNew
not in modDict:
99 mod = modDict[modName].
clone(src=src)
100 modDict[modNameNew] = mod
102 mod = modDict[modNameNew]
103 names.append(modNameNew)
109 for modName
in modules:
110 if modName[-2:] ==
"Hp":
111 modNameNew = modName[:-2] + midfix +
"Hp" 113 modNameNew = modName + midfix
114 if modNameNew
not in modDict:
115 mod = modDict[modName].
clone()
116 setattr(mod, algoParam, mod.algorithm.value())
118 modDict[modNameNew] = mod
120 mod = modDict[modNameNew]
121 names.append(modNameNew)
127 for seed
in seedProducers:
128 modName =
"seedTracks"+seed
129 if modName
not in modDict:
130 mod = _trajectorySeedTracks.clone(src=seed)
131 modDict[modName] = mod
133 mod = modDict[modName]
134 names.append(modName)
138 _relevantEras = _cfg.allEras()
139 _relevantErasAndFastSim = _relevantEras + [(
"fastSim",
"_fastSim", fastSim)]
143 if isinstance(arg, list):
146 ret.append(modDict[arg+postfix])
148 def _sequenceForEachEra(function, args, names, sequence, modDict, plainArgs=[], modifySequence=None, includeFastSim=False):
149 if sequence[0] !=
"_":
150 raise Exception(
"Sequence name is expected to begin with _")
152 _eras = _relevantErasAndFastSim
if includeFastSim
else _relevantEras
153 for eraName, postfix, _era
in _eras:
155 _args.extend(plainArgs)
156 ret =
function(*_args, modDict=modDict)
158 raise Exception(
"_sequenceForEachEra is expected to return 2 values, but function returned %d" % len(ret))
159 modDict[names+postfix] = ret[0]
160 modDict[sequence+postfix] = ret[1]
163 defaultSequenceName = sequence+_eras[0][0]
164 defaultSequence = modDict[defaultSequenceName]
165 modDict[defaultSequenceName[1:]] = defaultSequence
168 if modifySequence
is not None:
169 for eraName, postfix, _era
in _eras:
173 for _eraName, _postfix, _era
in _eras[1:]:
174 _era.toReplaceWith(defaultSequence, modDict[sequence+_postfix])
177 for key, value
in kwargs.iteritems():
178 setattr(module, key, value)
180 era.toModify(module, **kwargs)
184 def _findSeedingLayers(name):
185 prod = getattr(config, name)
186 if hasattr(prod,
"triplets"):
187 if hasattr(prod,
"layerList"):
188 return prod.layerList.refToPSet_.value()
189 return _findSeedingLayers(prod.triplets.getModuleLabel())
190 elif hasattr(prod,
"doublets"):
191 return _findSeedingLayers(prod.doublets.getModuleLabel())
192 return prod.seedingLayers.getModuleLabel()
194 seedingLayersMerged = []
195 for seedName
in seedProducers:
196 seedProd = getattr(config, seedName)
197 if hasattr(seedProd,
"OrderedHitsFactoryPSet"):
198 seedingLayersName = seedProd.OrderedHitsFactoryPSet.SeedingLayers.getModuleLabel()
199 elif hasattr(seedProd,
"seedingHitSets"):
200 seedingLayersName = _findSeedingLayers(seedProd.seedingHitSets.getModuleLabel())
204 seedingLayers = getattr(config, seedingLayersName).layerList.value()
205 for layerSet
in seedingLayers:
206 if layerSet
not in seedingLayersMerged:
207 seedingLayersMerged.append(layerSet)
208 return seedingLayersMerged
211 for _eraName, _postfix, _era
in _relevantEras:
214 for _layer
in _getSeedingLayers(locals()[
"_electronSeedProducers"+_postfix], _ElectronSeeds_cff):
215 if _layer
not in _stdLayers:
216 _eleLayers.append(_layer)
218 locals()[
"_seedingLayerSets"+_postfix] = _stdLayers
219 locals()[
"_seedingLayerSetsForElectrons"+_postfix] = _eleLayers
224 mvaSel = _utils.getMVASelectors(postfix)
226 pset = cms.untracked.PSet()
227 for iteration, (trackProducer, classifiers)
in mvaSel.iteritems():
228 setattr(pset, trackProducer, cms.untracked.vstring(classifiers))
230 for _eraName, _postfix, _era
in _relevantEras:
234 _sequenceForEachEra(_addSelectorsByAlgo, args=[
"_algos"], names=
"_selectorsByAlgo", sequence=
"_tracksValidationSelectorsByAlgo", modDict=globals())
237 _sequenceForEachEra(_addSelectorsByHp, args=[
"_algos"], names=
"_selectorsByAlgoHp", sequence=
"_tracksValidationSelectorsByAlgoHp", modDict=globals())
240 for _eraName, _postfix, _era
in _relevantEras:
241 locals()[
"_selectorsByAlgoAndHp"+_postfix] = locals()[
"_selectorsByAlgo"+_postfix] + locals()[
"_selectorsByAlgoHp"+_postfix]
243 locals()[
"_selectorsByAlgoAndHpNoGenTk"+_postfix] =
filter(
lambda n: n
not in [
"generalTracks",
"cutsRecoTracksHp"], locals()[
"_selectorsByAlgoAndHp"+_postfix])
245 locals()[
"_selectorsByAlgoAndHpNoGenTkDupMerge"+_postfix] =
filter(
lambda n: n
not in [
"cutsRecoTracksDuplicateMerge",
"cutsRecoTracksDuplicateMergeHp"], locals()[
"_selectorsByAlgoAndHpNoGenTk"+_postfix])
247 args = [
"_selectorsByAlgoAndHpNoGenTkDupMerge"], plainArgs = [
"ByOriginalAlgo",
"originalAlgorithm"],
248 names =
"_selectorsByOriginalAlgo", sequence =
"_tracksValidationSelectorsByOriginalAlgo")
251 for _eraName, _postfix, _era
in _relevantEras:
252 selectors = locals()[
"_selectorsByAlgoHp"+_postfix]
253 locals()[
"_generalTracksHp"+_postfix] = selectors[0]
254 locals()[
"_selectorsByAlgoHp"+_postfix] = selectors[1:]
257 import PhysicsTools.RecoAlgos.btvTracks_cfi
as btvTracks_cfi
258 cutsRecoTracksBtvLike = btvTracks_cfi.btvTrackRefs.clone()
262 ak4JetTracksAssociatorExplicitAll = ak4JTA_cff.ak4JetTracksAssociatorExplicit.clone(
266 import CommonTools.RecoAlgos.jetTracksAssociationToTrackRefs_cfi
as jetTracksAssociationToTrackRefs_cfi
267 cutsRecoTracksAK4PFJets = jetTracksAssociationToTrackRefs_cfi.jetTracksAssociationToTrackRefs.clone(
268 association =
"ak4JetTracksAssociatorExplicitAll",
275 trackingParticlesSignal = _trackingParticleRefSelector.clone(
286 generalTracksPt09 = cutsRecoTracks_cfi.cutsRecoTracks.clone(ptMin=0.9)
289 args=[[
"_generalTracksHp"]],
290 plainArgs=[
"Pt09",
"generalTracksPt09"],
291 names=
"_selectorsPt09", sequence=
"_tracksValidationSelectorsPt09",
292 modifySequence=
lambda seq:seq.insert(0, generalTracksPt09))
296 generalTracksFromPV = _trackWithVertexRefSelector.clone(
297 src =
"generalTracks",
302 vertexTag =
"offlinePrimaryVertices",
310 args=[[
"_generalTracksHp"]],
311 plainArgs=[
"FromPV",
"generalTracksFromPV"],
312 names=
"_selectorsFromPV", sequence=
"_tracksValidationSelectorsFromPV",
313 modifySequence=
lambda seq: seq.insert(0, generalTracksFromPV))
316 generalTracksFromPVPt09 = generalTracksPt09.clone(src=
"generalTracksFromPV")
319 args=[[
"_generalTracksHp"]],
320 plainArgs=[
"FromPVPt09",
"generalTracksFromPVPt09"],
321 names=
"_selectorsFromPVPt09", sequence=
"_tracksValidationSelectorsFromPVPt09",
322 modifySequence=
lambda seq: seq.insert(0, generalTracksFromPVPt09))
325 trackingParticlesConversion = _trackingParticleConversionRefSelector.clone()
328 trackingParticlesElectron = _trackingParticleRefSelector.clone(
339 trackingParticlesBHadron = _trackingParticleBHadronRefSelector.clone()
342 trackValidator = Validation.RecoTrack.MultiTrackValidator_cfi.multiTrackValidator.clone(
343 useLogPt = cms.untracked.bool(
True),
345 doPVAssociationPlots =
True 350 fastSim.toModify(trackValidator,
353 for _eraName, _postfix, _era
in _relevantEras:
355 label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix]] +
356 locals()[
"_selectorsByAlgo"+_postfix] + locals()[
"_selectorsByAlgoHp"+_postfix] +
357 locals()[
"_selectorsByOriginalAlgo"+_postfix] +
358 [
"generalTracksPt09"] + locals()[
"_selectorsPt09"+_postfix] +
360 "cutsRecoTracksBtvLike",
361 "cutsRecoTracksAK4PFJets" 363 doResolutionPlotsForLabels = [
365 locals()[
"_generalTracksHp"+_postfix],
367 "cutsRecoTracksBtvLike",
370 _setForEra(trackValidator.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=locals()[
"_seedingLayerSets"+_postfix])
373 trackValidatorTPPtLess09 = trackValidator.clone(
374 dirName =
"Tracking/TrackTPPtLess09/",
375 label = [x
for x
in trackValidator.label.value()
if (
"Pt09" not in x)
and (
"BtvLike" not in x)
and (
"AK4PFJets" not in x)],
377 histoProducerAlgoBlock =
dict(
378 TpSelectorForEfficiencyVsEta =
dict(ptMin=0.05),
379 TpSelectorForEfficiencyVsPhi =
dict(ptMin=0.05),
380 TpSelectorForEfficiencyVsVTXR =
dict(ptMin=0.05),
381 TpSelectorForEfficiencyVsVTXZ =
dict(ptMin=0.05),
384 doRecoTrackPlots =
False,
385 doResolutionPlotsForLabels = [
"disabled"],
390 trackValidatorFromPV = trackValidator.clone(
391 dirName =
"Tracking/TrackFromPV/",
392 label_tp_effic =
"trackingParticlesSignal",
393 label_tp_fake =
"trackingParticlesSignal",
394 label_tp_effic_refvector =
True,
395 label_tp_fake_refvector =
True,
396 trackCollectionForDrCalculation =
"generalTracksFromPV",
397 doPlotsOnlyForTruePV =
True,
398 doPVAssociationPlots =
False,
399 doResolutionPlotsForLabels = [
"disabled"],
401 for _eraName, _postfix, _era
in _relevantEras:
402 _setForEra(trackValidatorFromPV, _eraName, _era,
403 label = [
"generalTracksFromPV"] + locals()[
"_selectorsFromPV"+_postfix] + [
"generalTracksFromPVPt09"] + locals()[
"_selectorsFromPVPt09"+_postfix],
404 doResolutionPlotsForLabels = []
409 trackValidatorFromPVAllTP = trackValidatorFromPV.clone(
410 dirName =
"Tracking/TrackFromPVAllTP/",
411 label_tp_effic = trackValidator.label_tp_effic.value(),
412 label_tp_fake = trackValidator.label_tp_fake.value(),
413 label_tp_effic_refvector =
False,
414 label_tp_fake_refvector =
False,
416 doSimTrackPlots =
False,
417 doResolutionPlotsForLabels = [
"disabled"],
421 trackValidatorAllTPEffic = trackValidator.clone(
422 dirName =
"Tracking/TrackAllTPEffic/",
423 label = [x
for x
in trackValidator.label.value()
if "Pt09" not in x],
425 doRecoTrackPlots =
True,
426 doPVAssociationPlots =
False,
427 doResolutionPlotsForLabels = [
"disabled"],
429 trackValidatorAllTPEffic.histoProducerAlgoBlock.generalTpSelector.signalOnly =
False 430 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsEta.signalOnly =
False 431 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPhi.signalOnly =
False 432 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPt.signalOnly =
False 433 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXR.signalOnly =
False 434 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXZ.signalOnly =
False 435 for _eraName, _postfix, _era
in _relevantEras:
436 _setForEra(trackValidatorAllTPEffic, _eraName, _era, label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix]])
439 _trackValidatorSeedingBuilding = trackValidator.clone(
440 associators = [
"quickTrackAssociatorByHits"],
441 UseAssociators =
True,
443 doPVAssociationPlots =
False,
445 doResolutionPlotsForLabels = [
"disabled"],
447 trackValidatorBuilding = _trackValidatorSeedingBuilding.clone(
448 dirName =
"Tracking/TrackBuilding/",
451 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
452 _setForEra(trackValidatorBuilding, _eraName, _era, label = locals()[
"_trackProducers"+_postfix])
453 fastSim.toModify(trackValidatorBuilding, doMVAPlots=
False)
454 for _eraName, _postfix, _era
in _relevantEras:
455 _setForEra(trackValidatorBuilding, _eraName, _era, mvaLabels = locals()[
"_mvaSelectors"+_postfix])
459 trackValidatorConversion = trackValidator.clone(
460 dirName =
"Tracking/TrackConversion/",
463 "conversionStepTracks",
464 "ckfInOutTracksFromConversions",
465 "ckfOutInTracksFromConversions",
467 label_tp_effic =
"trackingParticlesConversion",
468 label_tp_effic_refvector =
True,
469 associators = [
"quickTrackAssociatorByHits"],
470 UseAssociators =
True,
473 doPVAssociationPlots =
False,
474 calculateDrSingleCollection =
False,
478 firstLayers = [layerSet.split(
"+")[0]
for layerSet
in layerList]
480 for l
in firstLayers:
487 trackValidatorConversion.histoProducerAlgoBlock.seedingLayerSets =
_uniqueFirstLayers(_convLayerPairs.layerList.value())
489 for n
in [
"Eta",
"Phi",
"Pt",
"VTXR",
"VTXZ"]:
490 pset = getattr(trackValidatorConversion.histoProducerAlgoBlock,
"TpSelectorForEfficiencyVs"+n)
491 pset.lip = trackValidatorConversion.lipTP.value()
492 pset.tip = trackValidatorConversion.tipTP.value()
495 trackValidatorGsfTracks = trackValidatorConversion.clone(
496 dirName =
"Tracking/TrackGsf/",
497 label = [
"electronGsfTracks"],
498 label_tp_effic =
"trackingParticlesElectron",
501 for _eraName, _postfix, _era
in _relevantEras:
502 _setForEra(trackValidatorGsfTracks.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=trackValidator.histoProducerAlgoBlock.seedingLayerSets.value()+locals()[
"_seedingLayerSetsForElectrons"+_postfix])
507 trackValidatorBHadron = trackValidator.clone(
508 dirName =
"Tracking/TrackBHadron/",
509 label_tp_effic =
"trackingParticlesBHadron",
510 label_tp_effic_refvector =
True,
512 doRecoTrackPlots =
False,
515 for _eraName, _postfix, _era
in _relevantEras:
516 _setForEra(trackValidatorBHadron, _eraName, _era,
517 label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix],
"cutsRecoTracksBtvLike"]
522 tracksValidationSelectors = cms.Sequence(
523 tracksValidationSelectorsByAlgo +
524 tracksValidationSelectorsByAlgoHp +
525 tracksValidationSelectorsByOriginalAlgo +
526 cutsRecoTracksBtvLike +
527 ak4JetTracksAssociatorExplicitAll +
528 cutsRecoTracksAK4PFJets
530 tracksValidationTruth = cms.Sequence(
532 quickTrackAssociatorByHits +
533 trackingParticleRecoTrackAsssociation +
534 VertexAssociatorByPositionAndTracks +
535 trackingParticleNumberOfLayersProducer
537 fastSim.toModify(tracksValidationTruth,
lambda x: x.remove(tpClusterProducer))
539 tracksPreValidation = cms.Sequence(
540 tracksValidationSelectors +
541 tracksValidationSelectorsPt09 +
542 tracksValidationSelectorsFromPV +
543 tracksValidationSelectorsFromPVPt09 +
544 tracksValidationTruth +
545 cms.ignore(trackingParticlesSignal) +
546 cms.ignore(trackingParticlesElectron) +
547 trackingParticlesConversion
549 fastSim.toReplaceWith(tracksPreValidation, tracksPreValidation.copyAndExclude([
550 trackingParticlesElectron,
551 trackingParticlesConversion,
554 tracksValidation = cms.Sequence(
555 tracksPreValidation +
557 trackValidatorTPPtLess09 +
558 trackValidatorFromPV +
559 trackValidatorFromPVAllTP +
560 trackValidatorAllTPEffic +
561 trackValidatorBuilding +
562 trackValidatorConversion +
563 trackValidatorGsfTracks
565 fastSim.toReplaceWith(tracksValidation, tracksValidation.copyAndExclude([
566 trackValidatorConversion,
567 trackValidatorGsfTracks,
574 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"ByAlgoMask",
"algorithmMaskContains"],
575 names =
"_selectorsByAlgoMask", sequence =
"_tracksValidationSelectorsByAlgoMaskStandalone")
580 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"Pt09",
"generalTracksPt09"],
581 names =
"_selectorsPt09Standalone", sequence =
"_tracksValidationSelectorsPt09Standalone")
586 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"FromPV",
"generalTracksFromPV"],
587 names =
"_selectorsFromPVStandalone", sequence =
"_tracksValidationSelectorsFromPVStandalone")
592 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"FromPVPt09",
"generalTracksFromPVPt09"],
593 names =
"_selectorsFromPVPt09Standalone", sequence =
"_tracksValidationSelectorsFromPVPt09Standalone")
596 trackValidatorStandalone = trackValidator.clone()
597 trackValidatorTPPtLess09Standalone = trackValidatorTPPtLess09.clone()
598 for _eraName, _postfix, _era
in _relevantEras:
599 _setForEra(trackValidatorStandalone, _eraName, _era, label = trackValidator.label + locals()[
"_selectorsByAlgoMask"+_postfix] + locals()[
"_selectorsPt09Standalone"+_postfix])
600 _setForEra(trackValidatorTPPtLess09Standalone, _eraName, _era, label = trackValidatorTPPtLess09.label + locals()[
"_selectorsByAlgoMask"+_postfix] + locals()[
"_selectorsPt09Standalone"+_postfix])
602 trackValidatorFromPVStandalone = trackValidatorFromPV.clone()
603 for _eraName, _postfix, _era
in _relevantEras:
604 _setForEra(trackValidatorFromPVStandalone, _eraName, _era, label = trackValidatorFromPV.label + locals()[
"_selectorsFromPVStandalone"+_postfix] + locals()[
"_selectorsFromPVPt09Standalone"+_postfix])
607 trackValidatorFromPVAllTPStandalone = trackValidatorFromPVAllTP.clone(
608 label = trackValidatorFromPVStandalone.label.value()
610 trackValidatorAllTPEfficStandalone = trackValidatorAllTPEffic.clone(
611 label = [ x
for x
in trackValidator.label.value()
if x
not in [
"cutsRecoTracksBtvLike",
"cutsRecoTracksAK4PFJets"]
and "Pt09" not in x]
614 trackValidatorConversionStandalone = trackValidatorConversion.clone( label = [x
for x
in trackValidatorConversion.label
if x !=
"convStepTracks"])
616 trackValidatorBHadronStandalone = trackValidatorBHadron.clone(label = [x
for x
in trackValidatorStandalone.label
if "Pt09" not in x])
619 tracksPreValidationStandalone = tracksPreValidation.copy()
620 tracksPreValidationStandalone += trackingParticlesBHadron
621 fastSim.toReplaceWith(tracksPreValidationStandalone, tracksPreValidation)
623 tracksValidationSelectorsStandalone = cms.Sequence(
624 tracksValidationSelectorsByAlgoMaskStandalone +
625 tracksValidationSelectorsPt09Standalone +
626 tracksValidationSelectorsFromPVStandalone +
627 tracksValidationSelectorsFromPVPt09Standalone
632 _trackValidatorsBase = cms.Sequence(
633 trackValidatorStandalone +
634 trackValidatorTPPtLess09Standalone +
635 trackValidatorFromPVStandalone +
636 trackValidatorFromPVAllTPStandalone +
637 trackValidatorAllTPEfficStandalone +
638 trackValidatorConversionStandalone +
639 trackValidatorGsfTracks +
640 trackValidatorBHadronStandalone
642 trackValidatorsStandalone = _trackValidatorsBase.copy()
643 fastSim.toModify(trackValidatorsStandalone,
lambda x: x.remove(trackValidatorConversionStandalone) )
645 tracksValidationStandalone = cms.Sequence(
646 ak4PFL1FastL2L3CorrectorChain +
647 tracksPreValidationStandalone +
648 tracksValidationSelectorsStandalone +
649 trackValidatorsStandalone
655 tracksValidationSelectorsTrackingOnly = tracksValidationSelectors.copyAndExclude([ak4JetTracksAssociatorExplicitAll,cutsRecoTracksAK4PFJets])
656 _sequenceForEachEra(_addSeedToTrackProducers, args=[
"_seedProducers"], names=
"_seedSelectors", sequence=
"_tracksValidationSeedSelectorsTrackingOnly", includeFastSim=
True, modDict=globals())
659 trackValidatorTrackingOnly = trackValidatorStandalone.clone(label = [ x
for x
in trackValidatorStandalone.label
if x !=
"cutsRecoTracksAK4PFJets"] )
661 trackValidatorSeedingTrackingOnly = _trackValidatorSeedingBuilding.clone(
662 dirName =
"Tracking/TrackSeeding/",
663 label = _seedSelectors,
666 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
667 _setForEra(trackValidatorSeedingTrackingOnly, _eraName, _era, label = locals()[
"_seedSelectors"+_postfix])
670 trackValidatorConversionTrackingOnly = trackValidatorConversion.clone(label = [x
for x
in trackValidatorConversion.label
if x
not in [
"ckfInOutTracksFromConversions",
"ckfOutInTracksFromConversions"]])
672 trackValidatorBHadronTrackingOnly = trackValidatorBHadron.clone(label = [x
for x
in trackValidatorTrackingOnly.label
if "Pt09" not in x])
675 tracksPreValidationTrackingOnly = tracksPreValidationStandalone.copy()
676 tracksPreValidationTrackingOnly.replace(tracksValidationSelectors, tracksValidationSelectorsTrackingOnly)
678 trackValidatorsTrackingOnly = _trackValidatorsBase.copy()
679 trackValidatorsTrackingOnly.replace(trackValidatorStandalone, trackValidatorTrackingOnly)
680 trackValidatorsTrackingOnly += trackValidatorSeedingTrackingOnly
681 trackValidatorsTrackingOnly += trackValidatorBuilding
682 trackValidatorsTrackingOnly.replace(trackValidatorConversionStandalone, trackValidatorConversionTrackingOnly)
683 trackValidatorsTrackingOnly.remove(trackValidatorGsfTracks)
684 trackValidatorsTrackingOnly.replace(trackValidatorBHadronStandalone, trackValidatorBHadronTrackingOnly)
685 fastSim.toModify(trackValidatorsTrackingOnly,
lambda x: x.remove(trackValidatorConversionTrackingOnly))
686 fastSim.toModify(trackValidatorsTrackingOnly,
lambda x: x.remove(trackValidatorBHadronTrackingOnly))
689 tracksValidationTrackingOnly = cms.Sequence(
690 tracksPreValidationTrackingOnly +
691 tracksValidationSelectorsStandalone +
692 tracksValidationSeedSelectorsTrackingOnly +
693 trackValidatorsTrackingOnly
699 trackValidatorLite = trackValidator.clone(
700 label = [
"generalTracks",
"cutsRecoTracksHp"]
702 tracksValidationLite = cms.Sequence(
704 tracksValidationTruth +
709 from Configuration.Eras.Modifier_phase2_timing_layer_cff
import phase2_timing_layer
710 phase2_timing_layer.toModify( generalTracksFromPV,
711 vertexTag = cms.InputTag(
'offlinePrimaryVertices4D'),
712 timesTag = cms.InputTag(
'trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel'),
713 timeResosTag = cms.InputTag(
'trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution'),
714 nSigmaDtVertex = cms.double(3) )
715 phase2_timing_layer.toModify( trackValidatorStandalone,
716 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
717 phase2_timing_layer.toModify( trackValidatorFromPVStandalone,
718 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
719 phase2_timing_layer.toModify( trackValidatorFromPVAllTPStandalone,
720 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
721 phase2_timing_layer.toModify( trackValidatorConversionStandalone,
722 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
723 phase2_timing_layer.toModify( trackValidatorGsfTracks,
724 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)