CMS 3D CMS Logo

slimming_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
32 from RecoLuminosity.LumiProducer.bunchSpacingProducer_cfi import bunchSpacingProducer
33 from HeavyFlavorAnalysis.Onia2MuMu.OniaPhotonConversionProducer_cfi import PhotonCandidates as oniaPhotonCandidates
35 
36 slimmingTask = cms.Task(
37  packedPFCandidatesTask,
38  lostTracks,
39  isolatedTracks,
40  offlineSlimmedPrimaryVertices,
41  offlineSlimmedPrimaryVerticesWithBS,
42  primaryVertexAssociation,
43  primaryVertexWithBSAssociation,
44  genParticlesTask,
45  packedCandidateToGenAssociationTask,
46  selectedPatTrigger,
47  slimmedPatTrigger,
48  slimmedCaloJets,
49  slimmedJets,
50  slimmedJetsAK8,
51  slimmedGenJets,
52  slimmedGenJetsAK8,
53  slimmedElectrons,
54  slimmedLowPtElectronsTask,
55  slimmedMuonTrackExtras,
56  slimmedMuons,
57  slimmedDisplacedMuonTrackExtras,
58  slimmedDisplacedMuons,
59  slimmedPhotons,
60  slimmedOOTPhotons,
61  slimmedTaus,
62  slimmedSecondaryVertices,
63  slimmedKshortVertices,
64  slimmedLambdaVertices,
65  slimmedMETs,
66  metFilterPathsTask,
67  reducedEgamma,
68  slimmedHcalRecHits,
69  bunchSpacingProducer,
70  oniaPhotonCandidates
71 )
72 
73 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
74 pp_on_AA.toReplaceWith(slimmingTask, slimmingTask.copyAndExclude([slimmedOOTPhotons]))
75 
76 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff import run2_miniAOD_94XFall17
77 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
78 _mAOD = (run2_miniAOD_94XFall17 | run2_miniAOD_80XLegacy)
79 (pp_on_AA | _mAOD).toReplaceWith(slimmingTask,
80  slimmingTask.copyAndExclude([slimmedLowPtElectronsTask]))
81 
82 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
83 from Configuration.Eras.Era_Run2_2016_HIPM_cff import Run2_2016_HIPM
84 (pp_on_AA | _mAOD | run2_miniAOD_UL | Run2_2016_HIPM).toReplaceWith(slimmingTask,
85  slimmingTask.copyAndExclude([slimmedDisplacedMuons, slimmedDisplacedMuonTrackExtras]))
86 
87 from PhysicsTools.PatAlgos.slimming.hiPixelTracks_cfi import hiPixelTracks
88 from RecoHI.HiEvtPlaneAlgos.HiEvtPlane_cfi import hiEvtPlane
89 from RecoHI.HiEvtPlaneAlgos.hiEvtPlaneFlat_cfi import hiEvtPlaneFlat
90 pp_on_AA.toReplaceWith(slimmingTask, cms.Task(slimmingTask.copy(), hiPixelTracks, hiEvtPlane, hiEvtPlaneFlat))
91 
92 from PhysicsTools.PatAlgos.packedCandidateMuonID_cfi import packedCandidateMuonID
93 from PhysicsTools.PatAlgos.packedPFCandidateTrackChi2_cfi import packedPFCandidateTrackChi2
94 from RecoHI.HiCentralityAlgos.CentralityBin_cfi import centralityBin
95 from RecoHI.HiCentralityAlgos.hiHFfilters_cfi import hiHFfilters
96 lostTrackChi2 = packedPFCandidateTrackChi2.clone(candidates = "lostTracks", doLostTracks = True)
97 
98 pp_on_AA.toReplaceWith(
99  slimmingTask,
100  cms.Task(slimmingTask.copy(), packedCandidateMuonID, packedPFCandidateTrackChi2, lostTrackChi2, centralityBin, hiHFfilters))
101 from Configuration.ProcessModifiers.run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X
102 run2_miniAOD_pp_on_AA_103X.toReplaceWith(slimmingTask,cms.Task(primaryVertexAssociationCleaned,slimmingTask.copy()))
103 run2_miniAOD_pp_on_AA_103X.toReplaceWith(slimmingTask,cms.Task(primaryVertexWithBSAssociationCleaned,slimmingTask.copy()))
104 run2_miniAOD_pp_on_AA_103X.toReplaceWith(slimmingTask,cms.Task(pfEGammaToCandidateRemapperCleaned,slimmingTask.copy()))
105 
106 from RecoHI.HiTracking.miniAODVertexRecovery_cff import offlinePrimaryVerticesRecovery, offlineSlimmedPrimaryVerticesRecovery
107 pp_on_AA.toReplaceWith(
108  slimmingTask,
109  cms.Task(slimmingTask.copy(), offlinePrimaryVerticesRecovery, offlineSlimmedPrimaryVerticesRecovery))
110 
111 from Configuration.Eras.Modifier_fastSim_cff import fastSim
112 fastSim.toReplaceWith(slimmingTask, slimmingTask.copyAndExclude([slimmedDisplacedMuons, slimmedDisplacedMuonTrackExtras]))
113 
114 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
115 _phase2_timing_slimmingTask = cms.Task(slimmingTask.copy(),
116  offlineSlimmedPrimaryVertices4D)
117 phase2_timing.toReplaceWith(slimmingTask,_phase2_timing_slimmingTask)
118 
119 from PhysicsTools.PatAlgos.slimming.patPhotonDRNCorrector_cfi import patPhotonsDRN
120 from Configuration.ProcessModifiers.photonDRN_cff import _photonDRN
121 _photonDRN.toReplaceWith(slimmingTask, cms.Task(slimmingTask.copy(), patPhotonsDRN))