Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-27 18:27:37

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 selectedOfflinePrimaryVertices = cms.EDFilter("VertexSelector",
0004                                                src = cms.InputTag('offlinePrimaryVertices'),
0005                                                cut = cms.string("isValid & ndof > 4 & tracksSize > 0 & abs(z) <= 24 & abs(position.Rho) <= 2."),
0006                                                filter = cms.bool(False)
0007 )
0008 
0009 selectedOfflinePrimaryVerticesWithBS = selectedOfflinePrimaryVertices.clone(
0010   src = 'offlinePrimaryVerticesWithBS'
0011 )
0012 selectedPixelVertices = selectedOfflinePrimaryVertices.clone(
0013   src = 'pixelVertices'
0014 )
0015 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0016 vertexAnalysis = DQMEDAnalyzer('PrimaryVertexAnalyzer4PUSlimmed',
0017                                 use_only_charged_tracks = cms.untracked.bool(True),
0018                                 do_generic_sim_plots = cms.untracked.bool(True),
0019                                 verbose = cms.untracked.bool(False),
0020                                 root_folder = cms.untracked.string("Vertexing/PrimaryVertexV"),
0021                                 trackingParticleCollection = cms.untracked.InputTag("mix", "MergedTrackTruth"),
0022                                 trackingVertexCollection = cms.untracked.InputTag("mix", "MergedTrackTruth"),
0023                                 trackAssociatorMap = cms.untracked.InputTag("trackingParticleRecoTrackAsssociation"),
0024                                 vertexAssociator = cms.untracked.InputTag("VertexAssociatorByPositionAndTracks"),
0025                                 vertexRecoCollections = cms.VInputTag("offlinePrimaryVertices",
0026                                                                       "offlinePrimaryVerticesWithBS",
0027                                                                       "selectedOfflinePrimaryVertices",
0028                                                                       "selectedOfflinePrimaryVerticesWithBS"
0029                                                                       ),
0030 )
0031 from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
0032 premix_stage2.toModify(vertexAnalysis,
0033     trackingParticleCollection = "mixData:MergedTrackTruth",
0034     trackingVertexCollection = "mixData:MergedTrackTruth",
0035 )
0036 
0037 vertexAnalysisTrackingOnly = vertexAnalysis.clone(
0038     vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value() + [
0039         "firstStepPrimaryVerticesPreSplitting",
0040         "firstStepPrimaryVertices"
0041     ]
0042 )
0043 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
0044 trackingLowPU.toModify(vertexAnalysisTrackingOnly, vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value())
0045 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
0046 trackingPhase2PU140.toModify(vertexAnalysisTrackingOnly,
0047     vertexRecoCollections = vertexAnalysis.vertexRecoCollections.value() + [
0048         "firstStepPrimaryVertices"
0049     ]
0050 )
0051 
0052 pixelVertexAnalysisTrackingOnly = vertexAnalysis.clone(
0053     do_generic_sim_plots = False,
0054     trackAssociatorMap = "trackingParticlePixelTrackAsssociation",
0055     vertexAssociator = "PixelVertexAssociatorByPositionAndTracks",
0056     vertexRecoCollections = [
0057         "pixelVertices",
0058         "selectedPixelVertices"
0059     ]
0060 )
0061 pixelVertexAnalysisPixelTrackingOnly = pixelVertexAnalysisTrackingOnly.clone(
0062     do_generic_sim_plots = True,
0063 )
0064 
0065 ##########
0066 
0067 vertexAnalysisSelection = cms.Sequence(
0068     cms.ignore(selectedOfflinePrimaryVertices)
0069     + cms.ignore(selectedOfflinePrimaryVerticesWithBS)
0070 )
0071 
0072 ##########
0073 
0074 vertexAnalysisSequence = cms.Sequence(
0075     vertexAnalysisSelection
0076     + vertexAnalysis
0077 )
0078 
0079 vertexAnalysisSequenceTrackingOnly = cms.Sequence(
0080     vertexAnalysisSelection
0081     + vertexAnalysisTrackingOnly
0082 )
0083 
0084 _vertexAnalysisSequenceTrackingOnly_trackingLowPU = vertexAnalysisSequenceTrackingOnly.copy()
0085 _vertexAnalysisSequenceTrackingOnly_trackingLowPU += (
0086     selectedPixelVertices
0087     + pixelVertexAnalysisTrackingOnly
0088 )
0089 trackingLowPU.toReplaceWith(vertexAnalysisSequenceTrackingOnly, _vertexAnalysisSequenceTrackingOnly_trackingLowPU)
0090 
0091 vertexAnalysisSequencePixelTrackingOnly = cms.Sequence(
0092     selectedPixelVertices
0093     + pixelVertexAnalysisPixelTrackingOnly
0094 )
0095 
0096 
0097 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
0098 _vertexRecoCollectionsTiming = cms.VInputTag("offlinePrimaryVertices",
0099                                              "offlinePrimaryVerticesWithBS",
0100                                              "selectedOfflinePrimaryVertices",
0101                                              "selectedOfflinePrimaryVerticesWithBS",
0102                                              "offlinePrimaryVertices4D",
0103                                              "selectedOfflinePrimaryVertices4D",
0104                                              )
0105 selectedOfflinePrimaryVertices4D = selectedOfflinePrimaryVertices.clone(src = cms.InputTag("offlinePrimaryVertices4D"))
0106 
0107 _vertexAnalysisSelectionTiming = vertexAnalysisSelection.copy()
0108 _vertexAnalysisSelectionTiming += selectedOfflinePrimaryVertices4D
0109 
0110 phase2_timing_layer.toModify( vertexAnalysis, 
0111                               vertexRecoCollections = _vertexRecoCollectionsTiming
0112                               )
0113 phase2_timing_layer.toReplaceWith( vertexAnalysisSelection,
0114                                    _vertexAnalysisSelectionTiming )