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