CMS 3D CMS Logo

customizeInitialStepOnly.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 def removePath(process, pname):
4  if hasattr(process, pname):
5  process.schedule.remove(getattr(process, pname))
6  delattr(process, pname)
7 
9  # Customize reconstruction
10  process.trackerClusterCheck.PixelClusterCollectionLabel = 'siPixelClustersPreSplitting'
11  process.initialStepSeedLayers.FPix.HitProducer = 'siPixelRecHitsPreSplitting'
12  process.initialStepSeedLayers.BPix.HitProducer = 'siPixelRecHitsPreSplitting'
13  process.initialStepHitQuadruplets.SeedComparitorPSet.clusterShapeCacheSrc = "siPixelClusterShapeCachePreSplitting"
14  process.initialStepSeeds.SeedComparitorPSet.ClusterShapeCacheSrc = "siPixelClusterShapeCachePreSplitting"
15  if hasattr(process.initialStepTrackCandidates, "measurementTrackerEvent"):
16  # mkFit case
17  process.initialStepTrackCandidates.measurementTrackerEvent = 'MeasurementTrackerEventPreSplitting'
18  process.initialStepTrackCandidatesMkFitInput.pixelRecHits = "siPixelRecHitsPreSplitting"
19  else:
20  process.initialStepTrackCandidates.MeasurementTrackerEvent = 'MeasurementTrackerEventPreSplitting'
21  process.initialStepTracks.MeasurementTrackerEvent = 'MeasurementTrackerEventPreSplitting'
22  process.iterTrackingTask = cms.Task(process.trackerClusterCheck,
23  process.InitialStepTask)
24 
25  # Customize MTV
26  for selector in [
27  process.cutsRecoTracksInitialStep,
28  process.cutsRecoTracksPt09InitialStep,
29  process.cutsRecoTracksFromPVInitialStep,
30  process.cutsRecoTracksFromPVPt09InitialStep,
31  ]:
32  selector.algorithm = []
33  selector.quality = []
34  selector.src = "initialStepTracks"
35  selector.vertexTag = "firstStepPrimaryVertices"
36 
37  process.trackingParticleRecoTrackAsssociationPreSplitting = process.trackingParticleRecoTrackAsssociation.clone(
38  label_tr = "initialStepTracks",
39  associator = "quickTrackAssociatorByHitsPreSplitting",
40  )
41  process.VertexAssociatorByPositionAndTracksPreSplitting = process.VertexAssociatorByPositionAndTracks.clone(
42  trackAssociation = "trackingParticleRecoTrackAsssociationPreSplitting"
43  )
44 
45 
46  def setInput(mtvs, labels):
47  for mtv in mtvs:
48  mod = getattr(process, mtv)
49  mod.label = labels
50  mod.label_vertex = "firstStepPrimaryVertices"
51  if mod.UseAssociators.value():
52  mod.associators = ["quickTrackAssociatorByHitsPreSplitting"]
53  else:
54  mod.associators = ["trackingParticleRecoTrackAsssociationPreSplitting"]
55  mod.vertexAssociator = "VertexAssociatorByPositionAndTracksPreSplitting"
56  mod.trackCollectionForDrCalculation = "initialStepTracks"
57  mod.dodEdxPlots = False
58  mod.doResolutionPlotsForLabels = []
59 
60  setInput(["trackValidatorTrackingOnly", "trackValidatorAllTPEfficStandalone",
61  "trackValidatorTPPtLess09Standalone", "trackValidatorBHadronTrackingOnly"],
62  ["cutsRecoTracksInitialStep", "cutsRecoTracksPt09InitialStep"])
63  setInput(["trackValidatorFromPVStandalone", "trackValidatorFromPVAllTPStandalone"],
64  ["cutsRecoTracksFromPVInitialStep", "cutsRecoTracksFromPVPt09InitialStep"])
65  setInput(["trackValidatorSeedingTrackingOnly"], ["seedTracksinitialStepSeeds"])
66  setInput(["trackValidatorBuilding"], ["initialStepTracks"])
67  process.trackValidatorBuilding.mvaLabels = cms.untracked.PSet(initialStepTracks = cms.untracked.vstring('initialStep'))
68 
69  process.tracksPreValidationTrackingOnly = cms.Task(
70  process.cutsRecoTracksInitialStep,
71  process.cutsRecoTracksPt09InitialStep,
72  process.cutsRecoTracksFromPVInitialStep,
73  process.cutsRecoTracksFromPVPt09InitialStep,
74  process.tracksValidationTruth,
75  process.trackingParticlesSignal,
76  process.trackingParticlesBHadron,
77  process.trackingParticleRecoTrackAsssociationPreSplitting,
78  process.VertexAssociatorByPositionAndTracksPreSplitting,
79  )
80  process.trackValidatorsTrackingOnly.remove(process.trackValidatorConversionTrackingOnly)
81  process.trackValidatorsTrackingOnly.remove(process.trackValidatorSeedingPreSplittingTrackingOnly)
82  process.trackValidatorsTrackingOnly.remove(process.trackValidatorBuildingPreSplitting)
83 
84  # Remove vertex validation
85  process.globalPrevalidationTrackingOnly.remove(process.vertexValidationTrackingOnly)
86 
87  # Remove DQM
88  removePath(process, "dqmoffline_step")
89  removePath(process, "dqmofflineOnPAT_step")
90 
91  # Remove RECO output if it exists
92  removePath(process, "RECOSIMoutput_step")
93 
94  return process
95 
96 
98  process = customizeInitialStepOnly(process)
99 
100  process.options.wantSummary = cms.untracked.bool(True)
101 
102  # Remove validation
103  removePath(process, "prevalidation_step")
104  removePath(process, "validation_step")
105  removePath(process, "DQMoutput_step")
106 
107  # Minimize the rest
108  process.RawToDigiTask = cms.Task(
109  process.siPixelDigis,
110  process.siStripDigis
111  )
112  process.reconstruction_trackingOnly = cms.Sequence(
113  process.trackerlocalreco +
114  process.offlineBeamSpot +
115  process.siPixelClusterShapeCachePreSplitting +
116  process.MeasurementTrackerEventPreSplitting,
117  process.iterTrackingTask
118  )
119  process.trackerlocalrecoTask.remove(process.clusterSummaryProducer)
120  process.iterTrackingTask.remove(process.ak4CaloJetsForTrk)
121  process.iterTrackingTask.remove(process.caloTowerForTrk)
122  process.iterTrackingTask.remove(process.firstStepPrimaryVertices)
123  process.iterTrackingTask.remove(process.firstStepPrimaryVerticesUnsorted)
124  process.iterTrackingTask.remove(process.initialStepTrackRefsForJets)
125  process.iterTrackingTask.remove(process.initialStepClassifier1)
126  process.iterTrackingTask.remove(process.initialStep)
127 
128  # Add a dummy output module to trigger the (minimal) prefetching
129  process.out = cms.OutputModule("AsciiOutputModule",
130  outputCommands = cms.untracked.vstring(
131  "keep *_initialStepTracks_*_*",
132  ),
133  verbosity = cms.untracked.uint32(0)
134  )
135  process.outPath = cms.EndPath(process.out)
136  process.schedule = cms.Schedule(process.raw2digi_step, process.reconstruction_step, process.outPath)
137 
138  # Minimize printouts
139  process.MessageLogger.cerr.FwkReport.reportEvery = 100
140  process.MessageLogger.cerr.default.limit = 1
141  process.MessageLogger.suppressWarning.extend([
142  "initialStepTrackCandidatesMkFitInput",
143  "initialStepTrackCandidatesMkFit",
144  "initialStepTrackCandidates",
145  "initialStepTracks",
146  ])
147 
148  return process
customizeInitialStepOnly.customizeInitialStepOnlyNoMTV
def customizeInitialStepOnlyNoMTV(process)
Definition: customizeInitialStepOnly.py:97
customizeInitialStepOnly.customizeInitialStepOnly
def customizeInitialStepOnly(process)
Definition: customizeInitialStepOnly.py:8
customizeInitialStepOnly
Definition: customizeInitialStepOnly.py:1
customizeInitialStepOnly.removePath
def removePath(process, pname)
Definition: customizeInitialStepOnly.py:3