4 import FWCore.ParameterSet.Config
as cms
7 _nonDefaultEraNames = [
"trackingLowPU",
"trackingPhase1",
"trackingPhase2PU140"]
10 _defaultEra = (_defaultEraName,
"",
None)
12 (_name,
"_"+_name, getattr(__import__(
'Configuration.Eras.Modifier_'+_name+
'_cff',globals(),locals(),[_name],0),_name)) \
13 for _name
in _nonDefaultEraNames
16 _allEras = [_defaultEra] + _nonDefaultEras
21 "DetachedTripletStep",
27 "JetCoreRegionalStep",
29 _iterations_trackingLowPU = [
33 "DetachedTripletStep",
38 _iterations_trackingPhase1 = [
44 "DetachedTripletStep",
51 from Configuration.ProcessModifiers.displacedTracking_cff
import displacedTracking
52 displacedTracking.toModify(_iterations_trackingPhase1, func=
lambda x: x.append(
'DisplacedGeneralStep'))
54 _iterations_trackingPhase1.append(
'JetCoreRegionalStep')
56 _iterations_trackingPhase2PU140 = [
64 from Configuration.ProcessModifiers.vectorHits_cff
import vectorHits
65 vectorHits.toModify(_iterations_trackingPhase2PU140, func=
lambda x: x.append(
'PixelLessStep'))
66 _iterations_muonSeeded = [
67 "MuonSeededStepInOut",
68 "MuonSeededStepOutIn",
70 _iterations_muonSeeded_trackingPhase1 = [
71 "MuonSeededStepInOut",
72 "MuonSeededStepOutIn",
75 _iterations_muonSeeded_trackingPhase2PU140 = [
76 "MuonSeededStepInOut",
77 "MuonSeededStepOutIn",
79 _multipleSeedProducers = {
80 "MixedTripletStep": [
"A",
"B"],
81 "TobTecStep": [
"Pair",
"Tripl"],
83 _multipleSeedProducers_trackingLowPU = {
84 "MixedTripletStep": [
"A",
"B"],
86 _multipleSeedProducers_trackingPhase1 = {
87 "PixelPairStep": [
"A",
"B"],
88 "MixedTripletStep": [
"A",
"B"],
89 "TobTecStep": [
"Pair",
"Tripl"],
91 from Configuration.ProcessModifiers.seedingDeepCore_cff
import seedingDeepCore
92 seedingDeepCore.toModify(_multipleSeedProducers_trackingPhase1, func=
lambda x: x.update({
"JetCoreRegionalStep": [
"Barrel",
"Endcap"]}))
95 _multipleSeedProducers_trackingPhase2PU140 = {}
96 _oldStyleHasSelector = set([
106 from Configuration.ProcessModifiers.displacedRegionalTracking_cff
import displacedRegionalTracking
107 displacedRegionalTracking.toModify(_iterations_muonSeeded_trackingPhase1, func=
lambda x: x.append(
'DisplacedRegionalStep'))
108 displacedRegionalTracking.toModify(_multipleSeedProducers_trackingPhase1, func=
lambda x: x.update({
'DisplacedRegionalStep': [
'Pair',
'Tripl']}))
111 _trackClusterRemoverBase = _trackClusterRemover.clone(
113 pixelClusters =
"siPixelClusters",
114 stripClusters =
"siStripClusters",
115 TrackQuality =
'highPurity',
116 minNumberOfLayersWithMeasBeforeFiltering = 0,
119 from Configuration.ProcessModifiers.pp_on_AA_cff
import pp_on_AA
120 from Configuration.ProcessModifiers.trackdnn_cff
import trackdnn
121 (pp_on_AA & (~trackdnn) ).toModify(_trackClusterRemoverBase, TrackQuality =
'tight')
124 from RecoLocalTracker.SubCollectionProducers.phase2trackClusterRemover_cfi
import phase2trackClusterRemover
as _phase2trackClusterRemover
125 _trackClusterRemoverBase_trackingPhase2PU140 = _phase2trackClusterRemover.clone(
127 phase2pixelClusters =
"siPixelClusters",
128 phase2OTClusters =
"siPhase2Clusters",
129 TrackQuality =
'highPurity',
130 minNumberOfLayersWithMeasBeforeFiltering = 0,
134 return iteration[0].lower()+iteration[1:]
142 def _classifier(iteration, oldStyle=False, oldStyleQualityMasks=False):
145 if iteration
in _oldStyleHasSelector:
146 return pre+
"Selector:" + (
"QualityMasks" if oldStyleQualityMasks
else pre)
150 return pre+
":QualityMasks" 156 return _nonDefaultEras
160 for it
in globals()[
"_iterations"+postfix]:
161 task.add(modDict[it+
'Task'])
165 muonVariable =
"_iterations_muonSeeded"+postfix
166 iterations = globals()[
"_iterations"+postfix] + globals().get(muonVariable, _iterations_muonSeeded)
168 if includeSequenceName:
175 iters = globals()[
"_iterations"+postfix]
177 multipleSeedProducers = globals()[
"_multipleSeedProducers"+postfix]
179 multipleSeedProducers =
None 182 if multipleSeedProducers
is not None and i
in multipleSeedProducers:
183 ret.extend([seeder+m
for m
in multipleSeedProducers[i]])
187 for i
in globals().get(
"_iterations_muonSeeded"+postfix, _iterations_muonSeeded):
203 module = _trackClusterRemoverBase.clone()
204 if eraName ==
"trackingPhase2PU140":
205 module = globals().get(
"_trackClusterRemoverBase"+postfix, _trackClusterRemoverBase)
207 iters = globals()[
"_iterations"+postfix]
211 ind = iters.index(iteration)
if iteration !=
"DisplacedRegionalStep" else len(iters)
217 raise Exception(
"Iteration %s is the first iteration in era %s, asking cluster remover configuration does not make sense" % (iteration, eraName))
218 prevIter = iters[ind-1]
221 if prevIter ==
"JetCoreRegionalStep":
222 prevIter = iters[ind-2]
225 trajectories =
_tracks(prevIter),
228 if eraName
in [
"trackingPhase2PU140"]:
229 customize[
"overrideTrkQuals"] =
_classifier(prevIter, oldStyle=
True)
230 elif eraName ==
"trackingLowPU":
231 customize[
"overrideTrkQuals"] =
_classifier(prevIter, oldStyle=
True, oldStyleQualityMasks=
True)
233 customize[
"trackClassifier"] =
_classifier(prevIter)
235 return module.clone(**customize)
def clusterRemoverForIter(iteration, eraName="", postfix="", module=None)
def iterationAlgos(postfix, includeSequenceName=False)
def _seedOrTrackProducers(postfix, typ)
def replace(string, replacements)
def _clusterRemover(iteration)
def trackProducers(postfix)
def seedProducers(postfix)
def _classifier(iteration, oldStyle=False, oldStyleQualityMasks=False)
def createEarlyTask(eraName, postfix, modDict)
def _modulePrefix(iteration)