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