CMS 3D CMS Logo

Functions
miniAOD_tools Namespace Reference

Functions

def miniAOD_customizeAllData (process)
 
def miniAOD_customizeAllMC (process)
 
def miniAOD_customizeAllMCFastSim (process)
 
def miniAOD_customizeCommon (process)
 
def miniAOD_customizeData (process)
 
def miniAOD_customizeMC (process)
 
def miniAOD_customizeOutput (out)
 

Function Documentation

◆ miniAOD_customizeAllData()

def miniAOD_tools.miniAOD_customizeAllData (   process)

Definition at line 698 of file miniAOD_tools.py.

References miniAOD_customizeCommon(), and miniAOD_customizeData().

698 def miniAOD_customizeAllData(process):
699  miniAOD_customizeCommon(process)
700  miniAOD_customizeData(process)
701  return process
702 
def miniAOD_customizeAllData(process)
def miniAOD_customizeData(process)
def miniAOD_customizeCommon(process)

◆ miniAOD_customizeAllMC()

def miniAOD_tools.miniAOD_customizeAllMC (   process)

Definition at line 703 of file miniAOD_tools.py.

References miniAOD_customizeCommon(), and miniAOD_customizeMC().

703 def miniAOD_customizeAllMC(process):
704  miniAOD_customizeCommon(process)
705  miniAOD_customizeMC(process)
706  return process
707 
def miniAOD_customizeCommon(process)
def miniAOD_customizeAllMC(process)
def miniAOD_customizeMC(process)

◆ miniAOD_customizeAllMCFastSim()

def miniAOD_tools.miniAOD_customizeAllMCFastSim (   process)

Definition at line 708 of file miniAOD_tools.py.

References miniAOD_customizeCommon(), isolatedTracks_cfi.miniAOD_customizeIsolatedTracksFastSim(), miniAOD_customizeMC(), and metFilterPaths_cff.miniAOD_customizeMETFiltersFastSim().

708 def miniAOD_customizeAllMCFastSim(process):
709  miniAOD_customizeCommon(process)
710  miniAOD_customizeMC(process)
711  from PhysicsTools.PatAlgos.slimming.metFilterPaths_cff import miniAOD_customizeMETFiltersFastSim
712  process = miniAOD_customizeMETFiltersFastSim(process)
713  from PhysicsTools.PatAlgos.slimming.isolatedTracks_cfi import miniAOD_customizeIsolatedTracksFastSim
714  process = miniAOD_customizeIsolatedTracksFastSim(process)
715  process.patMuons.addTriggerMatching = False
716  # Disable pixelClusterTagInfos in FastSim (no siPixelCluster available)
717  from Configuration.Eras.Modifier_fastSim_cff import fastSim
718  fastSim.toModify(process.patJets, addTagInfos = cms.bool(False) )
719  fastSim.toModify(process.slimmedJetsNoDeepFlavour, dropTagInfos = cms.string('1') )
720  fastSim.toModify(process.updatedPatJetsSlimmedDeepFlavour, addTagInfos = cms.bool(False) )
721  fastSim.toModify(process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour, addTagInfos = cms.bool(False) )
722 
723  return process
724 
def miniAOD_customizeCommon(process)
def miniAOD_customizeMETFiltersFastSim(process)
def miniAOD_customizeAllMCFastSim(process)
def miniAOD_customizeIsolatedTracksFastSim(process)
def miniAOD_customizeMC(process)

◆ miniAOD_customizeCommon()

def miniAOD_tools.miniAOD_customizeCommon (   process)

Definition at line 11 of file miniAOD_tools.py.

References boostedHPSPFTaus_cfi.addBoostedTaus(), helpers.addToProcessAndTask(), applyDeepBtagging_cff.applyDeepBtagging(), applySubstructure_cff.applySubstructure(), clone(), helpers.getPatAlgosToolsTask(), egmIsolationsPUPPI_cfi.makeInputForPUPPIIsolationEgm(), muonIsolationsPUPPI_cfi.makeInputForPUPPIIsolationMuon(), egammaObjectModifications_tools.makeVIDBitsModifier(), runMETCorrectionsAndUncertainties.runMetCorAndUncForMiniAODProduction(), vid_id_tools.setupAllVIDIdsInModule(), str, trigTools.switchOnTriggerStandAlone, vid_id_tools.switchOnVIDElectronIdProducer(), and vid_id_tools.switchOnVIDPhotonIdProducer().

Referenced by miniAOD_customizeAllData(), miniAOD_customizeAllMC(), and miniAOD_customizeAllMCFastSim().

