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 vertexAnalysis = cms.EDAnalyzer("PrimaryVertexAnalyzer4PUSlimmed",
16  use_only_charged_tracks = cms.untracked.bool(True),
17  do_generic_sim_plots = cms.untracked.bool(True),
18  verbose = cms.untracked.bool(False),
19  root_folder = cms.untracked.string("Vertexing/PrimaryVertexV"),
20  trackingParticleCollection = cms.untracked.InputTag("mix", "MergedTrackTruth"),
21  trackingVertexCollection = cms.untracked.InputTag("mix", "MergedTrackTruth"),
22  trackAssociatorMap = cms.untracked.InputTag("trackingParticleRecoTrackAsssociation"),
23  vertexAssociator = cms.untracked.InputTag("VertexAssociatorByPositionAndTracks"),
24  vertexRecoCollections = cms.VInputTag("offlinePrimaryVertices",
25  "offlinePrimaryVerticesWithBS",
26  "selectedOfflinePrimaryVertices",
27  "selectedOfflinePrimaryVerticesWithBS"
28  ),
29 )
30 
31 vertexAnalysisTrackingOnly = vertexAnalysis.clone(
32  vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value() + [
33  "firstStepPrimaryVerticesPreSplitting",
34  "firstStepPrimaryVertices"
35  ]
36 )
37 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
38 trackingLowPU.toModify(vertexAnalysisTrackingOnly, vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value())
39 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
40 trackingPhase2PU140.toModify(vertexAnalysisTrackingOnly,
41  vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value() + [
42  "firstStepPrimaryVertices"
43  ]
44 )
45 
46 pixelVertexAnalysisTrackingOnly = vertexAnalysis.clone(
47  do_generic_sim_plots = False,
48  trackAssociatorMap = "trackingParticlePixelTrackAsssociation",
49  vertexRecoCollections = [
50  "pixelVertices",
51  "selectedPixelVertices"
52  ]
53 )
54 
55 ##########
56 
57 vertexAnalysisSelection = cms.Sequence(
58  cms.ignore(selectedOfflinePrimaryVertices)
59  + cms.ignore(selectedOfflinePrimaryVerticesWithBS)
60 )
61 
62 ##########
63 
64 vertexAnalysisSequence = cms.Sequence(
65  vertexAnalysisSelection
66  + vertexAnalysis
67 )
68 
69 vertexAnalysisSequenceTrackingOnly = cms.Sequence(
70  vertexAnalysisSelection
71  + vertexAnalysisTrackingOnly
72 )
73 
74 from SimTracker.TrackAssociation.trackingParticleRecoTrackAsssociation_cfi import trackingParticleRecoTrackAsssociation as _trackingParticleRecoTrackAsssociation
75 trackingParticlePixelTrackAsssociation = _trackingParticleRecoTrackAsssociation.clone(
76  label_tr = "pixelTracks"
77 )
78 
79 _vertexAnalysisSequenceTrackingOnly_trackingLowPU = vertexAnalysisSequenceTrackingOnly.copy()
80 _vertexAnalysisSequenceTrackingOnly_trackingLowPU += (
81  trackingParticlePixelTrackAsssociation
82  + selectedPixelVertices
83  + pixelVertexAnalysisTrackingOnly
84 )
85 trackingLowPU.toReplaceWith(vertexAnalysisSequenceTrackingOnly, _vertexAnalysisSequenceTrackingOnly_trackingLowPU)
86 
87 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
88 _vertexRecoCollectionsTiming = cms.VInputTag("offlinePrimaryVertices",
89  "offlinePrimaryVerticesWithBS",
90  "selectedOfflinePrimaryVertices",
91  "selectedOfflinePrimaryVerticesWithBS",
92  "offlinePrimaryVertices4D",
93  "selectedOfflinePrimaryVertices4D",
94  )
95 selectedOfflinePrimaryVertices4D = selectedOfflinePrimaryVertices.clone(src = cms.InputTag("offlinePrimaryVertices4D"))
96 
97 _vertexAnalysisSelectionTiming = vertexAnalysisSelection.copy()
98 _vertexAnalysisSelectionTiming += selectedOfflinePrimaryVertices4D
99 
100 phase2_timing_layer.toModify( vertexAnalysis,
101  vertexRecoCollections = _vertexRecoCollectionsTiming
102  )
103 phase2_timing_layer.toReplaceWith( vertexAnalysisSelection,
104  _vertexAnalysisSelectionTiming )