CMS 3D CMS Logo

TrackValidation_cff.py
Go to the documentation of this file.
1 from __future__ import absolute_import
2 import FWCore.ParameterSet.Config as cms
3 
8 from Validation.RecoTrack.trajectorySeedTracks_cfi import trajectorySeedTracks as _trajectorySeedTracks
12 import Validation.RecoTrack.cutsRecoTracks_cfi as cutsRecoTracks_cfi
13 #from . import cutsRecoTracks_cfi
14 
17 from CommonTools.RecoAlgos.trackingParticleRefSelector_cfi import trackingParticleRefSelector as _trackingParticleRefSelector
18 from CommonTools.RecoAlgos.trackingParticleConversionRefSelector_cfi import trackingParticleConversionRefSelector as _trackingParticleConversionRefSelector
19 from SimTracker.TrackHistory.trackingParticleBHadronRefSelector_cfi import trackingParticleBHadronRefSelector as _trackingParticleBHadronRefSelector
21 from CommonTools.RecoAlgos.recoChargedRefCandidateToTrackRefProducer_cfi import recoChargedRefCandidateToTrackRefProducer as _recoChargedRefCandidateToTrackRefProducer
22 
23 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg
24 import RecoTracker.IterativeTracking.iterativeTkUtils as _utils
25 from Configuration.Eras.Modifier_fastSim_cff import fastSim
26 import six
27 
28 
30 for _eraName, _postfix, _era in _cfg.allEras():
31  _seedProd = ["initialStepSeedsPreSplitting"]
32  _trackProd = ["initialStepTracksPreSplitting"]
33  if _eraName in ["trackingLowPU", "trackingPhase2PU140"]: # these don't have preSplitting
34  _seedProd = []
35  _trackProd = []
36 
37  locals()["_algos"+_postfix] = ["generalTracks"] + _cfg.iterationAlgos(_postfix) + ["duplicateMerge"]
38  locals()["_seedProducersPreSplitting"+_postfix] = _seedProd
39  locals()["_trackProducersPreSplitting"+_postfix] = _trackProd
40  locals()["_seedProducers"+_postfix] = _cfg.seedProducers(_postfix)
41  locals()["_trackProducers"+_postfix] = _cfg.trackProducers(_postfix)
42 
43  if _eraName != "trackingPhase2PU140":
44  locals()["_electronSeedProducers"+_postfix] = ["tripletElectronSeeds", "pixelPairElectronSeeds", "stripPairElectronSeeds"]
45  else:
46  locals()["_electronSeedProducers"+_postfix] = ["tripletElectronSeeds"]
47 
48 _removeForFastSimSeedProducers =["initialStepSeedsPreSplitting",
49  "jetCoreRegionalStepSeeds",
50  "muonSeededSeedsInOut",
51  "muonSeededSeedsOutIn"]
52 _seedProducers_fastSim = [ x for x in _seedProducers if x not in _removeForFastSimSeedProducers]
53 
54 _removeForFastTrackProducers = ["initialStepTracksPreSplitting",
55  "jetCoreRegionalStepTracks",
56  "muonSeededTracksInOut",
57  "muonSeededTracksOutIn"]
58 _trackProducers_fastSim = [ x for x in _trackProducers if x not in _removeForFastTrackProducers]
59 
60 def _algoToSelector(algo):
61  sel = ""
62  if algo != "generalTracks":
63  sel = algo[0].upper()+algo[1:]
64  return "cutsRecoTracks"+sel
65 
66 def _addSelectorsByAlgo(algos, modDict):
67  names = []
68  task = cms.Task()
69  for algo in algos:
70  if algo == "generalTracks":
71  continue
72  modName = _algoToSelector(algo)
73  if modName not in modDict:
74  mod = cutsRecoTracks_cfi.cutsRecoTracks.clone(
75 # src = [src],
76  algorithm=[algo]
77  )
78  modDict[modName] = mod
79  else:
80  mod = modDict[modName]
81  names.append(modName)
82  task.add(mod)
83  return (names, task)
84 def _addSelectorsByHp(algos, modDict):
85  task = cms.Task()
86  names = []
87  for algo in algos:
88  modName = _algoToSelector(algo)
89  modNameHp = modName+"Hp"
90  if modNameHp not in modDict:
91  if algo == "generalTracks":
92  mod = cutsRecoTracks_cfi.cutsRecoTracks.clone(quality=["highPurity"])
93  else:
94  mod = modDict[modName].clone(quality=["highPurity"])
95  modDict[modNameHp] = mod
96  else:
97  mod = modDict[modNameHp]
98  names.append(modNameHp)
99  task.add(mod)
100  return (names, task)
101 def _addSelectorsBySrc(modules, midfix, src, modDict):
102  task = cms.Task()
103  names = []
104  for modName in modules:
105  modNameNew = modName.replace("cutsRecoTracks", "cutsRecoTracks"+midfix)
106  if modNameNew not in modDict:
107  mod = modDict[modName].clone(src=src)
108  modDict[modNameNew] = mod
109  else:
110  mod = modDict[modNameNew]
111  names.append(modNameNew)
112  task.add(mod)
113  return (names, task)
114 def _addSelectorsByOriginalAlgoMask(modules, midfix, algoParam,modDict):
115  task = cms.Task()
116  names = []
117  for modName in modules:
118  if modName[-2:] == "Hp":
119  modNameNew = modName[:-2] + midfix + "Hp"
120  else:
121  modNameNew = modName + midfix
122  if modNameNew not in modDict:
123  mod = modDict[modName].clone()
124  setattr(mod, algoParam, mod.algorithm.value())
125  mod.algorithm = []
126  modDict[modNameNew] = mod
127  else:
128  mod = modDict[modNameNew]
129  names.append(modNameNew)
130  task.add(mod)
131  return (names, task)
132 def _addSeedToTrackProducers(seedProducers,modDict):
133  names = []
134  task = cms.Task()
135  for seed in seedProducers:
136  modName = "seedTracks"+seed
137  if modName not in modDict:
138  mod = _trajectorySeedTracks.clone(src=seed)
139  modDict[modName] = mod
140  else:
141  mod = modDict[modName]
142  names.append(modName)
143  task.add(mod)
144  return (names, task)
145 
146 _relevantEras = _cfg.allEras()
147 _relevantErasAndFastSim = _relevantEras + [("fastSim", "_fastSim", fastSim)]
148 def _translateArgs(args, postfix, modDict):
149  ret = []
150  for arg in args:
151  if isinstance(arg, list):
152  ret.append(_translateArgs(arg, postfix, modDict))
153  else:
154  ret.append(modDict[arg+postfix])
155  return ret
156 def _taskForEachEra(function, args, names, task, modDict, plainArgs=[], modifyTask=None, includeFastSim=False):
157  if task[0] != "_":
158  raise Exception("Task name is expected to begin with _")
159 
160  _eras = _relevantErasAndFastSim if includeFastSim else _relevantEras
161  for eraName, postfix, _era in _eras:
162  _args = _translateArgs(args, postfix, modDict)
163  _args.extend(plainArgs)
164  ret = function(*_args, modDict=modDict)
165  if len(ret) != 2:
166  raise Exception("_taskForEachEra is expected to return 2 values, but function returned %d" % len(ret))
167  modDict[names+postfix] = ret[0]
168  modDict[task+postfix] = ret[1]
169 
170  # The task of the first era will be the default one
171  defaultTaskName = task+_eras[0][0]
172  defaultTask = modDict[defaultTaskName]
173  modDict[defaultTaskName[1:]] = defaultTask # remove leading underscore
174 
175  # Optionally modify task before applying the era
176  if modifyTask is not None:
177  for eraName, postfix, _era in _eras:
178  modifyTask(modDict[task+postfix])
179 
180  # Apply eras
181  for _eraName, _postfix, _era in _eras[1:]:
182  _era.toReplaceWith(defaultTask, modDict[task+_postfix])
183 def _setForEra(module, eraName, era, **kwargs):
184  if eraName == "":
185  for key, value in six.iteritems(kwargs):
186  setattr(module, key, value)
187  else:
188  era.toModify(module, **kwargs)
189 
190 # Seeding layer sets
191 def _getSeedingLayers(seedProducers, config):
192  def _findSeedingLayers(name):
193  prod = getattr(config, name)
194  if hasattr(prod, "triplets"):
195  if hasattr(prod, "layerList"): # merger
196  return prod.layerList.refToPSet_.value()
197  return _findSeedingLayers(prod.triplets.getModuleLabel())
198  elif hasattr(prod, "doublets"):
199  return _findSeedingLayers(prod.doublets.getModuleLabel())
200  label = prod.trackingRegionsSeedingLayers.getModuleLabel()
201  if label != "":
202  return label
203  return prod.seedingLayers.getModuleLabel()
204 
205  seedingLayersMerged = []
206  for seedName in seedProducers:
207  seedProd = getattr(config, seedName)
208  seedingLayersName = None
209  seedingLayers = None
210  if hasattr(seedProd, "OrderedHitsFactoryPSet"): # old seeding framework
211  seedingLayersName = seedProd.OrderedHitsFactoryPSet.SeedingLayers.getModuleLabel()
212  elif hasattr(seedProd, "seedingHitSets"): # new seeding framework
213  seedingLayersName = _findSeedingLayers(seedProd.seedingHitSets.getModuleLabel())
214  elif hasattr(seedProd, "layerList"): # FastSim:
215  seedingLayers = seedProd.layerList.value()
216  else:
217  continue
218 
219  if seedingLayersName is not None:
220  seedingLayers = getattr(config, seedingLayersName).layerList.value()
221  for layerSet in seedingLayers:
222  if layerSet not in seedingLayersMerged:
223  seedingLayersMerged.append(layerSet)
224 
225  return seedingLayersMerged
226 import RecoTracker.IterativeTracking.iterativeTk_cff as _iterativeTk_cff
227 import RecoTracker.IterativeTracking.ElectronSeeds_cff as _ElectronSeeds_cff
228 for _eraName, _postfix, _era in _relevantErasAndFastSim:
229  _stdLayers = _getSeedingLayers(locals()["_seedProducers"+_postfix], _iterativeTk_cff)
230  _eleLayers = []
231  if "_electronSeedProducers"+_postfix in locals(): # doesn't exist for FastSim
232  for _layer in _getSeedingLayers(locals()["_electronSeedProducers"+_postfix], _ElectronSeeds_cff):
233  if _layer not in _stdLayers:
234  _eleLayers.append(_layer)
235 
236  locals()["_seedingLayerSets"+_postfix] = _stdLayers
237  locals()["_seedingLayerSetsForElectrons"+_postfix] = _eleLayers
238 
239 
240 # MVA selectors
241 def _getMVASelectors(postfix):
242  mvaSel = _utils.getMVASelectors(postfix)
243 
244  pset = cms.untracked.PSet()
245  for iteration, (trackProducer, classifiers) in six.iteritems(mvaSel):
246  setattr(pset, trackProducer, cms.untracked.vstring(classifiers))
247  return pset
248 for _eraName, _postfix, _era in _relevantEras:
249  locals()["_mvaSelectors"+_postfix] = _getMVASelectors(_postfix)
250 
251 # Validation iterative steps
252 _taskForEachEra(_addSelectorsByAlgo, args=["_algos"], names="_selectorsByAlgo", task="_tracksValidationSelectorsByAlgo", modDict=globals())
253 
254 # high purity
255 _taskForEachEra(_addSelectorsByHp, args=["_algos"], names="_selectorsByAlgoHp", task="_tracksValidationSelectorsByAlgoHp", modDict=globals())
256 
257 # by originalAlgo
258 for _eraName, _postfix, _era in _relevantEras:
259  locals()["_selectorsByAlgoAndHp"+_postfix] = locals()["_selectorsByAlgo"+_postfix] + locals()["_selectorsByAlgoHp"+_postfix]
260  # For ByAlgoMask
261  locals()["_selectorsByAlgoAndHpNoGenTk"+_postfix] = [n for n in locals()["_selectorsByAlgoAndHp"+_postfix] if n not in ["generalTracks", "cutsRecoTracksHp"]]
262  # For ByOriginalAlgo
263  locals()["_selectorsByAlgoAndHpNoGenTkDupMerge"+_postfix] = [n for n in locals()["_selectorsByAlgoAndHpNoGenTk"+_postfix] if n not in ["cutsRecoTracksDuplicateMerge", "cutsRecoTracksDuplicateMergeHp"]]
264 _taskForEachEra(_addSelectorsByOriginalAlgoMask, modDict = globals(),
265  args = ["_selectorsByAlgoAndHpNoGenTkDupMerge"], plainArgs = ["ByOriginalAlgo", "originalAlgorithm"],
266  names = "_selectorsByOriginalAlgo", task = "_tracksValidationSelectorsByOriginalAlgo")
267 
268 
269 for _eraName, _postfix, _era in _relevantEras:
270  selectors = locals()["_selectorsByAlgoHp"+_postfix]
271  locals()["_generalTracksHp"+_postfix] = selectors[0]
272  locals()["_selectorsByAlgoHp"+_postfix] = selectors[1:]
273 
274 # BTV-like selection
275 import PhysicsTools.RecoAlgos.btvTracks_cfi as btvTracks_cfi
276 cutsRecoTracksBtvLike = btvTracks_cfi.btvTrackRefs.clone()
277 
278 # Select tracks associated to AK4 jets
280 ak4JetTracksAssociatorExplicitAll = ak4JTA_cff.ak4JetTracksAssociatorExplicit.clone(
281  jets = "ak4PFJets"
282 )
284 import CommonTools.RecoAlgos.jetTracksAssociationToTrackRefs_cfi as jetTracksAssociationToTrackRefs_cfi
285 cutsRecoTracksAK4PFJets = jetTracksAssociationToTrackRefs_cfi.jetTracksAssociationToTrackRefs.clone(
286  association = "ak4JetTracksAssociatorExplicitAll",
287  jets = "ak4PFJets",
288  correctedPtMin = 10,
289 )
290 
291 
292 
293 trackingParticlesSignal = _trackingParticleRefSelector.clone(
294  signalOnly = True,
295  chargedOnly = False,
296  tip = 1e5,
297  lip = 1e5,
298  minRapidity = -10,
299  maxRapidity = 10,
300  ptMin = 0,
301 )
302 
303 # select tracks with pT > 0.9 GeV (for upgrade fake rates)
304 generalTracksPt09 = cutsRecoTracks_cfi.cutsRecoTracks.clone(ptMin=0.9)
305 # and then the selectors
306 _taskForEachEra(_addSelectorsBySrc, modDict=globals(),
307  args=[["_generalTracksHp"]],
308  plainArgs=["Pt09", "generalTracksPt09"],
309  names="_selectorsPt09", task="_tracksValidationSelectorsPt09",
310  modifyTask=lambda task:task.add(generalTracksPt09))
311 
312 # select tracks from the PV
313 from CommonTools.RecoAlgos.TrackWithVertexRefSelector_cfi import trackWithVertexRefSelector as _trackWithVertexRefSelector
314 generalTracksFromPV = _trackWithVertexRefSelector.clone(
315  src = "generalTracks",
316  ptMin = 0,
317  ptMax = 1e10,
318  ptErrorCut = 1e10,
319  quality = "loose",
320  vertexTag = "offlinePrimaryVertices",
321  nVertices = 1,
322  vtxFallback = False,
323  zetaVtx = 0.1, # 1 mm
324  rhoVtx = 1e10, # intentionally no dxy cut
325 )
326 # and then the selectors
327 _taskForEachEra(_addSelectorsBySrc, modDict=globals(),
328  args=[["_generalTracksHp"]],
329  plainArgs=["FromPV", "generalTracksFromPV"],
330  names="_selectorsFromPV", task="_tracksValidationSelectorsFromPV",
331  modifyTask=lambda task: task.add(generalTracksFromPV))
332 
333 # select tracks with pT > 0.9 GeV from the PV
334 generalTracksFromPVPt09 = generalTracksPt09.clone(src="generalTracksFromPV")
335 # and then the selectors
336 _taskForEachEra(_addSelectorsBySrc, modDict=globals(),
337  args=[["_generalTracksHp"]],
338  plainArgs=["FromPVPt09", "generalTracksFromPVPt09"],
339  names="_selectorsFromPVPt09", task="_tracksValidationSelectorsFromPVPt09",
340  modifyTask=lambda task: task.add(generalTracksFromPVPt09))
341 
342 
343 trackingParticlesConversion = _trackingParticleConversionRefSelector.clone()
344 
345 
346 trackingParticlesElectron = _trackingParticleRefSelector.clone(
347  pdgId = [-11, 11],
348  signalOnly = False,
349  tip = 1e5,
350  lip = 1e5,
351  minRapidity = -10,
352  maxRapidity = 10,
353  ptMin = 0,
354 )
355 
356 #ByChi2 association (for jetCore usage, not used by default)
357 MTVTrackAssociationByChi2 = trackingParticleRecoTrackAsssociation.clone(
358  associator = cms.InputTag('trackAssociatorByChi2')
359 )
360 
361 # Select jets for JetCore tracking
362 highPtJets = cms.EDFilter("CandPtrSelector", src = cms.InputTag("ak4CaloJets"), cut = cms.string("pt()>1000"))
363 highPtJetsForTrk = highPtJetsForTrk = highPtJets.clone(src = "ak4CaloJetsForTrk")
364 
365 # Select B-hadron TPs
366 trackingParticlesBHadron = _trackingParticleBHadronRefSelector.clone()
367 
368 
369 trackValidator = Validation.RecoTrack.MultiTrackValidator_cfi.multiTrackValidator.clone(
370  useLogPt = cms.untracked.bool(True),
371  dodEdxPlots = True,
372  # associators=cms.untracked.VInputTag('MTVTrackAssociationByChi2'), #uncomment for byChi2 assoc. for jetcore studies (1/5)
373  doPVAssociationPlots = True
374  #,minpT = cms.double(-1)
375  #,maxpT = cms.double(3)
376  #,nintpT = cms.int32(40)
377 )
378 fastSim.toModify(trackValidator,
379  dodEdxPlots = False)
380 
381 for _eraName, _postfix, _era in _relevantEras:
382  _setForEra(trackValidator, _eraName, _era,
383  label = ["generalTracks", locals()["_generalTracksHp"+_postfix]] +
384  locals()["_selectorsByAlgo"+_postfix] + locals()["_selectorsByAlgoHp"+_postfix] +
385  locals()["_selectorsByOriginalAlgo"+_postfix] +
386  ["generalTracksPt09"] + locals()["_selectorsPt09"+_postfix] +
387  [
388  "cutsRecoTracksBtvLike",
389  "cutsRecoTracksAK4PFJets"
390  ],
391  doResolutionPlotsForLabels = [
392  "generalTracks",
393  locals()["_generalTracksHp"+_postfix],
394  "generalTracksPt09",
395  "cutsRecoTracksBtvLike",
396  "cutsRecoTracksJetCoreRegionalStepByOriginalAlgo",
397  ]
398  )
399  _setForEra(trackValidator.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=locals()["_seedingLayerSets"+_postfix])
400 
401 # for low-pT
402 trackValidatorTPPtLess09 = trackValidator.clone(
403  dirName = "Tracking/TrackTPPtLess09/",
404  label = [x for x in trackValidator.label.value() if ("Pt09" not in x) and ("BtvLike" not in x) and ("AK4PFJets" not in x)],
405  ptMaxTP = 0.9, # set maximum pT globally
406  histoProducerAlgoBlock = dict(
407  TpSelectorForEfficiencyVsEta = dict(ptMin=0.05), # enough to set min pT here
408  TpSelectorForEfficiencyVsPhi = dict(ptMin=0.05),
409  TpSelectorForEfficiencyVsVTXR = dict(ptMin=0.05),
410  TpSelectorForEfficiencyVsVTXZ = dict(ptMin=0.05),
411  ),
412  doSimPlots = False, # same as in trackValidator, no need to repeat here
413  doRecoTrackPlots = False, # fake rates are same as in trackValidator, no need to repeat here
414  doResolutionPlotsForLabels = ["disabled"], # resolutions are same as in trackValidator, no need to repeat here
415 )
416 
417 
418 trackingParticlesEtaGreater2p7 = _trackingParticleRefSelector.clone(
419  signalOnly = cms.bool(False),
420  tip = 1e5,
421  lip = 1e5,
422  minRapidity = -2.7,
423  maxRapidity = 2.7,
424  invertRapidityCut = cms.bool(True),
425  ptMin = 0,
426 )
427 
428 
429 # select tracks with |eta| > 2.7
430 generalTracksEtaGreater2p7 = cutsRecoTracks_cfi.cutsRecoTracks.clone(
431  minRapidity = cms.double(-2.7),
432  maxRapidity = cms.double( 2.7),
433  invertRapidityCut = cms.bool(True)
434 )
435 
436 _taskForEachEra(_addSelectorsBySrc, modDict=globals(),
437  args=[["_generalTracksHp"]],
438  plainArgs=["EtaGreater2p7", "generalTracksEtaGreater2p7"],
439  names="_selectorsEtaGreater2p7", task="_tracksValidationSelectorsEtaGreater2p7",
440  modifyTask=lambda task: task.add(generalTracksEtaGreater2p7))
441 
442 # for high-eta (phase2 : |eta| > 2.7)
443 trackValidatorTPEtaGreater2p7 = trackValidator.clone(
444  dirName = "Tracking/TrackTPEtaGreater2p7/",
445  label_tp_effic = "trackingParticlesEtaGreater2p7",
446  label_tp_fake = "trackingParticlesEtaGreater2p7",
447  label_tp_effic_refvector = True,
448  label_tp_fake_refvector = True,
449  dodEdxPlots = False,
450 # doPVAssociationPlots = False,
451  minRapidityTP = -2.7,
452  maxRapidityTP = 2.7,
453  invertRapidityCutTP = True,
454 # ptMaxTP = 0.9, # set maximum pT globally
455  histoProducerAlgoBlock = dict(
456  TpSelectorForEfficiencyVsPt = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=True), # enough to set min pT here
457  TpSelectorForEfficiencyVsEta = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=True), # enough to set min pT here
458  TpSelectorForEfficiencyVsPhi = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=True),
459  TpSelectorForEfficiencyVsVTXR = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=True),
460  TpSelectorForEfficiencyVsVTXZ = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=True),
461  generalTpSelector = dict(ptMin=0.005,minRapidity=-2.7,maxRapidity=2.7,invertRapidityCut=True),
462 # minEta = -4.5,
463 # maxEta = 4.5,
464 # nintEta = 90,
465  # minPt = 0.01,
466  ),
467  doSimPlots = True, # ####same as in trackValidator, no need to repeat here
468  doRecoTrackPlots = True, # ####fake rates are same as in trackValidator, no need to repeat here
469  doResolutionPlotsForLabels = ["disabled"] # resolutions are same as in trackValidator, no need to repeat here
470 )
471 for _eraName, _postfix, _era in _relevantEras:
472  _setForEra(trackValidatorTPEtaGreater2p7, _eraName, _era,
473  label = ["generalTracksEtaGreater2p7"] + locals()["_selectorsEtaGreater2p7"+_postfix] +
474  locals()["_selectorsByAlgo"+_postfix] + locals()["_selectorsByAlgoHp"+_postfix],
475  doResolutionPlotsForLabels = ["generalTracksEtaGreater2p7"] + locals()["_selectorsEtaGreater2p7"+_postfix]
476  )
477 
478 # For efficiency of signal TPs vs. signal tracks, and fake rate of
479 # signal tracks vs. signal TPs
480 trackValidatorFromPV = trackValidator.clone(
481  dirName = "Tracking/TrackFromPV/",
482  label_tp_effic = "trackingParticlesSignal",
483  label_tp_fake = "trackingParticlesSignal",
484  label_tp_effic_refvector = True,
485  label_tp_fake_refvector = True,
486  trackCollectionForDrCalculation = "generalTracksFromPV",
487  doPlotsOnlyForTruePV = True,
488  doPVAssociationPlots = False,
489  doResolutionPlotsForLabels = ["disabled"],
490 )
491 for _eraName, _postfix, _era in _relevantEras:
492  _setForEra(trackValidatorFromPV, _eraName, _era,
493  label = ["generalTracksFromPV"] + locals()["_selectorsFromPV"+_postfix] + ["generalTracksFromPVPt09"] + locals()["_selectorsFromPVPt09"+_postfix],
494  doResolutionPlotsForLabels = [] # for standard "FromPV" do resolution plots for all input collections as they are already limited
495  )
496 
497 # For fake rate of signal tracks vs. all TPs, and pileup rate of
498 # signal tracks vs. non-signal TPs
499 trackValidatorFromPVAllTP = trackValidatorFromPV.clone(
500  dirName = "Tracking/TrackFromPVAllTP/",
501  label_tp_effic = trackValidator.label_tp_effic.value(),
502  label_tp_fake = trackValidator.label_tp_fake.value(),
503  label_tp_effic_refvector = False,
504  label_tp_fake_refvector = False,
505  doSimPlots = False,
506  doSimTrackPlots = False,
507  doResolutionPlotsForLabels = ["disabled"], # resolution plots are the same as in "trackValidatorFromPV"
508 )
509 
510 # For efficiency of all TPs vs. all tracks
511 trackValidatorAllTPEffic = trackValidator.clone(
512  dirName = "Tracking/TrackAllTPEffic/",
513  label = [x for x in trackValidator.label.value() if "Pt09" not in x],
514  doSimPlots = False,
515  doRecoTrackPlots = True, # Fake rate of all tracks vs. all TPs is already included in trackValidator, but we want the reco plots for other reasons
516  doPVAssociationPlots = False,
517  doResolutionPlotsForLabels = ["disabled"], # resolution plots are the same as in "trackValidator"
518 )
519 trackValidatorAllTPEffic.histoProducerAlgoBlock.generalTpSelector.signalOnly = False
520 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsEta.signalOnly = False
521 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPhi.signalOnly = False
522 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsPt.signalOnly = False
523 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXR.signalOnly = False
524 trackValidatorAllTPEffic.histoProducerAlgoBlock.TpSelectorForEfficiencyVsVTXZ.signalOnly = False
525 for _eraName, _postfix, _era in _relevantEras:
526  _setForEra(trackValidatorAllTPEffic, _eraName, _era, label = ["generalTracks", locals()["_generalTracksHp"+_postfix]])
527 
528 # Built tracks, in the standard sequence mainly for monitoring the track selection MVA
529 tpClusterProducerPreSplitting = tpClusterProducer.clone(pixelClusterSrc = "siPixelClustersPreSplitting")
530 quickTrackAssociatorByHitsPreSplitting = quickTrackAssociatorByHits.clone(cluster2TPSrc = "tpClusterProducerPreSplitting")
531 _trackValidatorSeedingBuilding = trackValidator.clone( # common for built tracks and seeds (in trackingOnly)
532  associators = ["quickTrackAssociatorByHits"],
533  UseAssociators = True,
534  dodEdxPlots = False,
535  doPVAssociationPlots = False,
536  doSimPlots = False,
537  doResolutionPlotsForLabels = ["disabled"],
538 )
539 trackValidatorBuilding = _trackValidatorSeedingBuilding.clone(
540  dirName = "Tracking/TrackBuilding/",
541  doMVAPlots = True,
542  doResolutionPlotsForLabels = ['jetCoreRegionalStepTracks'],
543  # associators = ["trackAssociatorByChi2"], #uncomment for byChi2 assoc. for jetcore studies (2/5)
544  # UseAssociators = True, #uncomment for byChi2 assoc. for jetcore studies (3/5)
545 )
546 trackValidatorBuildingPreSplitting = trackValidatorBuilding.clone(
547  associators = ["quickTrackAssociatorByHitsPreSplitting"],
548  doMVAPlots = False,
549  doSummaryPlots = False,
550 )
551 for _eraName, _postfix, _era in _relevantErasAndFastSim:
552  _setForEra(trackValidatorBuilding, _eraName, _era, label = locals()["_trackProducers"+_postfix])
553 fastSim.toModify(trackValidatorBuilding, doMVAPlots=False)
554 for _eraName, _postfix, _era in _relevantEras:
555  _setForEra(trackValidatorBuilding, _eraName, _era, mvaLabels = locals()["_mvaSelectors"+_postfix])
556  _setForEra(trackValidatorBuildingPreSplitting, _eraName, _era, label = locals()["_trackProducersPreSplitting"+_postfix])
557 
558 
559 # For conversions
560 trackValidatorConversion = trackValidator.clone(
561  dirName = "Tracking/TrackConversion/",
562  label = [
563  "convStepTracks",
564  "conversionStepTracks",
565  "ckfInOutTracksFromConversions",
566  "ckfOutInTracksFromConversions",
567  ],
568  label_tp_effic = "trackingParticlesConversion",
569  label_tp_effic_refvector = True,
570  associators = ["quickTrackAssociatorByHits"],
571  UseAssociators = True,
572  doSimPlots = True,
573  dodEdxPlots = False,
574  doPVAssociationPlots = False,
575  calculateDrSingleCollection = False,
576 )
577 from RecoTracker.ConversionSeedGenerators.ConversionStep_cff import convLayerPairs as _convLayerPairs
578 def _uniqueFirstLayers(layerList):
579  firstLayers = [layerSet.split("+")[0] for layerSet in layerList]
580  ret = []
581  for l in firstLayers:
582  if not l in ret:
583  ret.append(l)
584  # For conversions add also the mono-TEC to the list as 'TEC'
585  # is used for both matched and unmatched rphi/stereo hits
586  if l.startswith("TEC"):
587  ret.append("M"+l)
588  return ret
589 # PhotonConversionTrajectorySeedProducerFromSingleLeg keeps only the
590 # first hit of the pairs in the seed, bookkeeping those is the best we
591 # can do without major further development
592 trackValidatorConversion.histoProducerAlgoBlock.seedingLayerSets = _uniqueFirstLayers(_convLayerPairs.layerList.value())
593 # relax lip and tip
594 for n in ["Eta", "Phi", "Pt", "VTXR", "VTXZ"]:
595  pset = getattr(trackValidatorConversion.histoProducerAlgoBlock, "TpSelectorForEfficiencyVs"+n)
596  pset.lip = trackValidatorConversion.lipTP.value()
597  pset.tip = trackValidatorConversion.tipTP.value()
598 
599 # For electrons
600 trackValidatorGsfTracks = trackValidatorConversion.clone(
601  dirName = "Tracking/TrackGsf/",
602  label = ["electronGsfTracks"],
603  label_tp_effic = "trackingParticlesElectron",
604 )
605 # add the additional seeding layers from ElectronSeeds
606 for _eraName, _postfix, _era in _relevantEras:
607  _setForEra(trackValidatorGsfTracks.histoProducerAlgoBlock, _eraName, _era, seedingLayerSets=trackValidator.histoProducerAlgoBlock.seedingLayerSets.value()+locals()["_seedingLayerSetsForElectrons"+_postfix])
608 
609 
610 
611 # for B-hadrons
612 trackValidatorBHadron = trackValidator.clone(
613  dirName = "Tracking/TrackBHadron/",
614  label_tp_effic = "trackingParticlesBHadron",
615  label_tp_effic_refvector = True,
616  doSimPlots = True,
617  doRecoTrackPlots = False, # Fake rate is defined wrt. all TPs, and that is already included in trackValidator
618  dodEdxPlots = False,
619 )
620 for _eraName, _postfix, _era in _relevantEras:
621  _setForEra(trackValidatorBHadron, _eraName, _era,
622  label = ["generalTracks", locals()["_generalTracksHp"+_postfix], "cutsRecoTracksBtvLike"]
623  )
624 
625 
626 # the track selectors
627 tracksValidationSelectors = cms.Task(
628  tracksValidationSelectorsByAlgo,
629  tracksValidationSelectorsByAlgoHp,
630  tracksValidationSelectorsByOriginalAlgo,
631  cutsRecoTracksBtvLike,
632  ak4JetTracksAssociatorExplicitAll,
633  cutsRecoTracksAK4PFJets
634 )
635 phase2_tracker.toModify(tracksValidationSelectors, lambda x: x.add(generalTracksEtaGreater2p7))
636 phase2_tracker.toModify(tracksValidationSelectors, lambda x: x.add(cutsRecoTracksEtaGreater2p7Hp))
637 
638 # Validation iterative steps
639 _taskForEachEra(_addSelectorsByAlgo, modDict=globals(),
640  args=["_algos"],
641  names="_selectorsByAlgo", task="_tracksEtaGreater2p7ValidationSelectorsByAlgo"
642  )
643 
644 # high purity
645 _taskForEachEra(_addSelectorsByHp, modDict=globals(),
646  args=["_algos"],
647  names="_selectorsByAlgoHp", task="_tracksEtaGreater2p7ValidationSelectorsByAlgoHp"
648  )
649 
650 for _eraName, _postfix, _era in _relevantEras:
651  selectors = locals()["_selectorsByAlgoHp"+_postfix]
652  locals()["_generalTracksHp"+_postfix] = selectors[0]
653  locals()["_selectorsByAlgoHp"+_postfix] = selectors[1:]
654 
655 phase2_tracker.toModify(tracksValidationSelectors, lambda x: x.add(tracksEtaGreater2p7ValidationSelectorsByAlgo))
656 phase2_tracker.toModify(tracksValidationSelectors, lambda x: x.add(tracksEtaGreater2p7ValidationSelectorsByAlgoHp))
657 
658 tracksValidationTruth = cms.Task(
659  tpClusterProducer,
660  tpClusterProducerPreSplitting,
661  # trackAssociatorByChi2, #uncomment for byChi2 assoc. for jetcore studies (4/5)
662  # MTVTrackAssociationByChi2, #uncomment for byChi2 assoc. for jetcore studies (5/5)
663  quickTrackAssociatorByHits,
664  quickTrackAssociatorByHitsPreSplitting,
665  trackingParticleRecoTrackAsssociation,
666  VertexAssociatorByPositionAndTracks,
667  trackingParticleNumberOfLayersProducer
668 )
669 fastSim.toModify(tracksValidationTruth, lambda x: x.remove(tpClusterProducer))
670 
671 tracksPreValidation = cms.Task(
672  highPtJetsForTrk,
673  tracksValidationSelectors,
674  tracksValidationSelectorsPt09,
675  tracksValidationSelectorsFromPV,
676  tracksValidationSelectorsFromPVPt09,
677  tracksValidationTruth,
678  trackingParticlesSignal,
679  trackingParticlesElectron,
680  trackingParticlesConversion
681 )
682 fastSim.toReplaceWith(tracksPreValidation, tracksPreValidation.copyAndExclude([
683  trackingParticlesElectron,
684  trackingParticlesConversion,
685 ]))
686 
687 
688 
689 tracksValidation = cms.Sequence(
690  trackValidator +
691  trackValidatorTPPtLess09 +
692  trackValidatorFromPV +
693  trackValidatorFromPVAllTP +
694  trackValidatorAllTPEffic +
695  trackValidatorBuilding +
696  trackValidatorBuildingPreSplitting +
697  trackValidatorConversion +
698  trackValidatorGsfTracks,
699  tracksPreValidation
700 )
701 
702 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
703 #tracksValidationPhase2 = cms.Sequence(tracksValidation+trackValidatorTPEtaGreater2p7) # it does not work
704 tracksPreValidationPhase2 = tracksPreValidation.copy()
705 tracksPreValidationPhase2.add(trackingParticlesEtaGreater2p7)
706 phase2_tracker.toReplaceWith(tracksPreValidation, tracksPreValidationPhase2)
707 
708 tracksValidationPhase2 = tracksValidation.copy()
709 tracksValidationPhase2+=trackValidatorTPEtaGreater2p7
710 phase2_tracker.toReplaceWith(tracksValidation, tracksValidationPhase2)
711 
712 
713 fastSim.toReplaceWith(tracksValidation, tracksValidation.copyAndExclude([
714  trackValidatorBuildingPreSplitting,
715  trackValidatorConversion,
716  trackValidatorGsfTracks,
717 ]))
718 
719 
720 
721 # Select by originalAlgo and algoMask
722 _taskForEachEra(_addSelectorsByOriginalAlgoMask, modDict = globals(),
723  args = ["_selectorsByAlgoAndHpNoGenTk"], plainArgs = ["ByAlgoMask", "algorithmMaskContains"],
724  names = "_selectorsByAlgoMask", task = "_tracksValidationSelectorsByAlgoMaskStandalone")
725 
726 # Select pT>0.9 by iteration
727 # Need to avoid generalTracks+HP because those are already included in the standard validator
728 _taskForEachEra(_addSelectorsBySrc, modDict = globals(),
729  args = ["_selectorsByAlgoAndHpNoGenTk"], plainArgs = ["Pt09", "generalTracksPt09"],
730  names = "_selectorsPt09Standalone", task = "_tracksValidationSelectorsPt09Standalone")
731 
732 # Select fromPV by iteration
733 # Need to avoid generalTracks+HP because those are already included in the standard validator
734 _taskForEachEra(_addSelectorsBySrc, modDict = globals(),
735  args = ["_selectorsByAlgoAndHpNoGenTk"], plainArgs = ["FromPV", "generalTracksFromPV"],
736  names = "_selectorsFromPVStandalone", task = "_tracksValidationSelectorsFromPVStandalone")
737 
738 # Select pt>0.9 and fromPV by iteration
739 # Need to avoid generalTracks+HP because those are already included in the standard validator
740 _taskForEachEra(_addSelectorsBySrc, modDict = globals(),
741  args = ["_selectorsByAlgoAndHpNoGenTk"], plainArgs = ["FromPVPt09", "generalTracksFromPVPt09"],
742  names = "_selectorsFromPVPt09Standalone", task = "_tracksValidationSelectorsFromPVPt09Standalone")
743 
744 # MTV instances
745 trackValidatorStandalone = trackValidator.clone(
746  cores = "highPtJets"
747 )
748 trackValidatorTPPtLess09Standalone = trackValidatorTPPtLess09.clone(
749  cores = "highPtJets"
750 )
751 for _eraName, _postfix, _era in _relevantEras:
752  _setForEra(trackValidatorStandalone, _eraName, _era, label = trackValidator.label + locals()["_selectorsByAlgoMask"+_postfix] + locals()["_selectorsPt09Standalone"+_postfix])
753  _setForEra(trackValidatorTPPtLess09Standalone, _eraName, _era, label = trackValidatorTPPtLess09.label + locals()["_selectorsByAlgoMask"+_postfix] + locals()["_selectorsPt09Standalone"+_postfix])
754 
755 trackValidatorFromPVStandalone = trackValidatorFromPV.clone(
756  cores = "highPtJets"
757 )
758 for _eraName, _postfix, _era in _relevantEras:
759  _setForEra(trackValidatorFromPVStandalone, _eraName, _era, label = trackValidatorFromPV.label + locals()["_selectorsFromPVStandalone"+_postfix] + locals()["_selectorsFromPVPt09Standalone"+_postfix])
760 # do resolutions as in the standard version
761 
762 trackValidatorFromPVAllTPStandalone = trackValidatorFromPVAllTP.clone(
763  label = trackValidatorFromPVStandalone.label.value(),
764  cores = "highPtJets"
765 
766 )
767 trackValidatorAllTPEfficStandalone = trackValidatorAllTPEffic.clone(
768  label = [ x for x in trackValidator.label.value() if x not in ["cutsRecoTracksBtvLike", "cutsRecoTracksAK4PFJets"] and "Pt09" not in x],
769  cores = "highPtJets"
770 )
771 
772 trackValidatorConversionStandalone = trackValidatorConversion.clone(
773  label = [x for x in trackValidatorConversion.label if x != "convStepTracks"],
774  cores = "highPtJets"
775 )
776 
777 trackValidatorBHadronStandalone = trackValidatorBHadron.clone(
778  label = [x for x in trackValidatorStandalone.label if "Pt09" not in x],
779  cores = "highPtJets"
780 )
781 
782 trackValidatorGsfTracksStandalone = trackValidatorGsfTracks.clone(
783  cores = "highPtJets"
784 )
785 
786 # sequences
787 tracksPreValidationStandalone = tracksPreValidation.copy()
788 tracksPreValidationStandalone.add(trackingParticlesBHadron)
789 tracksPreValidationStandalone.replace(highPtJetsForTrk,highPtJets)
790 fastSim.toReplaceWith(tracksPreValidationStandalone, tracksPreValidation)
791 
792 tracksValidationSelectorsStandalone = cms.Task(
793  tracksValidationSelectorsByAlgoMaskStandalone,
794  tracksValidationSelectorsPt09Standalone,
795  tracksValidationSelectorsFromPVStandalone,
796  tracksValidationSelectorsFromPVPt09Standalone
797 )
798 
799 # we copy this for both Standalone and TrackingOnly
800 # and later make modifications from it which change based on era
801 _trackValidatorsBase = cms.Sequence(
802  trackValidatorStandalone +
803  trackValidatorTPPtLess09Standalone +
804  trackValidatorFromPVStandalone +
805  trackValidatorFromPVAllTPStandalone +
806  trackValidatorAllTPEfficStandalone +
807  trackValidatorConversionStandalone +
808  trackValidatorGsfTracksStandalone +
809  trackValidatorBHadronStandalone
810 )
811 
812 _trackValidatorsBasePhase2 = _trackValidatorsBase.copy()
813 _trackValidatorsBasePhase2+=trackValidatorTPEtaGreater2p7
814 phase2_tracker.toReplaceWith(_trackValidatorsBase, _trackValidatorsBasePhase2)
815 
816 trackValidatorsStandalone = _trackValidatorsBase.copy()
817 fastSim.toModify(trackValidatorsStandalone, lambda x: x.remove(trackValidatorConversionStandalone) )
818 
819 tracksValidationStandalone = cms.Sequence(
820  ak4PFL1FastL2L3CorrectorChain +
821  trackValidatorsStandalone,
822  tracksPreValidationStandalone,
823  tracksValidationSelectorsStandalone
824 )
825 
826 
827 
828 # selectors
829 tracksValidationSelectorsTrackingOnly = tracksValidationSelectors.copyAndExclude([ak4JetTracksAssociatorExplicitAll,cutsRecoTracksAK4PFJets]) # selectors using track information only (i.e. no PF)
830 _taskForEachEra(_addSeedToTrackProducers, args=["_seedProducers"], names="_seedSelectors", task="_tracksValidationSeedSelectorsTrackingOnly", includeFastSim=True, modDict=globals())
831 _taskForEachEra(_addSeedToTrackProducers, args=["_seedProducersPreSplitting"], names="_seedSelectorsPreSplitting", task="_tracksValidationSeedSelectorsPreSplittingTrackingOnly", modDict=globals())
832 tracksValidationSeedSelectorsTrackingOnly.add(tracksValidationSeedSelectorsPreSplittingTrackingOnly)
833 
834 # MTV instances
835 trackValidatorTrackingOnly = trackValidatorStandalone.clone(
836  label = [ x for x in trackValidatorStandalone.label if x != "cutsRecoTracksAK4PFJets"],
837  cores = "highPtJetsForTrk"
838  )
839 
840 trackValidatorSeedingTrackingOnly = _trackValidatorSeedingBuilding.clone(
841  dirName = "Tracking/TrackSeeding/",
842  label = _seedSelectors,
843  doSeedPlots = True,
844  doResolutionPlotsForLabels = [ "seedTracksjetCoreRegionalStepSeeds",]
845 )
846 trackValidatorSeedingPreSplittingTrackingOnly = trackValidatorSeedingTrackingOnly.clone(
847  associators = ["quickTrackAssociatorByHitsPreSplitting"],
848  label = _seedSelectorsPreSplitting,
849  doSummaryPlots = False,
850 
851 )
852 for _eraName, _postfix, _era in _relevantErasAndFastSim:
853  _setForEra(trackValidatorSeedingTrackingOnly, _eraName, _era, label = locals()["_seedSelectors"+_postfix])
854 for _eraName, _postfix, _era in _relevantEras:
855  _setForEra(trackValidatorSeedingPreSplittingTrackingOnly, _eraName, _era, label = locals()["_seedSelectorsPreSplitting"+_postfix])
856 
857 
858 trackValidatorConversionTrackingOnly = trackValidatorConversion.clone(label = [x for x in trackValidatorConversion.label if x not in ["ckfInOutTracksFromConversions", "ckfOutInTracksFromConversions"]])
859 
860 trackValidatorBHadronTrackingOnly = trackValidatorBHadron.clone(label = [x for x in trackValidatorTrackingOnly.label if "Pt09" not in x])
861 
862 trackValidatorTPPtLess09TrackingOnly = trackValidatorTPPtLess09Standalone.clone(cores = "highPtJetsForTrk")
863 trackValidatorFromPVTrackingOnly = trackValidatorFromPVStandalone.clone(cores = "highPtJetsForTrk")
864 trackValidatorFromPVAllTPTrackingOnly = trackValidatorFromPVAllTPStandalone.clone(cores = "highPtJetsForTrk")
865 trackValidatorAllTPEfficTrackingOnly = trackValidatorAllTPEfficStandalone.clone(cores = "highPtJetsForTrk")
866 # sequences
867 tracksPreValidationTrackingOnly = tracksPreValidationStandalone.copy()
868 tracksPreValidationTrackingOnly.replace(tracksValidationSelectors, tracksValidationSelectorsTrackingOnly)
869 tracksPreValidationTrackingOnly.replace(highPtJets,highPtJetsForTrk)
870 
871 trackValidatorsTrackingOnly = _trackValidatorsBase.copy()
872 trackValidatorsTrackingOnly.replace(trackValidatorStandalone, trackValidatorTrackingOnly)
873 trackValidatorsTrackingOnly.replace(trackValidatorTPPtLess09Standalone,trackValidatorTPPtLess09TrackingOnly)
874 trackValidatorsTrackingOnly.replace(trackValidatorFromPVStandalone,trackValidatorFromPVTrackingOnly)
875 trackValidatorsTrackingOnly.replace(trackValidatorFromPVAllTPStandalone,trackValidatorFromPVAllTPTrackingOnly)
876 trackValidatorsTrackingOnly.replace(trackValidatorAllTPEfficStandalone,trackValidatorAllTPEfficTrackingOnly)
877 trackValidatorsTrackingOnly += trackValidatorSeedingTrackingOnly
878 trackValidatorsTrackingOnly += trackValidatorSeedingPreSplittingTrackingOnly
879 trackValidatorsTrackingOnly += trackValidatorBuilding
880 trackValidatorsTrackingOnly += trackValidatorBuildingPreSplitting
881 trackValidatorsTrackingOnly.replace(trackValidatorConversionStandalone, trackValidatorConversionTrackingOnly)
882 trackValidatorsTrackingOnly.remove(trackValidatorGsfTracksStandalone)
883 trackValidatorsTrackingOnly.replace(trackValidatorBHadronStandalone, trackValidatorBHadronTrackingOnly)
884 fastSim.toReplaceWith(trackValidatorsTrackingOnly, trackValidatorsTrackingOnly.copyAndExclude([
885  trackValidatorBuildingPreSplitting,
886  trackValidatorSeedingPreSplittingTrackingOnly,
887  trackValidatorConversionTrackingOnly,
888  trackValidatorBHadronTrackingOnly
889 ]))
890 
891 tracksValidationTrackingOnly = cms.Sequence(
892  trackValidatorsTrackingOnly,
893  tracksPreValidationTrackingOnly,
894  tracksValidationSelectorsStandalone,
895  tracksValidationSeedSelectorsTrackingOnly
896 )
897 
898 
899 
900 trackingParticlePixelTrackAsssociation = trackingParticleRecoTrackAsssociation.clone(
901  label_tr = "pixelTracks",
902  associator = "quickTrackAssociatorByHitsPreSplitting",
903 )
904 PixelVertexAssociatorByPositionAndTracks = VertexAssociatorByPositionAndTracks.clone(
905  trackAssociation = "trackingParticlePixelTrackAsssociation"
906 )
907 
908 trackValidatorPixelTrackingOnly = trackValidator.clone(
909  dirName = "Tracking/PixelTrack/",
910  label = ["pixelTracks"],
911  doResolutionPlotsForLabels = [],
912  trackCollectionForDrCalculation = "pixelTracks",
913  associators = ["trackingParticlePixelTrackAsssociation"],
914  label_vertex = "pixelVertices",
915  vertexAssociator = "PixelVertexAssociatorByPositionAndTracks",
916  dodEdxPlots = False,
917  cores = cms.InputTag(""),
918 )
919 
920 tracksValidationTruthPixelTrackingOnly = tracksValidationTruth.copy()
921 tracksValidationTruthPixelTrackingOnly.replace(trackingParticleRecoTrackAsssociation, trackingParticlePixelTrackAsssociation)
922 tracksValidationTruthPixelTrackingOnly.replace(VertexAssociatorByPositionAndTracks, PixelVertexAssociatorByPositionAndTracks)
923 tracksValidationPixelTrackingOnly = cms.Sequence(
924  trackValidatorPixelTrackingOnly,
925  tracksValidationTruthPixelTrackingOnly
926 )
927 
928 
929 
930 trackValidatorLite = trackValidator.clone(
931  label = ["generalTracks", "cutsRecoTracksHp"]
932 )
933 tracksValidationLite = cms.Sequence(
934  cutsRecoTracksHp +
935  trackValidatorLite,
936  tracksValidationTruth
937 )
938 
939 
940 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
941 phase2_timing_layer.toModify( generalTracksFromPV,
942  timesTag = cms.InputTag('tofPID:t0'),
943  timeResosTag = cms.InputTag('tofPID:sigmat0'),
944  nSigmaDtVertex = cms.double(3) )
945 phase2_timing_layer.toModify( trackValidatorStandalone,
946  label_vertex = cms.untracked.InputTag('offlinePrimaryVertices4D') )
947 phase2_timing_layer.toModify( trackValidatorFromPVStandalone,
948  label_vertex = cms.untracked.InputTag('offlinePrimaryVertices4D') )
949 phase2_timing_layer.toModify( trackValidatorFromPVAllTPStandalone,
950  label_vertex = cms.untracked.InputTag('offlinePrimaryVertices4D') )
951 phase2_timing_layer.toModify( trackValidatorConversionStandalone,
952  label_vertex = cms.untracked.InputTag('offlinePrimaryVertices4D') )
953 phase2_timing_layer.toModify( trackValidatorGsfTracks,
954  label_vertex = cms.untracked.InputTag('offlinePrimaryVertices4D') )
TrackValidation_cff._addSelectorsBySrc
_addSelectorsBySrc
Definition: TrackValidation_cff.py:306
TrackWithVertexRefSelector_cfi
TrackValidation_cff._addSelectorsByAlgo
_addSelectorsByAlgo
Definition: TrackValidation_cff.py:252
ElectronSeeds_cff
LhcParametersDefinerForTP_cfi
TrackValidation_cff._getSeedingLayers
def _getSeedingLayers(seedProducers, config)
Definition: TrackValidation_cff.py:191
ak4JTA_cff
TrackValidation_cff._translateArgs
def _translateArgs(args, postfix, modDict)
Definition: TrackValidation_cff.py:148
trackAssociatorByChi2_cfi
TrackValidation_cff._addSelectorsByHp
_addSelectorsByHp
Definition: TrackValidation_cff.py:255
iterativeTk_cff
trackingParticleNumberOfLayersProducer_cff
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
MultiTrackValidator_cfi
TrackValidation_cff._getMVASelectors
def _getMVASelectors(postfix)
Definition: TrackValidation_cff.py:241
TrackValidation_cff._addSelectorsByOriginalAlgoMask
_addSelectorsByOriginalAlgoMask
Then define stuff for standalone mode (i.e.
Definition: TrackValidation_cff.py:264
TrackValidation_cff._algoToSelector
def _algoToSelector(algo)
Definition: TrackValidation_cff.py:60
TrackValidation_cff.modifyTask
modifyTask
Definition: TrackValidation_cff.py:310
Exception
tpClusterProducer_cfi
JetCorrectors_cff
TrackValidation_cff._addSeedToTrackProducers
_addSeedToTrackProducers
Definition: TrackValidation_cff.py:830
TrackValidation_cff._taskForEachEra
def _taskForEachEra(function, args, names, task, modDict, plainArgs=[], modifyTask=None, includeFastSim=False)
Definition: TrackValidation_cff.py:156
TrackValidation_cff._setForEra
def _setForEra(module, eraName, era, **kwargs)
Definition: TrackValidation_cff.py:183
VertexAssociatorByPositionAndTracks_cfi
PostProcessorTracker_cfi
quickTrackAssociatorByHits_cfi
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
pileupCalc.upper
upper
Definition: pileupCalc.py:214
cutsRecoTracks_cfi
CosmicParametersDefinerForTP_cfi
trackingParticleRecoTrackAsssociation_cfi
TrackValidation_cff._uniqueFirstLayers
def _uniqueFirstLayers(layerList)
Definition: TrackValidation_cff.py:578
ConversionStep_cff