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 )
31 from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
32 premix_stage2.toModify(vertexAnalysis,
33  trackingParticleCollection = "mixData:MergedTrackTruth",
34  trackingVertexCollection = "mixData:MergedTrackTruth",
35 )
36 
37 vertexAnalysisTrackingOnly = vertexAnalysis.clone(
38  vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value() + [
39  "firstStepPrimaryVerticesPreSplitting",
40  "firstStepPrimaryVertices"
41  ]
42 )
43 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
44 trackingLowPU.toModify(vertexAnalysisTrackingOnly, vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value())
45 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
46 trackingPhase2PU140.toModify(vertexAnalysisTrackingOnly,
47  vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value() + [
48  "firstStepPrimaryVertices"
49  ]
50 )
51 
52 pixelVertexAnalysisTrackingOnly = vertexAnalysis.clone(
53  do_generic_sim_plots = False,
54  trackAssociatorMap = "trackingParticlePixelTrackAsssociation",
55  vertexAssociator = "PixelVertexAssociatorByPositionAndTracks",
56  vertexRecoCollections = [
57  "pixelVertices",
58  "selectedPixelVertices"
59  ]
60 )
61 pixelVertexAnalysisPixelTrackingOnly = pixelVertexAnalysisTrackingOnly.clone(
62  do_generic_sim_plots = True,
63 )
64 
65 
66 
67 vertexAnalysisSelection = cms.Sequence(
68  cms.ignore(selectedOfflinePrimaryVertices)
69  + cms.ignore(selectedOfflinePrimaryVerticesWithBS)
70 )
71 
72 
73 
74 vertexAnalysisSequence = cms.Sequence(
75  vertexAnalysisSelection
76  + vertexAnalysis
77 )
78 
79 vertexAnalysisSequenceTrackingOnly = cms.Sequence(
80  vertexAnalysisSelection
81  + vertexAnalysisTrackingOnly
82 )
83 
84 _vertexAnalysisSequenceTrackingOnly_trackingLowPU = vertexAnalysisSequenceTrackingOnly.copy()
85 _vertexAnalysisSequenceTrackingOnly_trackingLowPU += (
86  selectedPixelVertices
87  + pixelVertexAnalysisTrackingOnly
88 )
89 trackingLowPU.toReplaceWith(vertexAnalysisSequenceTrackingOnly, _vertexAnalysisSequenceTrackingOnly_trackingLowPU)
90 
91 vertexAnalysisSequencePixelTrackingOnly = cms.Sequence(
92  selectedPixelVertices
93  + pixelVertexAnalysisPixelTrackingOnly
94 )
95 
96 
97 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
98 _vertexRecoCollectionsTiming = cms.VInputTag("offlinePrimaryVertices",
99  "offlinePrimaryVerticesWithBS",
100  "selectedOfflinePrimaryVertices",
101  "selectedOfflinePrimaryVerticesWithBS",
102  "offlinePrimaryVertices4D",
103  "selectedOfflinePrimaryVertices4D",
104  )
105 selectedOfflinePrimaryVertices4D = selectedOfflinePrimaryVertices.clone(src = cms.InputTag("offlinePrimaryVertices4D"))
106 
107 _vertexAnalysisSelectionTiming = vertexAnalysisSelection.copy()
108 _vertexAnalysisSelectionTiming += selectedOfflinePrimaryVertices4D
109 
110 phase2_timing_layer.toModify( vertexAnalysis,
111  vertexRecoCollections = _vertexRecoCollectionsTiming
112  )
113 phase2_timing_layer.toReplaceWith( vertexAnalysisSelection,
114  _vertexAnalysisSelectionTiming )