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 seedingLayersName =
None 199 if hasattr(seedProd,
"OrderedHitsFactoryPSet"):
200 seedingLayersName = seedProd.OrderedHitsFactoryPSet.SeedingLayers.getModuleLabel()
201 elif hasattr(seedProd,
"seedingHitSets"):
202 seedingLayersName = _findSeedingLayers(seedProd.seedingHitSets.getModuleLabel())
203 elif hasattr(seedProd,
"layerList"):
204 seedingLayers = seedProd.layerList.value()
208 if seedingLayersName
is not None:
209 seedingLayers = getattr(config, seedingLayersName).layerList.value()
210 for layerSet
in seedingLayers:
211 if layerSet
not in seedingLayersMerged:
212 seedingLayersMerged.append(layerSet)
214 return seedingLayersMerged
217 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
220 if "_electronSeedProducers"+_postfix
in locals():
221 for _layer
in _getSeedingLayers(locals()[
"_electronSeedProducers"+_postfix], _ElectronSeeds_cff):
222 if _layer
not in _stdLayers:
223 _eleLayers.append(_layer)
225 locals()[
"_seedingLayerSets"+_postfix] = _stdLayers
226 locals()[
"_seedingLayerSetsForElectrons"+_postfix] = _eleLayers
231 mvaSel = _utils.getMVASelectors(postfix)
233 pset = cms.untracked.PSet()
234 for iteration, (trackProducer, classifiers)
in mvaSel.iteritems():
235 setattr(pset, trackProducer, cms.untracked.vstring(classifiers))
237 for _eraName, _postfix, _era
in _relevantEras:
241 _sequenceForEachEra(_addSelectorsByAlgo, args=[
"_algos"], names=
"_selectorsByAlgo", sequence=
"_tracksValidationSelectorsByAlgo", modDict=globals())
244 _sequenceForEachEra(_addSelectorsByHp, args=[
"_algos"], names=
"_selectorsByAlgoHp", sequence=
"_tracksValidationSelectorsByAlgoHp", modDict=globals())
247 for _eraName, _postfix, _era
in _relevantEras:
248 locals()[
"_selectorsByAlgoAndHp"+_postfix] = locals()[
"_selectorsByAlgo"+_postfix] + locals()[
"_selectorsByAlgoHp"+_postfix]
250 locals()[
"_selectorsByAlgoAndHpNoGenTk"+_postfix] =
filter(
lambda n: n
not in [
"generalTracks",
"cutsRecoTracksHp"], locals()[
"_selectorsByAlgoAndHp"+_postfix])
252 locals()[
"_selectorsByAlgoAndHpNoGenTkDupMerge"+_postfix] =
filter(
lambda n: n
not in [
"cutsRecoTracksDuplicateMerge",
"cutsRecoTracksDuplicateMergeHp"], locals()[
"_selectorsByAlgoAndHpNoGenTk"+_postfix])
254 args = [
"_selectorsByAlgoAndHpNoGenTkDupMerge"], plainArgs = [
"ByOriginalAlgo",
"originalAlgorithm"],
255 names =
"_selectorsByOriginalAlgo", sequence =
"_tracksValidationSelectorsByOriginalAlgo")
258 for _eraName, _postfix, _era
in _relevantEras:
259 selectors = locals()[
"_selectorsByAlgoHp"+_postfix]
260 locals()[
"_generalTracksHp"+_postfix] = selectors[0]
261 locals()[
"_selectorsByAlgoHp"+_postfix] = selectors[1:]
264 import PhysicsTools.RecoAlgos.btvTracks_cfi
as btvTracks_cfi
265 cutsRecoTracksBtvLike = btvTracks_cfi.btvTrackRefs.clone()
269 ak4JetTracksAssociatorExplicitAll = ak4JTA_cff.ak4JetTracksAssociatorExplicit.clone(
273 import CommonTools.RecoAlgos.jetTracksAssociationToTrackRefs_cfi
as jetTracksAssociationToTrackRefs_cfi
274 cutsRecoTracksAK4PFJets = jetTracksAssociationToTrackRefs_cfi.jetTracksAssociationToTrackRefs.clone(
275 association =
"ak4JetTracksAssociatorExplicitAll",
282 trackingParticlesSignal = _trackingParticleRefSelector.clone(
293 generalTracksPt09 = cutsRecoTracks_cfi.cutsRecoTracks.clone(ptMin=0.9)
296 args=[[
"_generalTracksHp"]],
297 plainArgs=[
"Pt09",
"generalTracksPt09"],
298 names=
"_selectorsPt09", sequence=
"_tracksValidationSelectorsPt09",
299 modifySequence=
lambda seq:seq.insert(0, generalTracksPt09))
303 generalTracksFromPV = _trackWithVertexRefSelector.clone(
304 src =
"generalTracks",
309 vertexTag =
"offlinePrimaryVertices",
317 args=[[
"_generalTracksHp"]],
318 plainArgs=[
"FromPV",
"generalTracksFromPV"],
319 names=
"_selectorsFromPV", sequence=
"_tracksValidationSelectorsFromPV",
320 modifySequence=
lambda seq: seq.insert(0, generalTracksFromPV))
323 generalTracksFromPVPt09 = generalTracksPt09.clone(src=
"generalTracksFromPV")
326 args=[[
"_generalTracksHp"]],
327 plainArgs=[
"FromPVPt09",
"generalTracksFromPVPt09"],
328 names=
"_selectorsFromPVPt09", sequence=
"_tracksValidationSelectorsFromPVPt09",
329 modifySequence=
lambda seq: seq.insert(0, generalTracksFromPVPt09))
332 trackingParticlesConversion = _trackingParticleConversionRefSelector.clone()
335 trackingParticlesElectron = _trackingParticleRefSelector.clone(
346 trackingParticlesBHadron = _trackingParticleBHadronRefSelector.clone()
349 trackValidator = Validation.RecoTrack.MultiTrackValidator_cfi.multiTrackValidator.clone(
350 useLogPt = cms.untracked.bool(
True),
352 doPVAssociationPlots =
True 357 fastSim.toModify(trackValidator,
360 for _eraName, _postfix, _era
in _relevantEras:
362 label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix]] +
363 locals()[
"_selectorsByAlgo"+_postfix] + locals()[
"_selectorsByAlgoHp"+_postfix] +
364 locals()[
"_selectorsByOriginalAlgo"+_postfix] +
365 [
"generalTracksPt09"] + locals()[
"_selectorsPt09"+_postfix] +
367 "cutsRecoTracksBtvLike",
368 "cutsRecoTracksAK4PFJets" 370 doResolutionPlotsForLabels = [
372 locals()[
"_generalTracksHp"+_postfix],
374 "cutsRecoTracksBtvLike",
377 _setForEra(trackValidator.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=locals()[
"_seedingLayerSets"+_postfix])
380 trackValidatorTPPtLess09 = trackValidator.clone(
381 dirName =
"Tracking/TrackTPPtLess09/",
382 label = [x
for x
in trackValidator.label.value()
if (
"Pt09" not in x)
and (
"BtvLike" not in x)
and (
"AK4PFJets" not in x)],
384 histoProducerAlgoBlock =
dict(
385 TpSelectorForEfficiencyVsEta =
dict(ptMin=0.05),
386 TpSelectorForEfficiencyVsPhi =
dict(ptMin=0.05),
387 TpSelectorForEfficiencyVsVTXR =
dict(ptMin=0.05),
388 TpSelectorForEfficiencyVsVTXZ =
dict(ptMin=0.05),
391 doRecoTrackPlots =
False,
392 doResolutionPlotsForLabels = [
"disabled"],
397 trackValidatorFromPV = trackValidator.clone(
398 dirName =
"Tracking/TrackFromPV/",
399 label_tp_effic =
"trackingParticlesSignal",
400 label_tp_fake =
"trackingParticlesSignal",
401 label_tp_effic_refvector =
True,
402 label_tp_fake_refvector =
True,
403 trackCollectionForDrCalculation =
"generalTracksFromPV",
404 doPlotsOnlyForTruePV =
True,
405 doPVAssociationPlots =
False,
406 doResolutionPlotsForLabels = [
"disabled"],
408 for _eraName, _postfix, _era
in _relevantEras:
409 _setForEra(trackValidatorFromPV, _eraName, _era,
410 label = [
"generalTracksFromPV"] + locals()[
"_selectorsFromPV"+_postfix] + [
"generalTracksFromPVPt09"] + locals()[
"_selectorsFromPVPt09"+_postfix],
411 doResolutionPlotsForLabels = []
416 trackValidatorFromPVAllTP = trackValidatorFromPV.clone(
417 dirName =
"Tracking/TrackFromPVAllTP/",
418 label_tp_effic = trackValidator.label_tp_effic.value(),
419 label_tp_fake = trackValidator.label_tp_fake.value(),
420 label_tp_effic_refvector =
False,
421 label_tp_fake_refvector =
False,
423 doSimTrackPlots =
False,
424 doResolutionPlotsForLabels = [
"disabled"],
428 trackValidatorAllTPEffic = trackValidator.clone(
429 dirName =
"Tracking/TrackAllTPEffic/",
430 label = [x
for x
in trackValidator.label.value()
if "Pt09" not in x],
432 doRecoTrackPlots =
True,
433 doPVAssociationPlots =
False,
434 doResolutionPlotsForLabels = [
"disabled"],
436 trackValidatorAllTPEffic.histoProducerAlgoBlock.generalTpSelector.signalOnly =
False 437 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsEta.signalOnly =
False 438 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPhi.signalOnly =
False 439 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPt.signalOnly =
False 440 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXR.signalOnly =
False 441 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXZ.signalOnly =
False 442 for _eraName, _postfix, _era
in _relevantEras:
443 _setForEra(trackValidatorAllTPEffic, _eraName, _era, label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix]])
446 _trackValidatorSeedingBuilding = trackValidator.clone(
447 associators = [
"quickTrackAssociatorByHits"],
448 UseAssociators =
True,
450 doPVAssociationPlots =
False,
452 doResolutionPlotsForLabels = [
"disabled"],
454 trackValidatorBuilding = _trackValidatorSeedingBuilding.clone(
455 dirName =
"Tracking/TrackBuilding/",
458 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
459 _setForEra(trackValidatorBuilding, _eraName, _era, label = locals()[
"_trackProducers"+_postfix])
460 fastSim.toModify(trackValidatorBuilding, doMVAPlots=
False)
461 for _eraName, _postfix, _era
in _relevantEras:
462 _setForEra(trackValidatorBuilding, _eraName, _era, mvaLabels = locals()[
"_mvaSelectors"+_postfix])
466 trackValidatorConversion = trackValidator.clone(
467 dirName =
"Tracking/TrackConversion/",
470 "conversionStepTracks",
471 "ckfInOutTracksFromConversions",
472 "ckfOutInTracksFromConversions",
474 label_tp_effic =
"trackingParticlesConversion",
475 label_tp_effic_refvector =
True,
476 associators = [
"quickTrackAssociatorByHits"],
477 UseAssociators =
True,
480 doPVAssociationPlots =
False,
481 calculateDrSingleCollection =
False,
485 firstLayers = [layerSet.split(
"+")[0]
for layerSet
in layerList]
487 for l
in firstLayers:
494 trackValidatorConversion.histoProducerAlgoBlock.seedingLayerSets =
_uniqueFirstLayers(_convLayerPairs.layerList.value())
496 for n
in [
"Eta",
"Phi",
"Pt",
"VTXR",
"VTXZ"]:
497 pset = getattr(trackValidatorConversion.histoProducerAlgoBlock,
"TpSelectorForEfficiencyVs"+n)
498 pset.lip = trackValidatorConversion.lipTP.value()
499 pset.tip = trackValidatorConversion.tipTP.value()
502 trackValidatorGsfTracks = trackValidatorConversion.clone(
503 dirName =
"Tracking/TrackGsf/",
504 label = [
"electronGsfTracks"],
505 label_tp_effic =
"trackingParticlesElectron",
508 for _eraName, _postfix, _era
in _relevantEras:
509 _setForEra(trackValidatorGsfTracks.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=trackValidator.histoProducerAlgoBlock.seedingLayerSets.value()+locals()[
"_seedingLayerSetsForElectrons"+_postfix])
514 trackValidatorBHadron = trackValidator.clone(
515 dirName =
"Tracking/TrackBHadron/",
516 label_tp_effic =
"trackingParticlesBHadron",
517 label_tp_effic_refvector =
True,
519 doRecoTrackPlots =
False,
522 for _eraName, _postfix, _era
in _relevantEras:
523 _setForEra(trackValidatorBHadron, _eraName, _era,
524 label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix],
"cutsRecoTracksBtvLike"]
529 tracksValidationSelectors = cms.Sequence(
530 tracksValidationSelectorsByAlgo +
531 tracksValidationSelectorsByAlgoHp +
532 tracksValidationSelectorsByOriginalAlgo +
533 cutsRecoTracksBtvLike +
534 ak4JetTracksAssociatorExplicitAll +
535 cutsRecoTracksAK4PFJets
537 tracksValidationTruth = cms.Sequence(
539 quickTrackAssociatorByHits +
540 trackingParticleRecoTrackAsssociation +
541 VertexAssociatorByPositionAndTracks +
542 trackingParticleNumberOfLayersProducer
544 fastSim.toModify(tracksValidationTruth,
lambda x: x.remove(tpClusterProducer))
546 tracksPreValidation = cms.Sequence(
547 tracksValidationSelectors +
548 tracksValidationSelectorsPt09 +
549 tracksValidationSelectorsFromPV +
550 tracksValidationSelectorsFromPVPt09 +
551 tracksValidationTruth +
552 cms.ignore(trackingParticlesSignal) +
553 cms.ignore(trackingParticlesElectron) +
554 trackingParticlesConversion
556 fastSim.toReplaceWith(tracksPreValidation, tracksPreValidation.copyAndExclude([
557 trackingParticlesElectron,
558 trackingParticlesConversion,
561 tracksValidation = cms.Sequence(
562 tracksPreValidation +
564 trackValidatorTPPtLess09 +
565 trackValidatorFromPV +
566 trackValidatorFromPVAllTP +
567 trackValidatorAllTPEffic +
568 trackValidatorBuilding +
569 trackValidatorConversion +
570 trackValidatorGsfTracks
572 fastSim.toReplaceWith(tracksValidation, tracksValidation.copyAndExclude([
573 trackValidatorConversion,
574 trackValidatorGsfTracks,
581 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"ByAlgoMask",
"algorithmMaskContains"],
582 names =
"_selectorsByAlgoMask", sequence =
"_tracksValidationSelectorsByAlgoMaskStandalone")
587 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"Pt09",
"generalTracksPt09"],
588 names =
"_selectorsPt09Standalone", sequence =
"_tracksValidationSelectorsPt09Standalone")
593 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"FromPV",
"generalTracksFromPV"],
594 names =
"_selectorsFromPVStandalone", sequence =
"_tracksValidationSelectorsFromPVStandalone")
599 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"FromPVPt09",
"generalTracksFromPVPt09"],
600 names =
"_selectorsFromPVPt09Standalone", sequence =
"_tracksValidationSelectorsFromPVPt09Standalone")
603 trackValidatorStandalone = trackValidator.clone()
604 trackValidatorTPPtLess09Standalone = trackValidatorTPPtLess09.clone()
605 for _eraName, _postfix, _era
in _relevantEras:
606 _setForEra(trackValidatorStandalone, _eraName, _era, label = trackValidator.label + locals()[
"_selectorsByAlgoMask"+_postfix] + locals()[
"_selectorsPt09Standalone"+_postfix])
607 _setForEra(trackValidatorTPPtLess09Standalone, _eraName, _era, label = trackValidatorTPPtLess09.label + locals()[
"_selectorsByAlgoMask"+_postfix] + locals()[
"_selectorsPt09Standalone"+_postfix])
609 trackValidatorFromPVStandalone = trackValidatorFromPV.clone()
610 for _eraName, _postfix, _era
in _relevantEras:
611 _setForEra(trackValidatorFromPVStandalone, _eraName, _era, label = trackValidatorFromPV.label + locals()[
"_selectorsFromPVStandalone"+_postfix] + locals()[
"_selectorsFromPVPt09Standalone"+_postfix])
614 trackValidatorFromPVAllTPStandalone = trackValidatorFromPVAllTP.clone(
615 label = trackValidatorFromPVStandalone.label.value()
617 trackValidatorAllTPEfficStandalone = trackValidatorAllTPEffic.clone(
618 label = [ x
for x
in trackValidator.label.value()
if x
not in [
"cutsRecoTracksBtvLike",
"cutsRecoTracksAK4PFJets"]
and "Pt09" not in x]
621 trackValidatorConversionStandalone = trackValidatorConversion.clone( label = [x
for x
in trackValidatorConversion.label
if x !=
"convStepTracks"])
623 trackValidatorBHadronStandalone = trackValidatorBHadron.clone(label = [x
for x
in trackValidatorStandalone.label
if "Pt09" not in x])
626 tracksPreValidationStandalone = tracksPreValidation.copy()
627 tracksPreValidationStandalone += trackingParticlesBHadron
628 fastSim.toReplaceWith(tracksPreValidationStandalone, tracksPreValidation)
630 tracksValidationSelectorsStandalone = cms.Sequence(
631 tracksValidationSelectorsByAlgoMaskStandalone +
632 tracksValidationSelectorsPt09Standalone +
633 tracksValidationSelectorsFromPVStandalone +
634 tracksValidationSelectorsFromPVPt09Standalone
639 _trackValidatorsBase = cms.Sequence(
640 trackValidatorStandalone +
641 trackValidatorTPPtLess09Standalone +
642 trackValidatorFromPVStandalone +
643 trackValidatorFromPVAllTPStandalone +
644 trackValidatorAllTPEfficStandalone +
645 trackValidatorConversionStandalone +
646 trackValidatorGsfTracks +
647 trackValidatorBHadronStandalone
649 trackValidatorsStandalone = _trackValidatorsBase.copy()
650 fastSim.toModify(trackValidatorsStandalone,
lambda x: x.remove(trackValidatorConversionStandalone) )
652 tracksValidationStandalone = cms.Sequence(
653 ak4PFL1FastL2L3CorrectorChain +
654 tracksPreValidationStandalone +
655 tracksValidationSelectorsStandalone +
656 trackValidatorsStandalone
662 tracksValidationSelectorsTrackingOnly = tracksValidationSelectors.copyAndExclude([ak4JetTracksAssociatorExplicitAll,cutsRecoTracksAK4PFJets])
663 _sequenceForEachEra(_addSeedToTrackProducers, args=[
"_seedProducers"], names=
"_seedSelectors", sequence=
"_tracksValidationSeedSelectorsTrackingOnly", includeFastSim=
True, modDict=globals())
666 trackValidatorTrackingOnly = trackValidatorStandalone.clone(label = [ x
for x
in trackValidatorStandalone.label
if x !=
"cutsRecoTracksAK4PFJets"] )
668 trackValidatorSeedingTrackingOnly = _trackValidatorSeedingBuilding.clone(
669 dirName =
"Tracking/TrackSeeding/",
670 label = _seedSelectors,
673 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
674 _setForEra(trackValidatorSeedingTrackingOnly, _eraName, _era, label = locals()[
"_seedSelectors"+_postfix])
677 trackValidatorConversionTrackingOnly = trackValidatorConversion.clone(label = [x
for x
in trackValidatorConversion.label
if x
not in [
"ckfInOutTracksFromConversions",
"ckfOutInTracksFromConversions"]])
679 trackValidatorBHadronTrackingOnly = trackValidatorBHadron.clone(label = [x
for x
in trackValidatorTrackingOnly.label
if "Pt09" not in x])
682 tracksPreValidationTrackingOnly = tracksPreValidationStandalone.copy()
683 tracksPreValidationTrackingOnly.replace(tracksValidationSelectors, tracksValidationSelectorsTrackingOnly)
685 trackValidatorsTrackingOnly = _trackValidatorsBase.copy()
686 trackValidatorsTrackingOnly.replace(trackValidatorStandalone, trackValidatorTrackingOnly)
687 trackValidatorsTrackingOnly += trackValidatorSeedingTrackingOnly
688 trackValidatorsTrackingOnly += trackValidatorBuilding
689 trackValidatorsTrackingOnly.replace(trackValidatorConversionStandalone, trackValidatorConversionTrackingOnly)
690 trackValidatorsTrackingOnly.remove(trackValidatorGsfTracks)
691 trackValidatorsTrackingOnly.replace(trackValidatorBHadronStandalone, trackValidatorBHadronTrackingOnly)
692 fastSim.toModify(trackValidatorsTrackingOnly,
lambda x: x.remove(trackValidatorConversionTrackingOnly))
693 fastSim.toModify(trackValidatorsTrackingOnly,
lambda x: x.remove(trackValidatorBHadronTrackingOnly))
696 tracksValidationTrackingOnly = cms.Sequence(
697 tracksPreValidationTrackingOnly +
698 tracksValidationSelectorsStandalone +
699 tracksValidationSeedSelectorsTrackingOnly +
700 trackValidatorsTrackingOnly
706 trackValidatorLite = trackValidator.clone(
707 label = [
"generalTracks",
"cutsRecoTracksHp"]
709 tracksValidationLite = cms.Sequence(
711 tracksValidationTruth +
716 from Configuration.Eras.Modifier_phase2_timing_layer_cff
import phase2_timing_layer
717 phase2_timing_layer.toModify( generalTracksFromPV,
718 vertexTag = cms.InputTag(
'offlinePrimaryVertices4D'),
719 timesTag = cms.InputTag(
'trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel'),
720 timeResosTag = cms.InputTag(
'trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution'),
721 nSigmaDtVertex = cms.double(3) )
722 phase2_timing_layer.toModify( trackValidatorStandalone,
723 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
724 phase2_timing_layer.toModify( trackValidatorFromPVStandalone,
725 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
726 phase2_timing_layer.toModify( trackValidatorFromPVAllTPStandalone,
727 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
728 phase2_timing_layer.toModify( trackValidatorConversionStandalone,
729 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
730 phase2_timing_layer.toModify( trackValidatorGsfTracks,
731 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)