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'))
67 from Configuration.ProcessModifiers.jetCoreInPhase2_cff
import jetCoreInPhase2
68 jetCoreInPhase2.toModify(_iterations_trackingPhase2PU140, func=
lambda x: x.append(
'JetCoreRegionalStep'))
70 _iterations_muonSeeded = [
71 "MuonSeededStepInOut",
72 "MuonSeededStepOutIn",
74 _iterations_muonSeeded_trackingPhase1 = [
75 "MuonSeededStepInOut",
76 "MuonSeededStepOutIn",
79 _iterations_muonSeeded_trackingPhase2PU140 = [
80 "MuonSeededStepInOut",
81 "MuonSeededStepOutIn",
83 _multipleSeedProducers = {
84 "MixedTripletStep": [
"A",
"B"],
85 "TobTecStep": [
"Pair",
"Tripl"],
87 _multipleSeedProducers_trackingLowPU = {
88 "MixedTripletStep": [
"A",
"B"],
90 _multipleSeedProducers_trackingPhase1 = {
91 "PixelPairStep": [
"A",
"B"],
92 "MixedTripletStep": [
"A",
"B"],
93 "TobTecStep": [
"Pair",
"Tripl"],
95 from Configuration.ProcessModifiers.seedingDeepCore_cff
import seedingDeepCore
96 seedingDeepCore.toModify(_multipleSeedProducers_trackingPhase1, func=
lambda x: x.update({
"JetCoreRegionalStep": [
"Barrel",
"Endcap"]}))
99 _multipleSeedProducers_trackingPhase2PU140 = {}
100 _oldStyleHasSelector = set([
110 from Configuration.ProcessModifiers.displacedRegionalTracking_cff
import displacedRegionalTracking
111 displacedRegionalTracking.toModify(_iterations_muonSeeded_trackingPhase1, func=
lambda x: x.append(
'DisplacedRegionalStep'))
112 displacedRegionalTracking.toModify(_multipleSeedProducers_trackingPhase1, func=
lambda x: x.update({
'DisplacedRegionalStep': [
'Pair',
'Tripl']}))
115 _trackClusterRemoverBase = _trackClusterRemover.clone(
117 pixelClusters =
"siPixelClusters",
118 stripClusters =
"siStripClusters",
119 TrackQuality =
'highPurity',
120 minNumberOfLayersWithMeasBeforeFiltering = 0,
123 from Configuration.ProcessModifiers.pp_on_AA_cff
import pp_on_AA
124 from Configuration.ProcessModifiers.trackdnn_cff
import trackdnn
125 (pp_on_AA & (~trackdnn) ).toModify(_trackClusterRemoverBase, TrackQuality =
'tight')
128 from RecoLocalTracker.SubCollectionProducers.phase2trackClusterRemover_cfi
import phase2trackClusterRemover
as _phase2trackClusterRemover
129 _trackClusterRemoverBase_trackingPhase2PU140 = _phase2trackClusterRemover.clone(
131 phase2pixelClusters =
"siPixelClusters",
132 phase2OTClusters =
"siPhase2Clusters",
133 TrackQuality =
'highPurity',
134 minNumberOfLayersWithMeasBeforeFiltering = 0,
138 return iteration[0].lower()+iteration[1:]
146 def _classifier(iteration, oldStyle=False, oldStyleQualityMasks=False):
149 if iteration
in _oldStyleHasSelector:
150 return pre+
"Selector:" + (
"QualityMasks" if oldStyleQualityMasks
else pre)
154 return pre+
":QualityMasks" 160 return _nonDefaultEras
164 for it
in globals()[
"_iterations"+postfix]:
165 task.add(modDict[it+
'Task'])
169 muonVariable =
"_iterations_muonSeeded"+postfix
170 iterations = globals()[
"_iterations"+postfix] + globals().get(muonVariable, _iterations_muonSeeded)
172 if includeSequenceName:
179 iters = globals()[
"_iterations"+postfix]
181 multipleSeedProducers = globals()[
"_multipleSeedProducers"+postfix]
183 multipleSeedProducers =
None 186 if multipleSeedProducers
is not None and i
in multipleSeedProducers:
187 ret.extend([seeder+m
for m
in multipleSeedProducers[i]])
191 for i
in globals().get(
"_iterations_muonSeeded"+postfix, _iterations_muonSeeded):
207 module = _trackClusterRemoverBase.clone()
208 if eraName ==
"trackingPhase2PU140":
209 module = globals().get(
"_trackClusterRemoverBase"+postfix, _trackClusterRemoverBase)
211 iters = globals()[
"_iterations"+postfix]
215 ind = iters.index(iteration)
if iteration !=
"DisplacedRegionalStep" else len(iters)
221 raise Exception(
"Iteration %s is the first iteration in era %s, asking cluster remover configuration does not make sense" % (iteration, eraName))
222 prevIter = iters[ind-1]
225 if prevIter ==
"JetCoreRegionalStep":
226 prevIter = iters[ind-2]
229 trajectories =
_tracks(prevIter),
232 if eraName
in [
"trackingPhase2PU140"]:
233 customize[
"overrideTrkQuals"] =
_classifier(prevIter, oldStyle=
True)
234 elif eraName ==
"trackingLowPU":
235 customize[
"overrideTrkQuals"] =
_classifier(prevIter, oldStyle=
True, oldStyleQualityMasks=
True)
237 customize[
"trackClassifier"] =
_classifier(prevIter)
239 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)