CMS 3D CMS Logo

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