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 label = prod.trackingRegionsSeedingLayers.getModuleLabel()
195 return prod.seedingLayers.getModuleLabel()
197 seedingLayersMerged = []
198 for seedName
in seedProducers:
199 seedProd = getattr(config, seedName)
200 seedingLayersName =
None 202 if hasattr(seedProd,
"OrderedHitsFactoryPSet"):
203 seedingLayersName = seedProd.OrderedHitsFactoryPSet.SeedingLayers.getModuleLabel()
204 elif hasattr(seedProd,
"seedingHitSets"):
205 seedingLayersName = _findSeedingLayers(seedProd.seedingHitSets.getModuleLabel())
206 elif hasattr(seedProd,
"layerList"):
207 seedingLayers = seedProd.layerList.value()
211 if seedingLayersName
is not None:
212 seedingLayers = getattr(config, seedingLayersName).layerList.value()
213 for layerSet
in seedingLayers:
214 if layerSet
not in seedingLayersMerged:
215 seedingLayersMerged.append(layerSet)
217 return seedingLayersMerged
220 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
223 if "_electronSeedProducers"+_postfix
in locals():
224 for _layer
in _getSeedingLayers(locals()[
"_electronSeedProducers"+_postfix], _ElectronSeeds_cff):
225 if _layer
not in _stdLayers:
226 _eleLayers.append(_layer)
228 locals()[
"_seedingLayerSets"+_postfix] = _stdLayers
229 locals()[
"_seedingLayerSetsForElectrons"+_postfix] = _eleLayers
234 mvaSel = _utils.getMVASelectors(postfix)
236 pset = cms.untracked.PSet()
237 for iteration, (trackProducer, classifiers)
in mvaSel.iteritems():
238 setattr(pset, trackProducer, cms.untracked.vstring(classifiers))
240 for _eraName, _postfix, _era
in _relevantEras:
244 _sequenceForEachEra(_addSelectorsByAlgo, args=[
"_algos"], names=
"_selectorsByAlgo", sequence=
"_tracksValidationSelectorsByAlgo", modDict=globals())
247 _sequenceForEachEra(_addSelectorsByHp, args=[
"_algos"], names=
"_selectorsByAlgoHp", sequence=
"_tracksValidationSelectorsByAlgoHp", modDict=globals())
250 for _eraName, _postfix, _era
in _relevantEras:
251 locals()[
"_selectorsByAlgoAndHp"+_postfix] = locals()[
"_selectorsByAlgo"+_postfix] + locals()[
"_selectorsByAlgoHp"+_postfix]
253 locals()[
"_selectorsByAlgoAndHpNoGenTk"+_postfix] =
filter(
lambda n: n
not in [
"generalTracks",
"cutsRecoTracksHp"], locals()[
"_selectorsByAlgoAndHp"+_postfix])
255 locals()[
"_selectorsByAlgoAndHpNoGenTkDupMerge"+_postfix] =
filter(
lambda n: n
not in [
"cutsRecoTracksDuplicateMerge",
"cutsRecoTracksDuplicateMergeHp"], locals()[
"_selectorsByAlgoAndHpNoGenTk"+_postfix])
257 args = [
"_selectorsByAlgoAndHpNoGenTkDupMerge"], plainArgs = [
"ByOriginalAlgo",
"originalAlgorithm"],
258 names =
"_selectorsByOriginalAlgo", sequence =
"_tracksValidationSelectorsByOriginalAlgo")
261 for _eraName, _postfix, _era
in _relevantEras:
262 selectors = locals()[
"_selectorsByAlgoHp"+_postfix]
263 locals()[
"_generalTracksHp"+_postfix] = selectors[0]
264 locals()[
"_selectorsByAlgoHp"+_postfix] = selectors[1:]
267 import PhysicsTools.RecoAlgos.btvTracks_cfi
as btvTracks_cfi
268 cutsRecoTracksBtvLike = btvTracks_cfi.btvTrackRefs.clone()
272 ak4JetTracksAssociatorExplicitAll = ak4JTA_cff.ak4JetTracksAssociatorExplicit.clone(
276 import CommonTools.RecoAlgos.jetTracksAssociationToTrackRefs_cfi
as jetTracksAssociationToTrackRefs_cfi
277 cutsRecoTracksAK4PFJets = jetTracksAssociationToTrackRefs_cfi.jetTracksAssociationToTrackRefs.clone(
278 association =
"ak4JetTracksAssociatorExplicitAll",
285 trackingParticlesSignal = _trackingParticleRefSelector.clone(
296 generalTracksPt09 = cutsRecoTracks_cfi.cutsRecoTracks.clone(ptMin=0.9)
299 args=[[
"_generalTracksHp"]],
300 plainArgs=[
"Pt09",
"generalTracksPt09"],
301 names=
"_selectorsPt09", sequence=
"_tracksValidationSelectorsPt09",
302 modifySequence=
lambda seq:seq.insert(0, generalTracksPt09))
306 generalTracksFromPV = _trackWithVertexRefSelector.clone(
307 src =
"generalTracks",
312 vertexTag =
"offlinePrimaryVertices",
320 args=[[
"_generalTracksHp"]],
321 plainArgs=[
"FromPV",
"generalTracksFromPV"],
322 names=
"_selectorsFromPV", sequence=
"_tracksValidationSelectorsFromPV",
323 modifySequence=
lambda seq: seq.insert(0, generalTracksFromPV))
326 generalTracksFromPVPt09 = generalTracksPt09.clone(src=
"generalTracksFromPV")
329 args=[[
"_generalTracksHp"]],
330 plainArgs=[
"FromPVPt09",
"generalTracksFromPVPt09"],
331 names=
"_selectorsFromPVPt09", sequence=
"_tracksValidationSelectorsFromPVPt09",
332 modifySequence=
lambda seq: seq.insert(0, generalTracksFromPVPt09))
335 trackingParticlesConversion = _trackingParticleConversionRefSelector.clone()
338 trackingParticlesElectron = _trackingParticleRefSelector.clone(
349 trackingParticlesBHadron = _trackingParticleBHadronRefSelector.clone()
352 trackValidator = Validation.RecoTrack.MultiTrackValidator_cfi.multiTrackValidator.clone(
353 useLogPt = cms.untracked.bool(
True),
355 doPVAssociationPlots =
True 360 fastSim.toModify(trackValidator,
363 for _eraName, _postfix, _era
in _relevantEras:
365 label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix]] +
366 locals()[
"_selectorsByAlgo"+_postfix] + locals()[
"_selectorsByAlgoHp"+_postfix] +
367 locals()[
"_selectorsByOriginalAlgo"+_postfix] +
368 [
"generalTracksPt09"] + locals()[
"_selectorsPt09"+_postfix] +
370 "cutsRecoTracksBtvLike",
371 "cutsRecoTracksAK4PFJets" 373 doResolutionPlotsForLabels = [
375 locals()[
"_generalTracksHp"+_postfix],
377 "cutsRecoTracksBtvLike",
380 _setForEra(trackValidator.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=locals()[
"_seedingLayerSets"+_postfix])
383 trackValidatorTPPtLess09 = trackValidator.clone(
384 dirName =
"Tracking/TrackTPPtLess09/",
385 label = [x
for x
in trackValidator.label.value()
if (
"Pt09" not in x)
and (
"BtvLike" not in x)
and (
"AK4PFJets" not in x)],
387 histoProducerAlgoBlock =
dict(
388 TpSelectorForEfficiencyVsEta =
dict(ptMin=0.05),
389 TpSelectorForEfficiencyVsPhi =
dict(ptMin=0.05),
390 TpSelectorForEfficiencyVsVTXR =
dict(ptMin=0.05),
391 TpSelectorForEfficiencyVsVTXZ =
dict(ptMin=0.05),
394 doRecoTrackPlots =
False,
395 doResolutionPlotsForLabels = [
"disabled"],
400 trackValidatorFromPV = trackValidator.clone(
401 dirName =
"Tracking/TrackFromPV/",
402 label_tp_effic =
"trackingParticlesSignal",
403 label_tp_fake =
"trackingParticlesSignal",
404 label_tp_effic_refvector =
True,
405 label_tp_fake_refvector =
True,
406 trackCollectionForDrCalculation =
"generalTracksFromPV",
407 doPlotsOnlyForTruePV =
True,
408 doPVAssociationPlots =
False,
409 doResolutionPlotsForLabels = [
"disabled"],
411 for _eraName, _postfix, _era
in _relevantEras:
412 _setForEra(trackValidatorFromPV, _eraName, _era,
413 label = [
"generalTracksFromPV"] + locals()[
"_selectorsFromPV"+_postfix] + [
"generalTracksFromPVPt09"] + locals()[
"_selectorsFromPVPt09"+_postfix],
414 doResolutionPlotsForLabels = []
419 trackValidatorFromPVAllTP = trackValidatorFromPV.clone(
420 dirName =
"Tracking/TrackFromPVAllTP/",
421 label_tp_effic = trackValidator.label_tp_effic.value(),
422 label_tp_fake = trackValidator.label_tp_fake.value(),
423 label_tp_effic_refvector =
False,
424 label_tp_fake_refvector =
False,
426 doSimTrackPlots =
False,
427 doResolutionPlotsForLabels = [
"disabled"],
431 trackValidatorAllTPEffic = trackValidator.clone(
432 dirName =
"Tracking/TrackAllTPEffic/",
433 label = [x
for x
in trackValidator.label.value()
if "Pt09" not in x],
435 doRecoTrackPlots =
True,
436 doPVAssociationPlots =
False,
437 doResolutionPlotsForLabels = [
"disabled"],
439 trackValidatorAllTPEffic.histoProducerAlgoBlock.generalTpSelector.signalOnly =
False 440 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsEta.signalOnly =
False 441 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPhi.signalOnly =
False 442 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPt.signalOnly =
False 443 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXR.signalOnly =
False 444 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXZ.signalOnly =
False 445 for _eraName, _postfix, _era
in _relevantEras:
446 _setForEra(trackValidatorAllTPEffic, _eraName, _era, label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix]])
449 _trackValidatorSeedingBuilding = trackValidator.clone(
450 associators = [
"quickTrackAssociatorByHits"],
451 UseAssociators =
True,
453 doPVAssociationPlots =
False,
455 doResolutionPlotsForLabels = [
"disabled"],
457 trackValidatorBuilding = _trackValidatorSeedingBuilding.clone(
458 dirName =
"Tracking/TrackBuilding/",
461 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
462 _setForEra(trackValidatorBuilding, _eraName, _era, label = locals()[
"_trackProducers"+_postfix])
463 fastSim.toModify(trackValidatorBuilding, doMVAPlots=
False)
464 for _eraName, _postfix, _era
in _relevantEras:
465 _setForEra(trackValidatorBuilding, _eraName, _era, mvaLabels = locals()[
"_mvaSelectors"+_postfix])
469 trackValidatorConversion = trackValidator.clone(
470 dirName =
"Tracking/TrackConversion/",
473 "conversionStepTracks",
474 "ckfInOutTracksFromConversions",
475 "ckfOutInTracksFromConversions",
477 label_tp_effic =
"trackingParticlesConversion",
478 label_tp_effic_refvector =
True,
479 associators = [
"quickTrackAssociatorByHits"],
480 UseAssociators =
True,
483 doPVAssociationPlots =
False,
484 calculateDrSingleCollection =
False,
488 firstLayers = [layerSet.split(
"+")[0]
for layerSet
in layerList]
490 for l
in firstLayers:
495 if l.startswith(
"TEC"):
501 trackValidatorConversion.histoProducerAlgoBlock.seedingLayerSets =
_uniqueFirstLayers(_convLayerPairs.layerList.value())
503 for n
in [
"Eta",
"Phi",
"Pt",
"VTXR",
"VTXZ"]:
504 pset = getattr(trackValidatorConversion.histoProducerAlgoBlock,
"TpSelectorForEfficiencyVs"+n)
505 pset.lip = trackValidatorConversion.lipTP.value()
506 pset.tip = trackValidatorConversion.tipTP.value()
509 trackValidatorGsfTracks = trackValidatorConversion.clone(
510 dirName =
"Tracking/TrackGsf/",
511 label = [
"electronGsfTracks"],
512 label_tp_effic =
"trackingParticlesElectron",
515 for _eraName, _postfix, _era
in _relevantEras:
516 _setForEra(trackValidatorGsfTracks.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=trackValidator.histoProducerAlgoBlock.seedingLayerSets.value()+locals()[
"_seedingLayerSetsForElectrons"+_postfix])
521 trackValidatorBHadron = trackValidator.clone(
522 dirName =
"Tracking/TrackBHadron/",
523 label_tp_effic =
"trackingParticlesBHadron",
524 label_tp_effic_refvector =
True,
526 doRecoTrackPlots =
False,
529 for _eraName, _postfix, _era
in _relevantEras:
530 _setForEra(trackValidatorBHadron, _eraName, _era,
531 label = [
"generalTracks", locals()[
"_generalTracksHp"+_postfix],
"cutsRecoTracksBtvLike"]
536 tracksValidationSelectors = cms.Sequence(
537 tracksValidationSelectorsByAlgo +
538 tracksValidationSelectorsByAlgoHp +
539 tracksValidationSelectorsByOriginalAlgo +
540 cutsRecoTracksBtvLike +
541 ak4JetTracksAssociatorExplicitAll +
542 cutsRecoTracksAK4PFJets
544 tracksValidationTruth = cms.Sequence(
546 quickTrackAssociatorByHits +
547 trackingParticleRecoTrackAsssociation +
548 VertexAssociatorByPositionAndTracks +
549 trackingParticleNumberOfLayersProducer
551 fastSim.toModify(tracksValidationTruth,
lambda x: x.remove(tpClusterProducer))
553 tracksPreValidation = cms.Sequence(
554 tracksValidationSelectors +
555 tracksValidationSelectorsPt09 +
556 tracksValidationSelectorsFromPV +
557 tracksValidationSelectorsFromPVPt09 +
558 tracksValidationTruth +
559 cms.ignore(trackingParticlesSignal) +
560 cms.ignore(trackingParticlesElectron) +
561 trackingParticlesConversion
563 fastSim.toReplaceWith(tracksPreValidation, tracksPreValidation.copyAndExclude([
564 trackingParticlesElectron,
565 trackingParticlesConversion,
568 tracksValidation = cms.Sequence(
569 tracksPreValidation +
571 trackValidatorTPPtLess09 +
572 trackValidatorFromPV +
573 trackValidatorFromPVAllTP +
574 trackValidatorAllTPEffic +
575 trackValidatorBuilding +
576 trackValidatorConversion +
577 trackValidatorGsfTracks
579 fastSim.toReplaceWith(tracksValidation, tracksValidation.copyAndExclude([
580 trackValidatorConversion,
581 trackValidatorGsfTracks,
588 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"ByAlgoMask",
"algorithmMaskContains"],
589 names =
"_selectorsByAlgoMask", sequence =
"_tracksValidationSelectorsByAlgoMaskStandalone")
594 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"Pt09",
"generalTracksPt09"],
595 names =
"_selectorsPt09Standalone", sequence =
"_tracksValidationSelectorsPt09Standalone")
600 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"FromPV",
"generalTracksFromPV"],
601 names =
"_selectorsFromPVStandalone", sequence =
"_tracksValidationSelectorsFromPVStandalone")
606 args = [
"_selectorsByAlgoAndHpNoGenTk"], plainArgs = [
"FromPVPt09",
"generalTracksFromPVPt09"],
607 names =
"_selectorsFromPVPt09Standalone", sequence =
"_tracksValidationSelectorsFromPVPt09Standalone")
610 trackValidatorStandalone = trackValidator.clone()
611 trackValidatorTPPtLess09Standalone = trackValidatorTPPtLess09.clone()
612 for _eraName, _postfix, _era
in _relevantEras:
613 _setForEra(trackValidatorStandalone, _eraName, _era, label = trackValidator.label + locals()[
"_selectorsByAlgoMask"+_postfix] + locals()[
"_selectorsPt09Standalone"+_postfix])
614 _setForEra(trackValidatorTPPtLess09Standalone, _eraName, _era, label = trackValidatorTPPtLess09.label + locals()[
"_selectorsByAlgoMask"+_postfix] + locals()[
"_selectorsPt09Standalone"+_postfix])
616 trackValidatorFromPVStandalone = trackValidatorFromPV.clone()
617 for _eraName, _postfix, _era
in _relevantEras:
618 _setForEra(trackValidatorFromPVStandalone, _eraName, _era, label = trackValidatorFromPV.label + locals()[
"_selectorsFromPVStandalone"+_postfix] + locals()[
"_selectorsFromPVPt09Standalone"+_postfix])
621 trackValidatorFromPVAllTPStandalone = trackValidatorFromPVAllTP.clone(
622 label = trackValidatorFromPVStandalone.label.value()
624 trackValidatorAllTPEfficStandalone = trackValidatorAllTPEffic.clone(
625 label = [ x
for x
in trackValidator.label.value()
if x
not in [
"cutsRecoTracksBtvLike",
"cutsRecoTracksAK4PFJets"]
and "Pt09" not in x]
628 trackValidatorConversionStandalone = trackValidatorConversion.clone( label = [x
for x
in trackValidatorConversion.label
if x !=
"convStepTracks"])
630 trackValidatorBHadronStandalone = trackValidatorBHadron.clone(label = [x
for x
in trackValidatorStandalone.label
if "Pt09" not in x])
633 tracksPreValidationStandalone = tracksPreValidation.copy()
634 tracksPreValidationStandalone += trackingParticlesBHadron
635 fastSim.toReplaceWith(tracksPreValidationStandalone, tracksPreValidation)
637 tracksValidationSelectorsStandalone = cms.Sequence(
638 tracksValidationSelectorsByAlgoMaskStandalone +
639 tracksValidationSelectorsPt09Standalone +
640 tracksValidationSelectorsFromPVStandalone +
641 tracksValidationSelectorsFromPVPt09Standalone
646 _trackValidatorsBase = cms.Sequence(
647 trackValidatorStandalone +
648 trackValidatorTPPtLess09Standalone +
649 trackValidatorFromPVStandalone +
650 trackValidatorFromPVAllTPStandalone +
651 trackValidatorAllTPEfficStandalone +
652 trackValidatorConversionStandalone +
653 trackValidatorGsfTracks +
654 trackValidatorBHadronStandalone
656 trackValidatorsStandalone = _trackValidatorsBase.copy()
657 fastSim.toModify(trackValidatorsStandalone,
lambda x: x.remove(trackValidatorConversionStandalone) )
659 tracksValidationStandalone = cms.Sequence(
660 ak4PFL1FastL2L3CorrectorChain +
661 tracksPreValidationStandalone +
662 tracksValidationSelectorsStandalone +
663 trackValidatorsStandalone
669 tracksValidationSelectorsTrackingOnly = tracksValidationSelectors.copyAndExclude([ak4JetTracksAssociatorExplicitAll,cutsRecoTracksAK4PFJets])
670 _sequenceForEachEra(_addSeedToTrackProducers, args=[
"_seedProducers"], names=
"_seedSelectors", sequence=
"_tracksValidationSeedSelectorsTrackingOnly", includeFastSim=
True, modDict=globals())
673 trackValidatorTrackingOnly = trackValidatorStandalone.clone(label = [ x
for x
in trackValidatorStandalone.label
if x !=
"cutsRecoTracksAK4PFJets"] )
675 trackValidatorSeedingTrackingOnly = _trackValidatorSeedingBuilding.clone(
676 dirName =
"Tracking/TrackSeeding/",
677 label = _seedSelectors,
680 for _eraName, _postfix, _era
in _relevantErasAndFastSim:
681 _setForEra(trackValidatorSeedingTrackingOnly, _eraName, _era, label = locals()[
"_seedSelectors"+_postfix])
684 trackValidatorConversionTrackingOnly = trackValidatorConversion.clone(label = [x
for x
in trackValidatorConversion.label
if x
not in [
"ckfInOutTracksFromConversions",
"ckfOutInTracksFromConversions"]])
686 trackValidatorBHadronTrackingOnly = trackValidatorBHadron.clone(label = [x
for x
in trackValidatorTrackingOnly.label
if "Pt09" not in x])
689 tracksPreValidationTrackingOnly = tracksPreValidationStandalone.copy()
690 tracksPreValidationTrackingOnly.replace(tracksValidationSelectors, tracksValidationSelectorsTrackingOnly)
692 trackValidatorsTrackingOnly = _trackValidatorsBase.copy()
693 trackValidatorsTrackingOnly.replace(trackValidatorStandalone, trackValidatorTrackingOnly)
694 trackValidatorsTrackingOnly += trackValidatorSeedingTrackingOnly
695 trackValidatorsTrackingOnly += trackValidatorBuilding
696 trackValidatorsTrackingOnly.replace(trackValidatorConversionStandalone, trackValidatorConversionTrackingOnly)
697 trackValidatorsTrackingOnly.remove(trackValidatorGsfTracks)
698 trackValidatorsTrackingOnly.replace(trackValidatorBHadronStandalone, trackValidatorBHadronTrackingOnly)
699 fastSim.toModify(trackValidatorsTrackingOnly,
lambda x: x.remove(trackValidatorConversionTrackingOnly))
700 fastSim.toModify(trackValidatorsTrackingOnly,
lambda x: x.remove(trackValidatorBHadronTrackingOnly))
703 tracksValidationTrackingOnly = cms.Sequence(
704 tracksPreValidationTrackingOnly +
705 tracksValidationSelectorsStandalone +
706 tracksValidationSeedSelectorsTrackingOnly +
707 trackValidatorsTrackingOnly
712 tpClusterProducerPixelTrackingOnly = tpClusterProducer.clone(
713 pixelClusterSrc =
"siPixelClustersPreSplitting" 715 quickTrackAssociatorByHitsPixelTrackingOnly = quickTrackAssociatorByHits.clone(
716 cluster2TPSrc =
"tpClusterProducerPixelTrackingOnly" 718 trackingParticlePixelTrackAsssociation = trackingParticleRecoTrackAsssociation.clone(
719 label_tr =
"pixelTracks",
720 associator =
"quickTrackAssociatorByHitsPixelTrackingOnly",
722 PixelVertexAssociatorByPositionAndTracks = VertexAssociatorByPositionAndTracks.clone(
723 trackAssociation =
"trackingParticlePixelTrackAsssociation" 726 trackValidatorPixelTrackingOnly = trackValidator.clone(
727 dirName =
"Tracking/PixelTrack/",
728 label = [
"pixelTracks"],
729 doResolutionPlotsForLabels = [],
730 trackCollectionForDrCalculation =
"pixelTracks",
731 associators = [
"trackingParticlePixelTrackAsssociation"],
732 label_vertex =
"pixelVertices",
733 vertexAssociator =
"PixelVertexAssociatorByPositionAndTracks",
737 tracksValidationTruthPixelTrackingOnly = tracksValidationTruth.copy()
738 tracksValidationTruthPixelTrackingOnly.replace(tpClusterProducer, tpClusterProducerPixelTrackingOnly)
739 tracksValidationTruthPixelTrackingOnly.replace(quickTrackAssociatorByHits, quickTrackAssociatorByHitsPixelTrackingOnly)
740 tracksValidationTruthPixelTrackingOnly.replace(trackingParticleRecoTrackAsssociation, trackingParticlePixelTrackAsssociation)
741 tracksValidationTruthPixelTrackingOnly.replace(VertexAssociatorByPositionAndTracks, PixelVertexAssociatorByPositionAndTracks)
742 tracksValidationPixelTrackingOnly = cms.Sequence(
743 tracksValidationTruthPixelTrackingOnly +
744 trackValidatorPixelTrackingOnly
749 trackValidatorLite = trackValidator.clone(
750 label = [
"generalTracks",
"cutsRecoTracksHp"]
752 tracksValidationLite = cms.Sequence(
754 tracksValidationTruth +
759 from Configuration.Eras.Modifier_phase2_timing_layer_cff
import phase2_timing_layer
760 phase2_timing_layer.toModify( generalTracksFromPV,
761 vertexTag = cms.InputTag(
'offlinePrimaryVertices4D'),
762 timesTag = cms.InputTag(
'trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel'),
763 timeResosTag = cms.InputTag(
'trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution'),
764 nSigmaDtVertex = cms.double(3) )
765 phase2_timing_layer.toModify( trackValidatorStandalone,
766 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
767 phase2_timing_layer.toModify( trackValidatorFromPVStandalone,
768 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
769 phase2_timing_layer.toModify( trackValidatorFromPVAllTPStandalone,
770 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
771 phase2_timing_layer.toModify( trackValidatorConversionStandalone,
772 label_vertex = cms.untracked.InputTag(
'offlinePrimaryVertices4D') )
773 phase2_timing_layer.toModify( trackValidatorGsfTracks,
774 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)