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  superClusterMerger,
70  reducedEgamma,
71  slimmedHcalRecHits,
72  bunchSpacingProducer,
73  oniaPhotonCandidates
74 )
75 
76 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
77 pp_on_AA.toReplaceWith(slimmingTask, slimmingTask.copyAndExclude([slimmedOOTPhotons]))
78 pp_on_AA.toReplaceWith(slimmingTask, slimmingTask.copyAndExclude([slimmedJPTJets]))
79 
80 (pp_on_AA).toReplaceWith(slimmingTask,
81  slimmingTask.copyAndExclude([slimmedLowPtElectronsTask]))
82 
83 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
84 from Configuration.Eras.Era_Run2_2016_HIPM_cff import Run2_2016_HIPM
85 (pp_on_AA | run2_miniAOD_UL | Run2_2016_HIPM).toReplaceWith(slimmingTask,
86  slimmingTask.copyAndExclude([slimmedDisplacedMuons, slimmedDisplacedMuonTrackExtras]))
87 
88 from PhysicsTools.PatAlgos.slimming.hiPixelTracks_cfi import hiPixelTracks
89 from RecoHI.HiEvtPlaneAlgos.HiEvtPlane_cfi import hiEvtPlane
90 from RecoHI.HiEvtPlaneAlgos.hiEvtPlaneFlat_cfi import hiEvtPlaneFlat
91 pp_on_AA.toReplaceWith(slimmingTask, cms.Task(slimmingTask.copy(), hiPixelTracks, hiEvtPlane, hiEvtPlaneFlat))
92 
93 from PhysicsTools.PatAlgos.packedCandidateMuonID_cfi import packedCandidateMuonID
94 from PhysicsTools.PatAlgos.packedPFCandidateTrackChi2_cfi import packedPFCandidateTrackChi2
95 from RecoHI.HiCentralityAlgos.CentralityBin_cfi import centralityBin
96 from RecoHI.HiCentralityAlgos.hiHFfilters_cfi import hiHFfilters
97 lostTrackChi2 = packedPFCandidateTrackChi2.clone(candidates = "lostTracks", doLostTracks = True)
98 
99 pp_on_AA.toReplaceWith(
100  slimmingTask,
101  cms.Task(slimmingTask.copy(), packedCandidateMuonID, packedPFCandidateTrackChi2, lostTrackChi2, centralityBin, hiHFfilters))
102 from Configuration.ProcessModifiers.run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X
103 run2_miniAOD_pp_on_AA_103X.toReplaceWith(slimmingTask,cms.Task(primaryVertexAssociationCleaned,slimmingTask.copy()))
104 run2_miniAOD_pp_on_AA_103X.toReplaceWith(slimmingTask,cms.Task(primaryVertexWithBSAssociationCleaned,slimmingTask.copy()))
105 run2_miniAOD_pp_on_AA_103X.toReplaceWith(slimmingTask,cms.Task(pfEGammaToCandidateRemapperCleaned,slimmingTask.copy()))
106 
107 from RecoHI.HiTracking.miniAODVertexRecovery_cff import offlinePrimaryVerticesRecovery, offlineSlimmedPrimaryVerticesRecovery
108 run2_miniAOD_pp_on_AA_103X.toReplaceWith(
109  slimmingTask,
110  cms.Task(slimmingTask.copy(), offlinePrimaryVerticesRecovery, offlineSlimmedPrimaryVerticesRecovery))
111 
112 from Configuration.Eras.Modifier_fastSim_cff import fastSim
113 fastSim.toReplaceWith(slimmingTask, slimmingTask.copyAndExclude([slimmedDisplacedMuons, slimmedDisplacedMuonTrackExtras]))
114 
115 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
116 _phase2_timing_slimmingTask = cms.Task(slimmingTask.copy(),
117  offlineSlimmedPrimaryVertices4D)
118 phase2_timing.toReplaceWith(slimmingTask,_phase2_timing_slimmingTask)
119 
120 from PhysicsTools.PatAlgos.slimming.patPhotonDRNCorrector_cfi import patPhotonsDRN
121 from Configuration.ProcessModifiers.photonDRN_cff import _photonDRN
122 _photonDRN.toReplaceWith(slimmingTask, cms.Task(slimmingTask.copy(), patPhotonsDRN))
123 
124 from Configuration.Eras.Modifier_run3_upc_cff import run3_upc
125 from PhysicsTools.PatAlgos.modules import DeDxEstimatorRekeyer
126 dedxEstimator = DeDxEstimatorRekeyer()
127 from Configuration.Eras.Modifier_run3_egamma_2023_cff import run3_egamma_2023
128 run3_upc.toModify(dedxEstimator, dedxEstimators = ["dedxHarmonic2", "dedxPixelHarmonic2", "dedxPixelLikelihood", "dedxStripLikelihood", "dedxAllLikelihood"])
129 run3_upc.toReplaceWith(slimmingTask, cms.Task(slimmingTask.copy(), hiPixelTracks, packedPFCandidateTrackChi2, lostTrackChi2, dedxEstimator))
130 
131 from Configuration.Eras.Modifier_ppRef_2024_cff import ppRef_2024
132 ppRef_2024.toReplaceWith(slimmingTask, cms.Task(slimmingTask.copy(), packedPFCandidateTrackChi2, lostTrackChi2))