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_trackingPhase1PU70_cff import trackingPhase1PU70
40 trackingPhase1PU70.toModify(vertexAnalysisTrackingOnly, vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value())
41 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
42 trackingPhase2PU140.toModify(vertexAnalysisTrackingOnly, vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value())
43 
44 pixelVertexAnalysisTrackingOnly = vertexAnalysis.clone(
45  do_generic_sim_plots = False,
46  trackAssociatorMap = "trackingParticlePixelTrackAsssociation",
47  vertexRecoCollections = [
48  "pixelVertices",
49  "selectedPixelVertices"
50  ]
51 )
52 
53 ##########
54 
55 vertexAnalysisSelection = cms.Sequence(
56  cms.ignore(selectedOfflinePrimaryVertices)
57  + cms.ignore(selectedOfflinePrimaryVerticesWithBS)
58 )
59 
60 ##########
61 
62 vertexAnalysisSequence = cms.Sequence(
63  vertexAnalysisSelection
64  + vertexAnalysis
65 )
66 
67 vertexAnalysisSequenceTrackingOnly = cms.Sequence(
68  vertexAnalysisSelection
69  + vertexAnalysisTrackingOnly
70 )
71 
72 from SimTracker.TrackAssociation.trackingParticleRecoTrackAsssociation_cfi import trackingParticleRecoTrackAsssociation as _trackingParticleRecoTrackAsssociation
73 trackingParticlePixelTrackAsssociation = _trackingParticleRecoTrackAsssociation.clone(
74  label_tr = "pixelTracks"
75 )
76 
77 _vertexAnalysisSequenceTrackingOnly_trackingLowPU = vertexAnalysisSequenceTrackingOnly.copy()
78 _vertexAnalysisSequenceTrackingOnly_trackingLowPU += (
79  trackingParticlePixelTrackAsssociation
80  + selectedPixelVertices
81  + pixelVertexAnalysisTrackingOnly
82 )
83 trackingLowPU.toReplaceWith(vertexAnalysisSequenceTrackingOnly, _vertexAnalysisSequenceTrackingOnly_trackingLowPU)
84 trackingPhase1PU70.toReplaceWith(vertexAnalysisSequenceTrackingOnly, _vertexAnalysisSequenceTrackingOnly_trackingLowPU)
85 trackingPhase2PU140.toReplaceWith(vertexAnalysisSequenceTrackingOnly, _vertexAnalysisSequenceTrackingOnly_trackingLowPU)