11 def miniAOD_customizeCommon(process):
12  process.patMuons.isoDeposits = cms.PSet()
13  process.patElectrons.isoDeposits = cms.PSet()
14  process.patTaus.isoDeposits = cms.PSet()
15  process.patPhotons.isoDeposits = cms.PSet()
16  #
17  process.patMuons.embedTrack = True # used for IDs
18  process.patMuons.embedCombinedMuon = True # used for IDs
19  process.patMuons.embedMuonBestTrack = True # used for IDs
20  process.patMuons.embedStandAloneMuon = True # maybe?
21  process.patMuons.embedPickyMuon = False # no, use best track
22  process.patMuons.embedTpfmsMuon = False # no, use best track
23  process.patMuons.embedDytMuon = False # no, use best track
24  process.patMuons.addPuppiIsolation = cms.bool(True)
25  process.patMuons.puppiIsolationChargedHadrons = cms.InputTag("muonPUPPIIsolation","h+-DR040-ThresholdVeto000-ConeVeto000")
26  process.patMuons.puppiIsolationNeutralHadrons = cms.InputTag("muonPUPPIIsolation","h0-DR040-ThresholdVeto000-ConeVeto001")
27  process.patMuons.puppiIsolationPhotons = cms.InputTag("muonPUPPIIsolation","gamma-DR040-ThresholdVeto000-ConeVeto001")
28  process.patMuons.puppiNoLeptonsIsolationChargedHadrons = cms.InputTag("muonPUPPINoLeptonsIsolation","h+-DR040-ThresholdVeto000-ConeVeto000")
29  process.patMuons.puppiNoLeptonsIsolationNeutralHadrons = cms.InputTag("muonPUPPINoLeptonsIsolation","h0-DR040-ThresholdVeto000-ConeVeto001")
30  process.patMuons.puppiNoLeptonsIsolationPhotons = cms.InputTag("muonPUPPINoLeptonsIsolation","gamma-DR040-ThresholdVeto000-ConeVeto001")
31 
32  process.patMuons.computeMiniIso = True
33  process.patMuons.computeMuonIDMVA = True
34  process.patMuons.computeSoftMuonMVA = True
35 
36  process.patMuons.addTriggerMatching = True
37  from Configuration.Eras.Modifier_run2_muon_2016_cff import run2_muon_2016
38  from Configuration.Eras.Modifier_run2_muon_2017_cff import run2_muon_2017
39  from Configuration.Eras.Modifier_run2_muon_2018_cff import run2_muon_2018
40  from Configuration.Eras.Modifier_run3_muon_cff import run3_muon
41  run2_muon_2016.toModify( process.patMuons, effectiveAreaVec = [0.0735,0.0619,0.0465,0.0433,0.0577])
42  run2_muon_2017.toModify( process.patMuons, effectiveAreaVec = [0.0566, 0.0562, 0.0363, 0.0119, 0.0064])
43  run2_muon_2018.toModify( process.patMuons, effectiveAreaVec = [0.0566, 0.0562, 0.0363, 0.0119, 0.0064])
44  run3_muon.toModify( process.patMuons, effectiveAreaVec = [0.0566, 0.0562, 0.0363, 0.0119, 0.0064])
45 
46  process.patMuons.computePuppiCombinedIso = True
47  #
48  # disable embedding of electron and photon associated objects already stored by the ReducedEGProducer
49  process.patElectrons.embedGsfElectronCore = False
50  process.patElectrons.embedSuperCluster = False
51  process.patElectrons.embedPflowSuperCluster = False
52  process.patElectrons.embedSeedCluster = False
53  process.patElectrons.embedBasicClusters = False
54  process.patElectrons.embedPreshowerClusters = False
55  process.patElectrons.embedPflowBasicClusters = False
56  process.patElectrons.embedPflowPreshowerClusters = False
57  process.patElectrons.embedRecHits = False
58  process.patElectrons.electronSource = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
59  process.patElectrons.usePfCandidateMultiMap = True
60  process.patElectrons.pfCandidateMultiMap = cms.InputTag("reducedEgamma","reducedGsfElectronPfCandMap")
61  process.patElectrons.electronIDSources = cms.PSet()
62 
63  #add puppi isolation in miniAOD
64  process.patElectrons.addPuppiIsolation = cms.bool(True)
65  process.patElectrons.puppiIsolationChargedHadrons = cms.InputTag("egmElectronPUPPIIsolation","h+-DR030-BarVeto000-EndVeto001")
66  process.patElectrons.puppiIsolationNeutralHadrons = cms.InputTag("egmElectronPUPPIIsolation","h0-DR030-BarVeto000-EndVeto000")
67  process.patElectrons.puppiIsolationPhotons = cms.InputTag("egmElectronPUPPIIsolation","gamma-DR030-BarVeto000-EndVeto008")
68  process.patElectrons.puppiNoLeptonsIsolationChargedHadrons = cms.InputTag("egmElectronPUPPINoLeptonsIsolation","h+-DR030-BarVeto000-EndVeto001")
69  process.patElectrons.puppiNoLeptonsIsolationNeutralHadrons = cms.InputTag("egmElectronPUPPINoLeptonsIsolation","h0-DR030-BarVeto000-EndVeto000")
70  process.patElectrons.puppiNoLeptonsIsolationPhotons = cms.InputTag("egmElectronPUPPINoLeptonsIsolation","gamma-DR030-BarVeto000-EndVeto008")
71 
72  process.patElectrons.computeMiniIso = cms.bool(True)
73 
74  process.elPFIsoDepositChargedPAT.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
75  process.elPFIsoDepositChargedAllPAT.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
76  process.elPFIsoDepositNeutralPAT.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
77  process.elPFIsoDepositGammaPAT.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
78  process.elPFIsoDepositPUPAT.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
79  #
80  process.patPhotons.embedSuperCluster = False
81  process.patPhotons.embedSeedCluster = False
82  process.patPhotons.embedBasicClusters = False
83  process.patPhotons.embedPreshowerClusters = False
84  process.patPhotons.embedRecHits = False
85 
86  #add puppi isolation in miniAOD
87  process.patPhotons.addPuppiIsolation = cms.bool(True)
88  process.patPhotons.puppiIsolationChargedHadrons = cms.InputTag("egmPhotonPUPPIIsolation","h+-DR030-")
89  process.patPhotons.puppiIsolationNeutralHadrons = cms.InputTag("egmPhotonPUPPIIsolation","h0-DR030-")
90  process.patPhotons.puppiIsolationPhotons = cms.InputTag("egmPhotonPUPPIIsolation","gamma-DR030-")
91 
92  process.patPhotons.photonSource = cms.InputTag("reducedEgamma","reducedGedPhotons")
93  process.patPhotons.electronSource = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
94 
95  process.phPFIsoDepositChargedPAT.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
96  process.phPFIsoDepositChargedAllPAT.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
97  process.phPFIsoDepositNeutralPAT.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
98  process.phPFIsoDepositGammaPAT.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
99  process.phPFIsoDepositPUPAT.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
100  #
101  process.patOOTPhotons.photonSource = cms.InputTag("reducedEgamma","reducedOOTPhotons")
102  process.patOOTPhotons.electronSource = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
103  #
104  process.selectedPatJets.cut = cms.string("pt > 15")
105  process.selectedPatMuons.cut = cms.string("pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose')))")
106 
107  from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon
108  phase2_muon.toModify(process.selectedPatMuons, cut = "pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose') || muonID('ME0MuonArbitrated') || muonID('GEMMuonArbitrated')) )")
109  from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
110  pp_on_AA.toModify(process.selectedPatMuons, cut = "pt > 5 || isPFMuon || (pt > 1.2 && (isGlobalMuon || isStandAloneMuon) )")
111  from Configuration.Eras.Modifier_run3_upc_cff import run3_upc
112  run3_upc.toModify(process.selectedPatMuons, cut = "")
113  from Configuration.Eras.Modifier_ppRef_2024_cff import ppRef_2024
114  ppRef_2024.toModify(process.selectedPatMuons, cut = "pt > 5 || isPFMuon || isTrackerMuon || (pt > 1.2 && (isGlobalMuon || isStandAloneMuon))")
115 
116  process.selectedPatElectrons.cut = cms.string("")
117  process.selectedPatTaus.cut = cms.string("pt > 18. && tauID('decayModeFindingNewDMs')> 0.5")
118  process.selectedPatPhotons.cut = cms.string("")
119 
120  _dummyPatJets = process.selectedPatJets.clone(cut = "pt < 0")
121  task = getPatAlgosToolsTask(process)
122 
123  def _applySubstructure(process):
124  from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
125 
126  from PhysicsTools.PatAlgos.slimming.applySubstructure_cff import applySubstructure
127  applySubstructure( process )
128  (~pp_on_AA).toModify(process, _applySubstructure)
129 
130  pp_on_AA.toModify(process, func = lambda p: addToProcessAndTask('slimmedJets', p.selectedPatJets.clone(), p, task))
131  pp_on_AA.toModify(process, func = lambda p: addToProcessAndTask('slimmedJetsAK8', _dummyPatJets.clone(), p, task))
132 
133  #
134  from PhysicsTools.PatAlgos.tools.trigTools import switchOnTriggerStandAlone
135  switchOnTriggerStandAlone( process, outputModule = '' )
136  process.patTrigger.packTriggerPathNames = cms.bool(True)
137  #
138  # apply type I + other PFMEt corrections to pat::MET object
139  # and estimate systematic uncertainties on MET
140 
141  from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties import runMetCorAndUncForMiniAODProduction
142  runMetCorAndUncForMiniAODProduction(process, metType="PF",
143  jetCollUnskimmed="patJets")
144 
145  #caloMET computation
146  from PhysicsTools.PatAlgos.tools.metTools import addMETCollection
147  addMETCollection(process,
148  labelName = "patCaloMet",
149  metSource = "caloMetM"
150  )
151 
152  #noHF pfMET =========
153 
154  process.noHFCands = cms.EDFilter("GenericPFCandidateSelector",
155  src=cms.InputTag("particleFlow"),
156  cut=cms.string("abs(pdgId)!=1 && abs(pdgId)!=2 && abs(eta)<3.0")
157  )
158  task.add(process.noHFCands)
159 
161  pfCandColl=cms.InputTag("noHFCands"),
162  recoMetFromPFCs=True, #needed for HF removal
163  jetSelection="pt>15 && abs(eta)<3.",
164  postfix="NoHF"
165  )
166 
167  process.load('PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
168  task.add(process.slimmedMETs)
169  (~pp_on_AA).toModify(process.slimmedMETs, addDeepMETs = True)
170 
171  # ================== NoHF pfMET
172 
173  # ================== CHSMET
174  process.load("CommonTools.ParticleFlow.pfCHS_cff")
175  task.add(process.pfCHS)
176 
177  from RecoMET.METProducers.pfMet_cfi import pfMet
178  process.pfMetCHS = pfMet.clone(src = 'pfCHS')
179  task.add(process.pfMetCHS)
180 
181  addMETCollection(process,
182  labelName = "patCHSMet",
183  metSource = "pfMetCHS"
184  )
185 
186  process.patCHSMet.computeMETSignificance = cms.bool(False)
187 
188  # ================== CHSMET
189 
190  # ================== TrkMET
191  process.TrkCands = chargedPackedCandsForTkMet.clone()
192  task.add(process.TrkCands)
193 
194  process.pfMetTrk = pfMet.clone(src = 'TrkCands')
195  task.add(process.pfMetTrk)
196 
197  addMETCollection(process,
198  labelName = "patTrkMet",
199  metSource = "pfMetTrk"
200  )
201 
202  process.patTrkMet.computeMETSignificance = cms.bool(False)
203 
204  # ================== TrkMET
205 
206  #HF jet shower shape
207  process.load('RecoJets.JetProducers.hfJetShowerShape_cfi')
208  task.add(process.hfJetShowerShape)
209 
210  process.patJets.userData.userFloats.src += [ 'hfJetShowerShape:sigmaEtaEta', 'hfJetShowerShape:sigmaPhiPhi']
211  process.patJets.userData.userInts.src += [ 'hfJetShowerShape:centralEtaStripSize', 'hfJetShowerShape:adjacentEtaStripsSize']
212 
213 
214  def _add_deepFlavour(process):
215  process.load('RecoBTag.Combined.deepFlavour_cff')
216  task.add(process.pfDeepCSVDiscriminatorsJetTags)
217  process.patJets.discriminatorSources.extend([
218  'pfDeepCSVDiscriminatorsJetTags:BvsAll',
219  'pfDeepCSVDiscriminatorsJetTags:CvsB',
220  'pfDeepCSVDiscriminatorsJetTags:CvsL',
221  ])
222 
223 
224  process.caloJetMap = cms.EDProducer("RecoJetDeltaRValueMapProducer",
225  src = process.patJets.jetSource,
226  matched = cms.InputTag("ak4CaloJets"),
227  distMax = cms.double(0.4),
228  values = cms.vstring('pt','emEnergyFraction'),
229  valueLabels = cms.vstring('pt','emEnergyFraction'),
230  lazyParser = cms.bool(True) )
231  task.add(process.caloJetMap)
232  process.patJets.userData.userFloats.src += [ 'caloJetMap:pt', 'caloJetMap:emEnergyFraction' ]
233 
234  pp_on_AA.toModify(process.patJets.userData.userInts, src = [] )
235  pp_on_AA.toModify(process.patJets.userData.userFloats, src = [] )
236 
237  #Muon object modifications
238  from PhysicsTools.PatAlgos.slimming.muonIsolationsPUPPI_cfi import makeInputForPUPPIIsolationMuon
240 
241  #EGM object modifications
242  from PhysicsTools.PatAlgos.slimming.egmIsolationsPUPPI_cfi import makeInputForPUPPIIsolationEgm
244  from RecoEgamma.EgammaTools.egammaObjectModificationsInMiniAOD_cff import egamma_modifications
245  process.slimmedElectrons.modifierConfig.modifications = egamma_modifications
246  process.slimmedPhotons.modifierConfig.modifications = egamma_modifications
247 
248  #VID Electron IDs
249  process.patElectrons.addElectronID = cms.bool(True)
250  electron_ids = ['RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV70_cff',
251  'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV71_cff',
252  'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Fall17_94X_V1_cff',
253  'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Fall17_94X_V2_cff',
254  'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Winter22_122X_V1_cff',
255  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V1_cff',
256  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V1_cff',
257  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V2_cff',
258  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V2_cff',
259  'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Summer16_80X_V1_cff',
260  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_GeneralPurpose_V1_cff',
261  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_HZZ_V1_cff',
262  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer16UL_ID_ISO_cff',
263  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer17UL_ID_ISO_cff',
264  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer18UL_ID_ISO_cff',
265  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_RunIIIWinter22_noIso_V1_cff',
266  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_RunIIIWinter22_iso_V1_cff',
267  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Winter22_HZZ_V1_cff'
268  ]
269  switchOnVIDElectronIdProducer(process,DataFormat.MiniAOD, task)
270  process.egmGsfElectronIDs.physicsObjectSrc = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
271  process.electronMVAValueMapProducer.src = cms.InputTag('reducedEgamma','reducedGedGsfElectrons')
272 
273  # To use older DataFormats, the electronMVAValueMapProducer MUST take a updated electron collection
274  # such that the conversion variables are filled correctly.
275 
276  process.load("RecoEgamma.EgammaTools.gedGsfElectronsTo106X_cff")
277  from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018
278  pp_on_AA_2018.toModify(task, func=lambda t: t.add(process.gedGsfElectronsFrom94XTo106XTask))
279  pp_on_AA_2018.toModify(process.electronMVAValueMapProducer,
280  keysForValueMaps = cms.InputTag('reducedEgamma','reducedGedGsfElectrons'),
281  src = "gedGsfElectronsFrom94XTo106X")
282 
283  for idmod in electron_ids:
284  setupAllVIDIdsInModule(process,idmod,setupVIDElectronSelection,None,False,task)
285 
286  #VID Photon IDs
287  process.patPhotons.addPhotonID = cms.bool(True)
288  photon_ids = ['RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Fall17_94X_V1_TrueVtx_cff',
289  'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Fall17_94X_V2_cff',
290  'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Fall17_94X_V1p1_cff',
291  'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Fall17_94X_V2_cff',
292  'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Spring16_V2p2_cff',
293  'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring16_nonTrig_V1_cff',
294  'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Winter22_122X_V1_cff',
295  'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_RunIIIWinter22_122X_V1_cff']
296 
297  switchOnVIDPhotonIdProducer(process,DataFormat.AOD, task)
298  process.egmPhotonIDs.physicsObjectSrc = cms.InputTag("reducedEgamma","reducedGedPhotons")
299  process.photonMVAValueMapProducer.src = cms.InputTag('reducedEgamma','reducedGedPhotons')
300  for idmod in photon_ids:
301  setupAllVIDIdsInModule(process,idmod,setupVIDPhotonSelection,None,False,task)
302 
303  #add the cut base IDs bitmaps of which cuts passed
304  from RecoEgamma.EgammaTools.egammaObjectModifications_tools import makeVIDBitsModifier
305  egamma_modifications.append(makeVIDBitsModifier(process,"egmGsfElectronIDs","egmPhotonIDs"))
306 
307  #-- Adding boosted taus
308  from RecoTauTag.Configuration.boostedHPSPFTaus_cfi import addBoostedTaus
309  addBoostedTaus(process)
310  #-- Adding DeepTauID for boosted taus
311  import RecoTauTag.RecoTau.tools.runTauIdMVA as tauIdConfig
312  _updatedBoostedTauName = 'slimmedTausBoostedDeepIDs'
313  _noUpdatedBoostedTauName = 'slimmedTausBoostedNoDeepIDs'
314  boostedTauIdEmbedder = tauIdConfig.TauIDEmbedder(
315  process, debug = False,
316  originalTauName = _noUpdatedBoostedTauName,
317  updatedTauName = _updatedBoostedTauName,
318  postfix = 'BoostedForMini',
319  toKeep = ['boostedDeepTauRunIIv2p0']
320  )
321  boostedTauIdEmbedder.runTauID()
322  addToProcessAndTask(_noUpdatedBoostedTauName, process.slimmedTausBoosted.clone(),process,task)
323  delattr(process, 'slimmedTausBoosted')
324  process.slimmedTausBoosted = getattr(process, _updatedBoostedTauName).clone()
325  process.rerunMvaIsolationTaskBoostedForMini.add(process.slimmedTausBoosted)
326  task.add(process.rerunMvaIsolationTaskBoostedForMini)
327  process.load("RecoTauTag.Configuration.RecoPFTauTag_cff")
328  process.load("RecoTauTag.Configuration.HPSPFTaus_cff")
329  #-- Adding customization for 94X 2017 legacy reMniAOD
330  _makePatTausTaskWithRetrainedMVATauID = process.makePatTausTask.copy()
331  _makePatTausTaskWithRetrainedMVATauID.add(process.hpsPFTauBasicDiscriminatorsTask,
332  process.hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTTask,
333  process.hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTTask,
334  process.hpsPFTauBasicDiscriminatorsdR03Task,
335  process.hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTTask,
336  process.hpsPFTauDiscriminationByMVA6rawElectronRejection,
337  process.hpsPFTauDiscriminationByMVA6ElectronRejection,
338  process.hpsPFTauDiscriminationByMuonRejection3)
339  from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
340  (run2_miniAOD_UL).toReplaceWith(
341  process.makePatTausTask, _makePatTausTaskWithRetrainedMVATauID
342  )
343  #-- Adding DeepTauID
344  _updatedTauName = 'slimmedTausDeepIDs'
345  _noUpdatedTauName = 'slimmedTausNoDeepIDs'
346  tauIdEmbedder = tauIdConfig.TauIDEmbedder(
347  process, debug = False,
348  originalTauName = _noUpdatedTauName,
349  updatedTauName = _updatedTauName,
350  postfix = 'ForMini',
351  toKeep = ['deepTau2018v2p5']
352  )
353  from Configuration.Eras.Modifier_phase2_common_cff import phase2_common #Phase2 Tau MVA
354  _tauIds_phase2 = ['deepTau2026v2p5']
355  phase2_common.toModify(tauIdEmbedder.toKeep, func=lambda t:t.extend(_tauIds_phase2))
356  tauIdEmbedder.runTauID()
357  addToProcessAndTask(_noUpdatedTauName, process.slimmedTaus.clone(),process,task)
358  delattr(process, 'slimmedTaus')
359  process.slimmedTaus = getattr(process, _updatedTauName).clone()
360  process.rerunMvaIsolationTaskForMini.add(process.slimmedTaus)
361  task.add(process.rerunMvaIsolationTaskForMini)
362 
363  #-- Rerun tauID against dead ECal towers to taus for the various re-MiniAOD eras
364  # to enable default behoviour with leading track extrapolation to ECAL
365  _makePatTausTaskWithDeadECalVeto = process.makePatTausTask.copy()
366  _makePatTausTaskWithDeadECalVeto.add(
367  process.hpsPFTauDiscriminationByDeadECALElectronRejection
368  )
369  _run2_miniAOD_ANY = (run2_miniAOD_UL)
370  _run2_miniAOD_ANY.toReplaceWith(
371  process.makePatTausTask, _makePatTausTaskWithDeadECalVeto
372  )
373 
374  #-- Adding customization for 2018 heavy ions
375  _makePatTausTaskWithTauReReco = process.makePatTausTask.copy()
376  _makePatTausTaskWithTauReReco.add(process.PFTauTask)
377  (pp_on_AA).toReplaceWith(
378  process.makePatTausTask, _makePatTausTaskWithTauReReco
379  )
380 
381  # Adding puppi jets
382  process.load('CommonTools.PileupAlgos.Puppi_cff')
383  process.load('RecoJets.JetProducers.ak4PFJets_cfi')
384  from Configuration.Eras.Modifier_pA_2016_cff import pA_2016
385  _rerun_puppijets_task = task.copy()
386  _rerun_puppijets_task.add(process.puppi, process.ak4PFJetsPuppi)
387  (_run2_miniAOD_ANY | pA_2016 | pp_on_AA).toReplaceWith(task, _rerun_puppijets_task)
388 
389  from RecoJets.JetAssociationProducers.j2tParametersVX_cfi import j2tParametersVX
390  process.ak4PFJetsPuppiTracksAssociatorAtVertex = cms.EDProducer("JetTracksAssociatorAtVertex",
391  j2tParametersVX,
392  jets = cms.InputTag("ak4PFJetsPuppi")
393  )
394  task.add(process.ak4PFJetsPuppiTracksAssociatorAtVertex)
395  process.patJetPuppiCharge = cms.EDProducer("JetChargeProducer",
396  src = cms.InputTag("ak4PFJetsPuppiTracksAssociatorAtVertex"),
397  var = cms.string('Pt'),
398  exp = cms.double(1.0)
399  )
400  task.add(process.patJetPuppiCharge)
401 
402 
403  process.load("RecoJets.JetProducers.PileupJetID_cfi")
404  task.add(process.pileUpJetIDPuppiTask)
405 
406  def _add_jetsPuppi(process):
407  from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
408  noDeepFlavourDiscriminators = [x.value() if isinstance(x, cms.InputTag) else x for x in process.patJets.discriminatorSources
409  if (not "DeepFlavour" in str(x) and not "Transformer" in str(x))]
410  addJetCollection(process, postfix = "", labelName = 'Puppi', jetSource = cms.InputTag('ak4PFJetsPuppi'),
411  jetCorrections = ('AK4PFPuppi', ['L2Relative', 'L3Absolute'], ''),
412  pfCandidates = cms.InputTag("particleFlow"),
413  algo= 'AK', rParam = 0.4, btagDiscriminators = noDeepFlavourDiscriminators
414  )
415 
416  process.patJetGenJetMatchPuppi.matched = 'slimmedGenJets'
417 
418  process.patJetsPuppi.jetChargeSource = cms.InputTag("patJetPuppiCharge")
419 
420 
421  process.patJetsPuppi.userData.userFloats.src += [cms.InputTag("pileupJetIdPuppi:fullDiscriminant")]
422  process.patJetsPuppi.userData.userInts.src += [cms.InputTag("pileupJetIdPuppi:fullId")]
423 
424  process.selectedPatJetsPuppi.cut = cms.string("pt > 10")
425 
426  from PhysicsTools.PatAlgos.slimming.applyDeepBtagging_cff import applyDeepBtagging
427  applyDeepBtagging( process )
428 
429  process.slimmedJetsNoDeepFlavour.dropTagInfos = '0'
430  process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour.addTagInfos = True
431  process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour.tagInfoSources = ["pixelClusterTagInfos"]
432  _run2_miniAOD_ANY.toModify(process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour, addTagInfos = False )
433  (~pp_on_AA).toModify(process, _add_jetsPuppi)
434 
435  pp_on_AA.toModify(process, func = lambda p: addToProcessAndTask('slimmedJetsPuppi', _dummyPatJets.clone(), p, task))
436 
437  # Embed pixelClusterTagInfos in slimmedJets
438  process.patJets.addTagInfos = True
439  process.patJets.tagInfoSources = ["pixelClusterTagInfos"]
440 
441  _run2_miniAOD_ANY.toModify(process.patJets, addTagInfos = False )
442 
443  from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018
444  pp_on_AA_2018.toModify(process.patJets, tagInfoSources = cms.VInputTag(["impactParameterTagInfos","secondaryVertexTagInfos"]) )
445 
446 
447  def _add_metPuppi(process):
448  process.load('RecoMET.METProducers.pfMetPuppi_cfi')
449  _rerun_puppimet_task = task.copy()
450  _rerun_puppimet_task.add(process.puppiNoLep, process.pfMetPuppi)
451  (_run2_miniAOD_ANY | pA_2016 | pp_on_AA ).toReplaceWith(task, _rerun_puppimet_task)
452 
453  runMetCorAndUncForMiniAODProduction(process, metType="Puppi",
454  jetCollUnskimmed="slimmedJetsPuppi",
455  recoMetFromPFCs=True,
456  jetFlavor="AK4PFPuppi",
457  postfix="Puppi"
458  )
459  (~pp_on_AA).toModify(process, _add_metPuppi)
460 
461  process.load('PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
462  task.add(process.slimmedMETs)
463 
464  def _add_slimmedMETsPuppi(process):
465  addToProcessAndTask('slimmedMETsPuppi', process.slimmedMETs.clone(), process, task)
466  process.slimmedMETsPuppi.src = cms.InputTag("patMETsPuppi")
467  process.slimmedMETsPuppi.rawVariation = cms.InputTag("patPFMetPuppi")
468  process.slimmedMETsPuppi.t1Uncertainties = cms.InputTag("patPFMetT1%sPuppi")
469  process.slimmedMETsPuppi.t01Variation = cms.InputTag("patPFMetT0pcT1Puppi")
470  process.slimmedMETsPuppi.t1SmearedVarsAndUncs = cms.InputTag("patPFMetT1Smear%sPuppi")
471  process.slimmedMETsPuppi.tXYUncForRaw = cms.InputTag("patPFMetTxyPuppi")
472  process.slimmedMETsPuppi.tXYUncForT1 = cms.InputTag("patPFMetT1TxyPuppi")
473  process.slimmedMETsPuppi.tXYUncForT01 = cms.InputTag("patPFMetT0pcT1TxyPuppi")
474  process.slimmedMETsPuppi.tXYUncForT1Smear = cms.InputTag("patPFMetT1SmearTxyPuppi")
475  process.slimmedMETsPuppi.tXYUncForT01Smear = cms.InputTag("patPFMetT0pcT1SmearTxyPuppi")
476  del process.slimmedMETsPuppi.caloMET
477  (~pp_on_AA).toModify(process, _add_slimmedMETsPuppi)
478 
479  def _add_deepMET(process):
480  from RecoMET.METPUSubtraction.deepMETProducer_cff import deepMETsResolutionTune, deepMETsResponseTune
481 
482  addToProcessAndTask('deepMETsResolutionTune', deepMETsResolutionTune, process, task)
483  addToProcessAndTask('deepMETsResponseTune', deepMETsResponseTune, process, task)
484  (~pp_on_AA).toModify(process, _add_deepMET)
485 
486  # add DetIdAssociatorRecords to EventSetup (for isolatedTracks)
487  process.load("TrackingTools.TrackAssociator.DetIdAssociatorESProducer_cff")
488 
489  # EGamma objects from HGCal are not yet in GED
490  # so add companion collections for Phase-II MiniAOD production
491  from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
492  process.load("RecoEgamma.EgammaTools.slimmedEgammaHGC_cff")
493  phase2_hgcal.toModify(task, func=lambda t: t.add(process.slimmedEgammaHGCTask))
494 
495  #-- Produce a "hybrid" tau collection combining HPS-reconstructed taus with tau-tagged jets
496  # Run it at the end of customisation to ensure that jets sequences with unified taggers are already defined
497  def _addUTagToTaus(process, task,
498  storePNetCHSjets = False,
499  storeUParTPUPPIjets = False,
500  addGenJet = False):
501  if not (storePNetCHSjets or storeUParTPUPPIjets): return process
502  noUpdatedTauName = 'slimmedTausNoUTag'
503  updatedTauName = ''
504  addToProcessAndTask(noUpdatedTauName, process.slimmedTaus.clone(), process, task)
505  process.pfParticleNetFromMiniAODAK4CHSCentralTagInfosSlimmedDeepFlavour.taus = noUpdatedTauName
506  process.pfParticleNetFromMiniAODAK4PuppiCentralTagInfosSlimmedPuppiWithDeepTags.taus = noUpdatedTauName
507  process.pfParticleNetFromMiniAODAK4PuppiForwardTagInfosSlimmedPuppiWithDeepTags.taus = noUpdatedTauName
508  from PhysicsTools.PatAlgos.patTauHybridProducer_cfi import patTauHybridProducer
509  if storePNetCHSjets:
510  jetCollection = 'slimmedJets'
511  TagName = 'pfParticleNetFromMiniAODAK4CHSCentralJetTags'
512  tag_prefix = 'byUTagCHS'
513  updatedTauName = 'slimmedTausWithUTagCHS'
514  # PNet tagger used for CHS jets
515  from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK4_cff import pfParticleNetFromMiniAODAK4CHSCentralJetTags
516  Discriminators = [TagName+":"+tag for tag in pfParticleNetFromMiniAODAK4CHSCentralJetTags.flav_names.value()]
517  # Define "hybridTau" producer
518  setattr(process, updatedTauName,
519  patTauHybridProducer.clone(
520  src = noUpdatedTauName,
521  jetSource = jetCollection,
522  dRMax = 0.4,
523  jetPtMin = 15,
524  jetEtaMax = 2.5,
525  UTagLabel = TagName,
526  UTagScoreNames = Discriminators,
527  tagPrefix = tag_prefix,
528  tauScoreMin = -1,
529  vsJetMin = 0.05,
530  checkTauScoreIsBest = False,
531  chargeAssignmentProbMin = 0.2,
532  addGenJetMatch = addGenJet,
533  genJetMatch = ''
534  ))
535  if addGenJet:
536  addToProcessAndTask('tauGenJetMatchCHSJet',
537  process.tauGenJetMatch.clone(src = jetCollection),
538  process, task)
539  getattr(process,updatedTauName).genJetMatch = 'tauGenJetMatchCHSJet'
540  if storeUParTPUPPIjets: task.add(getattr(process,updatedTauName))
541  if storeUParTPUPPIjets:
542  jetCollection = 'slimmedJetsPuppi'
543  TagName = 'pfUnifiedParticleTransformerAK4JetTags'
544  tag_prefix = 'byUTagPUPPI'
545  updatedTauName = 'slimmedTausWithUTagPUPPI' if not storePNetCHSjets else 'slimmedTausWithUTagCHSAndUTagPUPPI'
546  # Unified ParT Tagger used for PUPPI jets
547  from RecoBTag.ONNXRuntime.pfUnifiedParticleTransformerAK4JetTags_cfi import pfUnifiedParticleTransformerAK4JetTags
548  Discriminators = [TagName+":"+tag for tag in pfUnifiedParticleTransformerAK4JetTags.flav_names.value()]
549  # Define "hybridTau" producer
550  setattr(process, updatedTauName,
551  patTauHybridProducer.clone(
552  src = noUpdatedTauName if not storePNetCHSjets else 'slimmedTausWithUTagCHS',
553  jetSource = jetCollection,
554  dRMax = 0.4,
555  jetPtMin = 15,
556  jetEtaMax = 2.5,
557  UTagLabel = TagName,
558  UTagScoreNames = Discriminators,
559  tagPrefix = tag_prefix,
560  tauScoreMin = -1,
561  vsJetMin = 0.05,
562  checkTauScoreIsBest = False,
563  chargeAssignmentProbMin = 0.2,
564  addGenJetMatch = addGenJet,
565  genJetMatch = ''
566  ))
567  if addGenJet:
568  addToProcessAndTask('tauGenJetMatchPUPPIJet',
569  process.tauGenJetMatch.clone(src = jetCollection),
570  process, task)
571  getattr(process,updatedTauName).genJetMatch = 'tauGenJetMatchPUPPIJet'
572  #add "hybridTau" producer to pat-task and replace slimmedTaus
573  delattr(process, 'slimmedTaus')
574  process.slimmedTaus = getattr(process, updatedTauName).clone()
575  task.add(process.slimmedTaus)
576  return process
577 
578  _uTagToTaus_switches = cms.PSet(
579  storePNetCHSjets = cms.bool(True),
580  storeUParTPUPPIjets = cms.bool(True),
581  addGenJet = cms.bool(True)
582  )
583  pp_on_AA.toModify(_uTagToTaus_switches, storePNetCHSjets=False, storeUParTPUPPIjets=False)
584  _addUTagToTaus(process, task,
585  storePNetCHSjets = _uTagToTaus_switches.storePNetCHSjets.value(),
586  storeUParTPUPPIjets = _uTagToTaus_switches.storePNetCHSjets.value(),
587  addGenJet = _uTagToTaus_switches.addGenJet.value()
588  )
589 
590  # L1 pre-firing weights for 2016, 2017, and 2018
591  from Configuration.Eras.Modifier_run2_L1prefiring_cff import run2_L1prefiring
592  from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger
593  from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff import stage2L1Trigger_2017
594  from Configuration.Eras.Modifier_stage2L1Trigger_2018_cff import stage2L1Trigger_2018
595  from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016
596  if not hasattr(process,'prefiringweight'):
597  process.load("PhysicsTools.PatUtils.L1PrefiringWeightProducer_cff")
598  (stage2L1Trigger & tracker_apv_vfp30_2016).toModify(process.prefiringweight, DataEraECAL = "UL2016preVFP", DataEraMuon = "2016preVFP" )
599  (stage2L1Trigger & ~tracker_apv_vfp30_2016).toModify(process.prefiringweight, DataEraECAL = "UL2016postVFP", DataEraMuon = "2016postVFP" )
600  stage2L1Trigger_2017.toModify(process.prefiringweight, DataEraECAL = "UL2017BtoF", DataEraMuon = "20172018")
601  stage2L1Trigger_2018.toModify(process.prefiringweight, DataEraECAL = "None", DataEraMuon = "20172018")
602  run2_L1prefiring.toModify(task, func=lambda t: t.add(process.prefiringweight))
603 
604  from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import removeL1FastJetJECs
605  pp_on_AA.toModify(process, removeL1FastJetJECs)
606 
def makeInputForPUPPIIsolationMuon(process)
def miniAOD_customizeCommon(process)
def applySubstructure(process, postfix="")
def switchOnVIDElectronIdProducer(process, dataFormat, task=None)
Electrons.
Definition: vid_id_tools.py:66
def addToProcessAndTask(label, module, process, task)
Definition: helpers.py:28
def makeInputForPUPPIIsolationEgm(process)
def setupAllVIDIdsInModule(process, id_module_name, setupFunction, patProducer=None, addUserData=True, task=None)
Definition: vid_id_tools.py:49
def runMetCorAndUncForMiniAODProduction(process, metType="PF", jetCollUnskimmed="patJets", photonColl="selectedPatPhotons", electronColl="selectedPatElectrons", muonColl="selectedPatMuons", tauColl="selectedPatTaus", pfCandColl="particleFlow", jetCleaning="LepClean", jetSelection="pt>15 && abs(eta)<9.9", jecUnFile="", jetFlavor="AK4PFchs", recoMetFromPFCs=False, postfix="")
def applyDeepBtagging(process, postfix="")
switchOnTriggerStandAlone
Definition: trigTools.py:283
def makeVIDBitsModifier(process, eleVIDModuleName, phoVIDModuleName)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
def getPatAlgosToolsTask(process)
Definition: helpers.py:13
def switchOnVIDPhotonIdProducer(process, dataFormat, task=None)
Photons.
#define str(s)

◆ miniAOD_customizeData()

def miniAOD_tools.miniAOD_customizeData (   process)

Definition at line 668 of file miniAOD_tools.py.

References helpers.getPatAlgosToolsTask(), and print().

Referenced by customizeMiniAOD_MuEGFixMoriond2017.customizeAll(), and miniAOD_customizeAllData().

668 def miniAOD_customizeData(process):
669  from PhysicsTools.PatAlgos.tools.coreTools import runOnData
670  runOnData( process, outputModules = [] )
671  # hybrid taus
672  print('removing MC dependencies for hybrid taus')
673  modulesToDel = []
674  for postfix in ['','WithUTagCHS','WithUTagPUPPI','WithUTagCHSAndUTagPUPPI']:
675  if hasattr(process,'slimmedTaus'+postfix):
676  hybridTau = getattr(process,'slimmedTaus'+postfix)
677  if hasattr(hybridTau,'addGenJetMatch'):
678  hybridTau.addGenJetMatch = False
679  genJetModule = hybridTau.genJetMatch.getModuleLabel()
680  if not genJetModule in modulesToDel:
681  modulesToDel.append(genJetModule)
682  hybridTau.genJetMatch = ''
683  for module in modulesToDel:
684  if hasattr(process,module): delattr(process,module)
685 
686  process.load("RecoPPS.Local.ctppsLocalTrackLiteProducer_cff")
687  process.load("RecoPPS.ProtonReconstruction.ctppsProtons_cff")
688  process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi")
689  process.load('L1Trigger.L1TGlobal.simGtExtFakeProd_cfi')
690  task = getPatAlgosToolsTask(process)
691  task.add(process.simGtExtUnprefireable)
692  from Configuration.Eras.Modifier_ctpps_cff import ctpps
693  ctpps.toModify(task, func=lambda t: t.add(process.ctppsLocalTrackLiteProducer))
694  ctpps.toModify(task, func=lambda t: t.add(process.ctppsProtons))
695  from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
696  run2_miniAOD_UL.toModify(task, func=lambda t: t.add(process.simGtExtUnprefireable))
697 
def miniAOD_customizeData(process)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def getPatAlgosToolsTask(process)
Definition: helpers.py:13

◆ miniAOD_customizeMC()

def miniAOD_tools.miniAOD_customizeMC (   process)

Definition at line 607 of file miniAOD_tools.py.

References helpers.getPatAlgosToolsTask().

Referenced by customisers.customiseMerging(), miniAOD_customizeAllMC(), and miniAOD_customizeAllMCFastSim().

607 def miniAOD_customizeMC(process):
608  task = getPatAlgosToolsTask(process)
609  #GenJetFlavourInfos
610  process.load("PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi")
611  task.add(process.selectedHadronsAndPartons)
612  task.add(process.selectedHadronsAndPartonsForGenJetsFlavourInfos)
613 
614  process.load("PhysicsTools.JetMCAlgos.AK4GenJetFlavourInfos_cfi")
615  task.add(process.ak4GenJetFlavourInfos)
616 
617  process.load('PhysicsTools.PatAlgos.slimming.slimmedGenJetsFlavourInfos_cfi')
618  task.add(process.slimmedGenJetsFlavourInfos)
619 
620  #slimmed pileup information
621  process.load('PhysicsTools.PatAlgos.slimming.slimmedAddPileupInfo_cfi')
622  task.add(process.slimmedAddPileupInfo)
623 
624  process.muonMatch.matched = "prunedGenParticles"
625  process.electronMatch.matched = "prunedGenParticles"
626  process.electronMatch.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
627  process.photonMatch.matched = "prunedGenParticles"
628  process.photonMatch.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
629  process.ootPhotonMatch.matched = "prunedGenParticles"
630  process.ootPhotonMatch.src = cms.InputTag("reducedEgamma","reducedOOTPhotons")
631  process.tauMatch.matched = "prunedGenParticles"
632  process.tauGenJets.GenParticles = "prunedGenParticles"
633  #Boosted taus
634  process.tauMatchBoosted.matched = "prunedGenParticles"
635  process.tauGenJetsBoosted.GenParticles = "prunedGenParticles"
636  process.patJetPartons.particles = "genParticles"
637  process.patJetPartonMatch.matched = "prunedGenParticles"
638  pp_on_AA.toModify(process.patJetPartonMatch, matched = "hiSignalGenParticles")
639  from Configuration.ProcessModifiers.genJetSubEvent_cff import genJetSubEvent
640  genJetSubEvent.toModify(process.patJetPartonMatch, matched = "cleanedPartons")
641  process.patJetPartonMatch.mcStatus = [ 3, 23 ]
642  process.patJetGenJetMatch.matched = "slimmedGenJets"
643  (~pp_on_AA).toModify(process, patJetGenJetMatchAK8Puppi = dict(matched = "slimmedGenJetsAK8"))
644  process.patMuons.embedGenMatch = False
645  process.patElectrons.embedGenMatch = False
646  process.patPhotons.embedGenMatch = False
647  process.patOOTPhotons.embedGenMatch = False
648  process.patTaus.embedGenMatch = False
649  process.patTausBoosted.embedGenMatch = False
650  process.patJets.embedGenPartonMatch = False
651  #also jet flavour must be switched
652  process.patJetFlavourAssociation.rParam = 0.4
653 
654  from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import removeJECsForMC
655  pp_on_AA.toModify(process, removeJECsForMC)
656  pp_on_AA.toReplaceWith(task,task.copyAndExclude([process.slimmedGenJetsFlavourInfos]))
657 
658 
def miniAOD_customizeMC(process)
def getPatAlgosToolsTask(process)
Definition: helpers.py:13

◆ miniAOD_customizeOutput()

def miniAOD_tools.miniAOD_customizeOutput (   out)

Definition at line 659 of file miniAOD_tools.py.

Referenced by ConfigBuilder.ConfigBuilder.addOutput().

659 def miniAOD_customizeOutput(out):
660  from PhysicsTools.PatAlgos.slimming.MicroEventContent_cff import MiniAODOverrideBranchesSplitLevel
661  out.overrideBranchesSplitLevel = MiniAODOverrideBranchesSplitLevel
662  out.splitLevel = cms.untracked.int32(0)
663  out.dropMetaData = cms.untracked.string('ALL')
664  out.fastCloning= cms.untracked.bool(False)
665  out.overrideInputFileSplitLevels = cms.untracked.bool(True)
666  out.compressionAlgorithm = cms.untracked.string('LZMA')
667 
def miniAOD_customizeOutput(out)