CMS 3D CMS Logo

PrimaryVertexAnalyzer4PUSlimmed_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 selectedOfflinePrimaryVertices = cms.EDFilter("VertexSelector",
4  src = cms.InputTag('offlinePrimaryVertices'),
5  cut = cms.string("isValid & ndof > 4 & tracksSize > 0 & abs(z) <= 24 & abs(position.Rho) <= 2."),
6  filter = cms.bool(False)
7 )
8 
9 selectedOfflinePrimaryVerticesWithBS = selectedOfflinePrimaryVertices.clone(
10  src = 'offlinePrimaryVerticesWithBS'
11 )
12 selectedPixelVertices = selectedOfflinePrimaryVertices.clone(
13  src = 'pixelVertices'
14 )
15 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
16 vertexAnalysis = DQMEDAnalyzer('PrimaryVertexAnalyzer4PUSlimmed',
17  use_only_charged_tracks = cms.untracked.bool(True),
18  do_generic_sim_plots = cms.untracked.bool(True),
19  verbose = cms.untracked.bool(False),
20  root_folder = cms.untracked.string("Vertexing/PrimaryVertexV"),
21  trackingParticleCollection = cms.untracked.InputTag("mix", "MergedTrackTruth"),
22  trackingVertexCollection = cms.untracked.InputTag("mix", "MergedTrackTruth"),
23  trackAssociatorMap = cms.untracked.InputTag("trackingParticleRecoTrackAsssociation"),
24  vertexAssociator = cms.untracked.InputTag("VertexAssociatorByPositionAndTracks"),
25  vertexRecoCollections = cms.VInputTag("offlinePrimaryVertices",
26  "offlinePrimaryVerticesWithBS",
27  "selectedOfflinePrimaryVertices",
28  "selectedOfflinePrimaryVerticesWithBS"
29  ),
30  nPUbins = cms.uint32(130)
31 )
32 
33 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
34 phase2_tracker.toModify( vertexAnalysis,
35  nPUbins = 250 )
36 
37 from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
38 premix_stage2.toModify(vertexAnalysis,
39  trackingParticleCollection = "mixData:MergedTrackTruth",
40  trackingVertexCollection = "mixData:MergedTrackTruth",
41 )
42 
43 vertexAnalysisTrackingOnly = vertexAnalysis.clone(
44  vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value() + [
45  "firstStepPrimaryVerticesPreSplitting",
46  "firstStepPrimaryVertices"
47  ]
48 )
49 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
50 trackingLowPU.toModify(vertexAnalysisTrackingOnly, vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value())
51 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
52 trackingPhase2PU140.toModify(vertexAnalysisTrackingOnly,
53  vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value() + [
54  "firstStepPrimaryVertices"
55  ]
56 )
57 
58 pixelVertexAnalysisTrackingOnly = vertexAnalysis.clone(
59  do_generic_sim_plots = False,
60  trackAssociatorMap = "trackingParticlePixelTrackAsssociation",
61  vertexAssociator = "PixelVertexAssociatorByPositionAndTracks",
62  vertexRecoCollections = [
63  "pixelVertices",
64  "selectedPixelVertices"
65  ]
66 )
67 pixelVertexAnalysisPixelTrackingOnly = pixelVertexAnalysisTrackingOnly.clone(
68  do_generic_sim_plots = True,
69 )
70 
71 
72 
73 vertexAnalysisSelection = cms.Sequence(
74  cms.ignore(selectedOfflinePrimaryVertices)
75  + cms.ignore(selectedOfflinePrimaryVerticesWithBS)
76 )
77 
78 
79 
80 vertexAnalysisSequence = cms.Sequence(
81  vertexAnalysisSelection
82  + vertexAnalysis
83 )
84 
85 vertexAnalysisSequenceTrackingOnly = cms.Sequence(
86  vertexAnalysisSelection
87  + vertexAnalysisTrackingOnly
88 )
89 
90 _vertexAnalysisSequenceTrackingOnly_trackingLowPU = vertexAnalysisSequenceTrackingOnly.copy()
91 _vertexAnalysisSequenceTrackingOnly_trackingLowPU += (
92  selectedPixelVertices
93  + pixelVertexAnalysisTrackingOnly
94 )
95 trackingLowPU.toReplaceWith(vertexAnalysisSequenceTrackingOnly, _vertexAnalysisSequenceTrackingOnly_trackingLowPU)
96 
97 vertexAnalysisSequencePixelTrackingOnly = cms.Sequence(
98  selectedPixelVertices
99  + pixelVertexAnalysisPixelTrackingOnly
100 )
101 
102 
103 
104 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
105 _vertexRecoCollectionsTiming = cms.VInputTag("offlinePrimaryVertices",
106  "offlinePrimaryVerticesWithBS",
107  "selectedOfflinePrimaryVertices",
108  "selectedOfflinePrimaryVerticesWithBS",
109  "offlinePrimaryVertices4D",
110  "selectedOfflinePrimaryVertices4D",
111  )
112 selectedOfflinePrimaryVertices4D = selectedOfflinePrimaryVertices.clone(src = cms.InputTag("offlinePrimaryVertices4D"))
113 
114 _vertexAnalysisSelectionTiming = vertexAnalysisSelection.copy()
115 _vertexAnalysisSelectionTiming += selectedOfflinePrimaryVertices4D
116 
117 phase2_timing_layer.toModify( vertexAnalysis,
118  vertexRecoCollections = _vertexRecoCollectionsTiming
119  )
120 phase2_timing_layer.toReplaceWith( vertexAnalysisSelection,
121  _vertexAnalysisSelectionTiming )