CMS 3D CMS Logo

Functions
miniAOD_tools Namespace Reference

Functions

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

Function Documentation

def miniAOD_tools.miniAOD_customizeAllData (   process)

Definition at line 403 of file miniAOD_tools.py.

References miniAOD_customizeCommon(), and miniAOD_customizeData().

404  miniAOD_customizeCommon(process)
405  miniAOD_customizeData(process)
406  return process
407 
def miniAOD_customizeAllData(process)
def miniAOD_customizeData(process)
def miniAOD_customizeCommon(process)
Definition: miniAOD_tools.py:7
def miniAOD_tools.miniAOD_customizeAllMC (   process)

Definition at line 408 of file miniAOD_tools.py.

References miniAOD_customizeCommon(), and miniAOD_customizeMC().

409  miniAOD_customizeCommon(process)
410  miniAOD_customizeMC(process)
411  return process
412 
def miniAOD_customizeCommon(process)
Definition: miniAOD_tools.py:7
def miniAOD_customizeAllMC(process)
def miniAOD_customizeMC(process)
def miniAOD_tools.miniAOD_customizeCommon (   process)

Definition at line 7 of file miniAOD_tools.py.

References boostedHPSPFTaus_cfi.addBoostedTaus(), helpers.addToProcessAndTask(), applySubstructure_cff.applySubstructure(), helpers.getPatAlgosToolsTask(), egmIsolationsPUPPI_cfi.makeInputForPUPPIIsolationEgm(), muonIsolationsPUPPI_cfi.makeInputForPUPPIIsolationMuon(), puppiForMET_cff.makePuppies(), genParticles_cff.map, runMETCorrectionsAndUncertainties.runMetCorAndUncForMiniAODProduction(), vid_id_tools.setupAllVIDIdsInModule(), trigTools.switchOnTriggerStandAlone, vid_id_tools.switchOnVIDElectronIdProducer(), and vid_id_tools.switchOnVIDPhotonIdProducer().

Referenced by miniAOD_customizeAllData(), and miniAOD_customizeAllMC().

8  process.patMuons.isoDeposits = cms.PSet()
9  process.patElectrons.isoDeposits = cms.PSet()
10  process.patTaus.isoDeposits = cms.PSet()
11  process.patPhotons.isoDeposits = cms.PSet()
12  #
13  process.patMuons.embedTrack = True # used for IDs
14  process.patMuons.embedCombinedMuon = True # used for IDs
15  process.patMuons.embedMuonBestTrack = True # used for IDs
16  process.patMuons.embedStandAloneMuon = True # maybe?
17  process.patMuons.embedPickyMuon = False # no, use best track
18  process.patMuons.embedTpfmsMuon = False # no, use best track
19  process.patMuons.embedDytMuon = False # no, use best track
20  process.patMuons.addPuppiIsolation = cms.bool(True)
21  process.patMuons.puppiIsolationChargedHadrons = cms.InputTag("muonPUPPIIsolation","h+-DR040-ThresholdVeto000-ConeVeto000")
22  process.patMuons.puppiIsolationNeutralHadrons = cms.InputTag("muonPUPPIIsolation","h0-DR040-ThresholdVeto000-ConeVeto001")
23  process.patMuons.puppiIsolationPhotons = cms.InputTag("muonPUPPIIsolation","gamma-DR040-ThresholdVeto000-ConeVeto001")
24  process.patMuons.puppiNoLeptonsIsolationChargedHadrons = cms.InputTag("muonPUPPINoLeptonsIsolation","h+-DR040-ThresholdVeto000-ConeVeto000")
25  process.patMuons.puppiNoLeptonsIsolationNeutralHadrons = cms.InputTag("muonPUPPINoLeptonsIsolation","h0-DR040-ThresholdVeto000-ConeVeto001")
26  process.patMuons.puppiNoLeptonsIsolationPhotons = cms.InputTag("muonPUPPINoLeptonsIsolation","gamma-DR040-ThresholdVeto000-ConeVeto001")
27 
28  process.patMuons.computeMiniIso = cms.bool(True)
29 
30  #
31  # disable embedding of electron and photon associated objects already stored by the ReducedEGProducer
32  process.patElectrons.embedGsfElectronCore = False ## process.patElectrons.embed in AOD externally stored gsf electron core
33  process.patElectrons.embedSuperCluster = False ## process.patElectrons.embed in AOD externally stored supercluster
34  process.patElectrons.embedPflowSuperCluster = False ## process.patElectrons.embed in AOD externally stored supercluster
35  process.patElectrons.embedSeedCluster = False ## process.patElectrons.embed in AOD externally stored the electron's seedcluster
36  process.patElectrons.embedBasicClusters = False ## process.patElectrons.embed in AOD externally stored the electron's basic clusters
37  process.patElectrons.embedPreshowerClusters = False ## process.patElectrons.embed in AOD externally stored the electron's preshower clusters
38  process.patElectrons.embedPflowBasicClusters = False ## process.patElectrons.embed in AOD externally stored the electron's pflow basic clusters
39  process.patElectrons.embedPflowPreshowerClusters = False ## process.patElectrons.embed in AOD externally stored the electron's pflow preshower clusters
40  process.patElectrons.embedRecHits = False ## process.patElectrons.embed in AOD externally stored the RecHits - can be called from the PATElectronProducer
41  process.patElectrons.electronSource = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
42  process.patElectrons.usePfCandidateMultiMap = True
43  process.patElectrons.pfCandidateMultiMap = cms.InputTag("reducedEgamma","reducedGsfElectronPfCandMap")
44  process.patElectrons.electronIDSources = cms.PSet(
45  # configure many IDs as InputTag <someName> = <someTag> you
46  # can comment out those you don't want to save some disk space
47  eidRobustLoose = cms.InputTag("reducedEgamma","eidRobustLoose"),
48  eidRobustTight = cms.InputTag("reducedEgamma","eidRobustTight"),
49  eidLoose = cms.InputTag("reducedEgamma","eidLoose"),
50  eidTight = cms.InputTag("reducedEgamma","eidTight"),
51  eidRobustHighEnergy = cms.InputTag("reducedEgamma","eidRobustHighEnergy"),
52  )
53  process.patElectrons.addPFClusterIso = cms.bool(True)
54  #add puppi isolation in miniAOD
55  process.patElectrons.addPuppiIsolation = cms.bool(True)
56  process.patElectrons.puppiIsolationChargedHadrons = cms.InputTag("egmElectronPUPPIIsolation","h+-DR030-BarVeto000-EndVeto001")
57  process.patElectrons.puppiIsolationNeutralHadrons = cms.InputTag("egmElectronPUPPIIsolation","h0-DR030-BarVeto000-EndVeto000")
58  process.patElectrons.puppiIsolationPhotons = cms.InputTag("egmElectronPUPPIIsolation","gamma-DR030-BarVeto000-EndVeto008")
59  process.patElectrons.puppiNoLeptonsIsolationChargedHadrons = cms.InputTag("egmElectronPUPPINoLeptonsIsolation","h+-DR030-BarVeto000-EndVeto001")
60  process.patElectrons.puppiNoLeptonsIsolationNeutralHadrons = cms.InputTag("egmElectronPUPPINoLeptonsIsolation","h0-DR030-BarVeto000-EndVeto000")
61  process.patElectrons.puppiNoLeptonsIsolationPhotons = cms.InputTag("egmElectronPUPPINoLeptonsIsolation","gamma-DR030-BarVeto000-EndVeto008")
62 
63  process.patElectrons.computeMiniIso = cms.bool(True)
64 
65  process.patElectrons.ecalPFClusterIsoMap = cms.InputTag("reducedEgamma", "eleEcalPFClusIso")
66  process.patElectrons.hcalPFClusterIsoMap = cms.InputTag("reducedEgamma", "eleHcalPFClusIso")
67 
68  process.elPFIsoDepositChargedPAT.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
69  process.elPFIsoDepositChargedAllPAT.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
70  process.elPFIsoDepositNeutralPAT.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
71  process.elPFIsoDepositGammaPAT.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
72  process.elPFIsoDepositPUPAT.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
73  #
74  process.patPhotons.embedSuperCluster = False ## whether to process.patPhotons.embed in AOD externally stored supercluster
75  process.patPhotons.embedSeedCluster = False ## process.patPhotons.embed in AOD externally stored the photon's seedcluster
76  process.patPhotons.embedBasicClusters = False ## process.patPhotons.embed in AOD externally stored the photon's basic clusters
77  process.patPhotons.embedPreshowerClusters = False ## process.patPhotons.embed in AOD externally stored the photon's preshower clusters
78  process.patPhotons.embedRecHits = False ## process.patPhotons.embed in AOD externally stored the RecHits - can be called from the PATPhotonProducer
79  process.patPhotons.addPFClusterIso = cms.bool(True)
80 
81  #add puppi isolation in miniAOD
82  process.patPhotons.addPuppiIsolation = cms.bool(True)
83  process.patPhotons.puppiIsolationChargedHadrons = cms.InputTag("egmPhotonPUPPIIsolation","h+-DR030-")
84  process.patPhotons.puppiIsolationNeutralHadrons = cms.InputTag("egmPhotonPUPPIIsolation","h0-DR030-")
85  process.patPhotons.puppiIsolationPhotons = cms.InputTag("egmPhotonPUPPIIsolation","gamma-DR030-")
86 
87  process.patPhotons.ecalPFClusterIsoMap = cms.InputTag("reducedEgamma", "phoEcalPFClusIso")
88  process.patPhotons.hcalPFClusterIsoMap = cms.InputTag("reducedEgamma", "phoHcalPFClusIso")
89  process.patPhotons.photonSource = cms.InputTag("reducedEgamma","reducedGedPhotons")
90  process.patPhotons.electronSource = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
91  process.patPhotons.photonIDSources = cms.PSet(
92  PhotonCutBasedIDLoose = cms.InputTag('reducedEgamma',
93  'PhotonCutBasedIDLoose'),
94  PhotonCutBasedIDTight = cms.InputTag('reducedEgamma',
95  'PhotonCutBasedIDTight')
96  )
97 
98  process.phPFIsoDepositChargedPAT.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
99  process.phPFIsoDepositChargedAllPAT.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
100  process.phPFIsoDepositNeutralPAT.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
101  process.phPFIsoDepositGammaPAT.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
102  process.phPFIsoDepositPUPAT.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
103  #
104  process.patOOTPhotons.photonSource = cms.InputTag("reducedEgamma","reducedOOTPhotons")
105  process.patOOTPhotons.electronSource = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
106  #
107  process.selectedPatJets.cut = cms.string("pt > 10")
108  process.selectedPatMuons.cut = cms.string("pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose')))")
109 
110  from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon
111  phase2_muon.toModify(process.selectedPatMuons, cut = "pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose') || muonID('ME0MuonArbitrated') || muonID('GEMMuonArbitrated')) )")
112 
113  process.selectedPatElectrons.cut = cms.string("")
114  process.selectedPatTaus.cut = cms.string("pt > 18. && tauID('decayModeFindingNewDMs')> 0.5")
115  process.selectedPatPhotons.cut = cms.string("")
116 
117  from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
118 
119  from PhysicsTools.PatAlgos.slimming.applySubstructure_cff import applySubstructure
120  applySubstructure( process )
121 
122 
123  #
124  from PhysicsTools.PatAlgos.tools.trigTools import switchOnTriggerStandAlone
125  switchOnTriggerStandAlone( process, outputModule = '' )
126  process.patTrigger.packTriggerPathNames = cms.bool(True)
127  #
128  # apply type I + other PFMEt corrections to pat::MET object
129  # and estimate systematic uncertainties on MET
130 
131  from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties import runMetCorAndUncForMiniAODProduction
132  runMetCorAndUncForMiniAODProduction(process, metType="PF",
133  jetCollUnskimmed="patJets")
134 
135  #caloMET computation
136  from PhysicsTools.PatAlgos.tools.metTools import addMETCollection
137  addMETCollection(process,
138  labelName = "patCaloMet",
139  metSource = "caloMetM"
140  )
141 
142  #noHF pfMET =========
143 
144  task = getPatAlgosToolsTask(process)
145 
146  process.noHFCands = cms.EDFilter("GenericPFCandidateSelector",
147  src=cms.InputTag("particleFlow"),
148  cut=cms.string("abs(pdgId)!=1 && abs(pdgId)!=2 && abs(eta)<3.0")
149  )
150  task.add(process.noHFCands)
151 
153  pfCandColl=cms.InputTag("noHFCands"),
154  recoMetFromPFCs=True, #needed for HF removal
155  jetSelection="pt>15 && abs(eta)<3.",
156  postfix="NoHF"
157  )
158 
159  process.load('PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
160  task.add(process.slimmedMETs)
161  addToProcessAndTask('slimmedMETsNoHF', process.slimmedMETs.clone(), process, task)
162  process.slimmedMETsNoHF.src = cms.InputTag("patMETsNoHF")
163  process.slimmedMETsNoHF.rawVariation = cms.InputTag("patPFMetNoHF")
164  process.slimmedMETsNoHF.t1Uncertainties = cms.InputTag("patPFMetT1%sNoHF")
165  process.slimmedMETsNoHF.t01Variation = cms.InputTag("patPFMetT0pcT1NoHF")
166  process.slimmedMETsNoHF.t1SmearedVarsAndUncs = cms.InputTag("patPFMetT1Smear%sNoHF")
167  process.slimmedMETsNoHF.tXYUncForRaw = cms.InputTag("patPFMetTxyNoHF")
168  process.slimmedMETsNoHF.tXYUncForT1 = cms.InputTag("patPFMetT1TxyNoHF")
169  process.slimmedMETsNoHF.tXYUncForT01 = cms.InputTag("patPFMetT0pcT1TxyNoHF")
170  process.slimmedMETsNoHF.tXYUncForT1Smear = cms.InputTag("patPFMetT1SmearTxyNoHF")
171  process.slimmedMETsNoHF.tXYUncForT01Smear = cms.InputTag("patPFMetT0pcT1SmearTxyNoHF")
172  del process.slimmedMETsNoHF.caloMET
173  # ================== NoHF pfMET
174 
175  ## PU JetID
176  process.load("RecoJets.JetProducers.PileupJetID_cfi")
177  task.add(process.pileUpJetIDTask)
178 
179  process.patJets.userData.userFloats.src = [ cms.InputTag("pileupJetId:fullDiscriminant"), ]
180  process.patJets.userData.userInts.src = [ cms.InputTag("pileupJetId:fullId"), ]
181 
182  ## Quark Gluon Likelihood
183  process.load('RecoJets.JetProducers.QGTagger_cfi')
184  task.add(process.QGTaggerTask)
185 
186  process.patJets.userData.userFloats.src += [ cms.InputTag('QGTagger:qgLikelihood'), ]
187 
188  ## CaloJets
189  process.caloJetMap = cms.EDProducer("RecoJetDeltaRValueMapProducer",
190  src = process.patJets.jetSource,
191  matched = cms.InputTag("ak4CaloJets"),
192  distMax = cms.double(0.4),
193  values = cms.vstring('pt','emEnergyFraction'),
194  valueLabels = cms.vstring('pt','emEnergyFraction'),
195  lazyParser = cms.bool(True) )
196  task.add(process.caloJetMap)
197  process.patJets.userData.userFloats.src += [ cms.InputTag("caloJetMap:pt"), cms.InputTag("caloJetMap:emEnergyFraction") ]
198 
199  #Muon object modifications
200  from PhysicsTools.PatAlgos.slimming.muonIsolationsPUPPI_cfi import makeInputForPUPPIIsolationMuon
202 
203  #EGM object modifications
204  from PhysicsTools.PatAlgos.slimming.egmIsolationsPUPPI_cfi import makeInputForPUPPIIsolationEgm
206  from RecoEgamma.EgammaTools.egammaObjectModificationsInMiniAOD_cff import egamma_modifications
207  process.slimmedElectrons.modifierConfig.modifications = egamma_modifications
208  process.slimmedPhotons.modifierConfig.modifications = egamma_modifications
209 
210  #VID Electron IDs
211  electron_ids = ['RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_PHYS14_PU20bx25_V2_cff',
212  'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Spring15_25ns_V1_cff',
213  'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Spring15_50ns_V2_cff',
214  'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV60_cff',
215  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring15_25ns_nonTrig_V1_cff',
216  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring15_25ns_Trig_V1_cff',
217  'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring15_50ns_Trig_V1_cff']
218  switchOnVIDElectronIdProducer(process,DataFormat.MiniAOD, task)
219  process.egmGsfElectronIDs.physicsObjectSrc = \
220  cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
221  process.electronMVAValueMapProducer.src = \
222  cms.InputTag('reducedEgamma','reducedGedGsfElectrons')
223  process.electronRegressionValueMapProducer.src = \
224  cms.InputTag('reducedEgamma','reducedGedGsfElectrons')
225  for idmod in electron_ids:
226  setupAllVIDIdsInModule(process,idmod,setupVIDElectronSelection,None,False,task)
227 
228  #heepIDVarValueMaps only exists if HEEP V6.1 or HEEP 7.0 ID has already been loaded
229  if hasattr(process,'heepIDVarValueMaps'):
230  process.heepIDVarValueMaps.elesMiniAOD = cms.InputTag('reducedEgamma','reducedGedGsfElectrons')
231  #force HEEP to use miniAOD (otherwise it'll detect the AOD)
232  process.heepIDVarValueMaps.dataFormat = cms.int32(2)
233 
234 
235  #VID Photon IDs
236  photon_ids = ['RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Spring15_25ns_V1_cff',
237  'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Spring15_50ns_V1_cff',
238  'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring15_25ns_nonTrig_V2p1_cff',
239  'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring15_50ns_nonTrig_V2p1_cff',
240  'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Spring16_V2p2_cff',
241  'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring16_nonTrig_V1_cff']
242  switchOnVIDPhotonIdProducer(process,DataFormat.AOD, task)
243  process.egmPhotonIsolation.srcToIsolate = \
244  cms.InputTag("reducedEgamma","reducedGedPhotons")
245  for iPSet in process.egmPhotonIsolation.isolationConeDefinitions:
246  iPSet.particleBasedIsolation = cms.InputTag("reducedEgamma","reducedPhotonPfCandMap")
247 
248  process.egmPhotonIDs.physicsObjectSrc = \
249  cms.InputTag("reducedEgamma","reducedGedPhotons")
250  process.photonIDValueMapProducer.src = \
251  cms.InputTag("reducedEgamma","reducedGedPhotons")
252  process.photonRegressionValueMapProducer.src = \
253  cms.InputTag("reducedEgamma","reducedGedPhotons")
254  process.photonIDValueMapProducer.particleBasedIsolation = \
255  cms.InputTag("reducedEgamma","reducedPhotonPfCandMap")
256  process.photonMVAValueMapProducer.src = \
257  cms.InputTag('reducedEgamma','reducedGedPhotons')
258  for idmod in photon_ids:
259  setupAllVIDIdsInModule(process,idmod,setupVIDPhotonSelection,None,False,task)
260 
261  #---------------------------------------------------------------------------
262  #Adding Boosted Subjets taus
263  from RecoTauTag.Configuration.boostedHPSPFTaus_cfi import addBoostedTaus
264  addBoostedTaus(process)
265  #---------------------------------------------------------------------------
266 
267  # Adding puppi jets
268  if not hasattr(process, 'ak4PFJetsPuppi'): #MM: avoid confilct with substructure call
269  process.load('RecoJets.JetProducers.ak4PFJetsPuppi_cfi')
270  task.add(process.ak4PFJets)
271  task.add(process.ak4PFJetsPuppi)
272  process.ak4PFJetsPuppi.doAreaFastjet = True # even for standard ak4PFJets this is overwritten in RecoJets/Configuration/python/RecoPFJets_cff
273  from RecoJets.JetAssociationProducers.j2tParametersVX_cfi import j2tParametersVX
274  process.ak4PFJetsPuppiTracksAssociatorAtVertex = cms.EDProducer("JetTracksAssociatorAtVertex",
275  j2tParametersVX,
276  jets = cms.InputTag("ak4PFJetsPuppi")
277  )
278  task.add(process.ak4PFJetsPuppiTracksAssociatorAtVertex)
279  process.patJetPuppiCharge = cms.EDProducer("JetChargeProducer",
280  src = cms.InputTag("ak4PFJetsPuppiTracksAssociatorAtVertex"),
281  var = cms.string('Pt'),
282  exp = cms.double(1.0)
283  )
284  task.add(process.patJetPuppiCharge)
285 
286  addJetCollection(process, postfix = "", labelName = 'Puppi', jetSource = cms.InputTag('ak4PFJetsPuppi'),
287  jetCorrections = ('AK4PFPuppi', ['L2Relative', 'L3Absolute'], ''),
288  pfCandidates = cms.InputTag('puppi'), # using Puppi candidates as input for b tagging of Puppi jets
289  algo= 'AK', rParam = 0.4, btagDiscriminators = map(lambda x: x.value() ,process.patJets.discriminatorSources)
290  )
291 
292  process.patJetGenJetMatchPuppi.matched = 'slimmedGenJets'
293 
294  process.patJetsPuppi.jetChargeSource = cms.InputTag("patJetPuppiCharge")
295 
296  process.selectedPatJetsPuppi.cut = cms.string("pt > 15")
297 
298  process.load('PhysicsTools.PatAlgos.slimming.slimmedJets_cfi')
299  task.add(process.slimmedJets)
300  task.add(process.slimmedJetsAK8)
301  addToProcessAndTask('slimmedJetsPuppi', process.slimmedJets.clone(), process, task)
302  process.slimmedJetsPuppi.src = cms.InputTag("selectedPatJetsPuppi")
303  process.slimmedJetsPuppi.packedPFCandidates = cms.InputTag("packedPFCandidates")
304 
305 
306  ## puppi met
307  from PhysicsTools.PatAlgos.slimming.puppiForMET_cff import makePuppies
308  makePuppies( process );
309 
310  runMetCorAndUncForMiniAODProduction(process, metType="Puppi",
311  pfCandColl=cms.InputTag("puppiForMET"),
312  jetCollUnskimmed="slimmedJetsPuppi",
313  recoMetFromPFCs=True,
314  jetFlavor="AK4PFPuppi",
315  postfix="Puppi"
316  )
317 
318  process.load('PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
319  task.add(process.slimmedMETs)
320  addToProcessAndTask('slimmedMETsPuppi', process.slimmedMETs.clone(), process, task)
321  process.slimmedMETsPuppi.src = cms.InputTag("patMETsPuppi")
322  process.slimmedMETsPuppi.rawVariation = cms.InputTag("patPFMetPuppi")
323  process.slimmedMETsPuppi.t1Uncertainties = cms.InputTag("patPFMetT1%sPuppi")
324  process.slimmedMETsPuppi.t01Variation = cms.InputTag("patPFMetT0pcT1Puppi")
325  process.slimmedMETsPuppi.t1SmearedVarsAndUncs = cms.InputTag("patPFMetT1Smear%sPuppi")
326  process.slimmedMETsPuppi.tXYUncForRaw = cms.InputTag("patPFMetTxyPuppi")
327  process.slimmedMETsPuppi.tXYUncForT1 = cms.InputTag("patPFMetT1TxyPuppi")
328  process.slimmedMETsPuppi.tXYUncForT01 = cms.InputTag("patPFMetT0pcT1TxyPuppi")
329  process.slimmedMETsPuppi.tXYUncForT1Smear = cms.InputTag("patPFMetT1SmearTxyPuppi")
330  process.slimmedMETsPuppi.tXYUncForT01Smear = cms.InputTag("patPFMetT0pcT1SmearTxyPuppi")
331  del process.slimmedMETsPuppi.caloMET
332 
333  # add DetIdAssociatorRecords to EventSetup (for isolatedTracks)
334  process.load("TrackingTools.TrackAssociator.DetIdAssociatorESProducer_cff")
335 
336  # EGamma objects from HGCal are not yet in GED
337  # so add companion collections for Phase-II MiniAOD production
338  from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
339  process.load("RecoEgamma.EgammaTools.slimmedEgammaFromMultiCl_cff")
340  phase2_hgcal.toModify(task, func=lambda t: t.add(process.slimmedEgammaFromMultiClTask))
341 
342 
def makeInputForPUPPIIsolationMuon(process)
def miniAOD_customizeCommon(process)
Definition: miniAOD_tools.py:7
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:27
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 makePuppies(process)
switchOnTriggerStandAlone
Definition: trigTools.py:281
def getPatAlgosToolsTask(process)
Definition: helpers.py:12
def switchOnVIDPhotonIdProducer(process, dataFormat, task=None)
Photons.
def miniAOD_tools.miniAOD_customizeData (   process)

Definition at line 396 of file miniAOD_tools.py.

References helpers.getPatAlgosToolsTask().

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

397  from PhysicsTools.PatAlgos.tools.coreTools import runOnData
398  runOnData( process, outputModules = [] )
399  process.load("RecoCTPPS.TotemRPLocal.ctppsLocalTrackLiteProducer_cff")
400  task = getPatAlgosToolsTask(process)
401  task.add(process.ctppsLocalTrackLiteProducer)
402 
def miniAOD_customizeData(process)
def getPatAlgosToolsTask(process)
Definition: helpers.py:12
def miniAOD_tools.miniAOD_customizeMC (   process)

Definition at line 343 of file miniAOD_tools.py.

References helpers.getPatAlgosToolsTask().

Referenced by miniAOD_customizeAllMC().

343 def miniAOD_customizeMC(process):
344  task = getPatAlgosToolsTask(process)
345  #GenJetFlavourInfos
346  process.load("PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi")
347  task.add(process.selectedHadronsAndPartons)
348  task.add(process.selectedHadronsAndPartonsForGenJetsFlavourInfos)
349 
350  process.load("PhysicsTools.JetMCAlgos.AK4GenJetFlavourInfos_cfi")
351  task.add(process.ak4GenJetFlavourInfos)
352 
353  process.load('PhysicsTools.PatAlgos.slimming.slimmedGenJetsFlavourInfos_cfi')
354  task.add(process.slimmedGenJetsFlavourInfos)
355 
356  #slimmed pileup information
357  process.load('PhysicsTools.PatAlgos.slimming.slimmedAddPileupInfo_cfi')
358  task.add(process.slimmedAddPileupInfo)
359 
360  process.muonMatch.matched = "prunedGenParticles"
361  process.electronMatch.matched = "prunedGenParticles"
362  process.electronMatch.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
363  process.photonMatch.matched = "prunedGenParticles"
364  process.photonMatch.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
365  process.ootPhotonMatch.matched = "prunedGenParticles"
366  process.ootPhotonMatch.src = cms.InputTag("reducedEgamma","reducedOOTPhotons")
367  process.tauMatch.matched = "prunedGenParticles"
368  process.tauGenJets.GenParticles = "prunedGenParticles"
369  #Boosted taus
370  process.tauMatchBoosted.matched = "prunedGenParticles"
371  process.tauGenJetsBoosted.GenParticles = "prunedGenParticles"
372  process.patJetPartons.particles = "prunedGenParticles"
373  process.patJetPartonMatch.matched = "prunedGenParticles"
374  process.patJetPartonMatch.mcStatus = [ 3, 23 ]
375  process.patJetGenJetMatch.matched = "slimmedGenJets"
376  process.patJetGenJetMatchAK8.matched = "slimmedGenJetsAK8"
377  process.patMuons.embedGenMatch = False
378  process.patElectrons.embedGenMatch = False
379  process.patPhotons.embedGenMatch = False
380  process.patOOTPhotons.embedGenMatch = False
381  process.patTaus.embedGenMatch = False
382  process.patTausBoosted.embedGenMatch = False
383  process.patJets.embedGenPartonMatch = False
384  #also jet flavour must be switched
385  process.patJetFlavourAssociation.rParam = 0.4
386 
def miniAOD_customizeMC(process)
def getPatAlgosToolsTask(process)
Definition: helpers.py:12
def miniAOD_tools.miniAOD_customizeOutput (   out)

Definition at line 387 of file miniAOD_tools.py.

Referenced by ConfigBuilder.ConfigBuilder.doNotInlineEventContent().

388  from PhysicsTools.PatAlgos.slimming.MicroEventContent_cff import MiniAODOverrideBranchesSplitLevel
389  out.overrideBranchesSplitLevel = MiniAODOverrideBranchesSplitLevel
390  out.splitLevel = cms.untracked.int32(0)
391  out.dropMetaData = cms.untracked.string('ALL')
392  out.fastCloning= cms.untracked.bool(False)
393  out.overrideInputFileSplitLevels = cms.untracked.bool(True)
394  out.compressionAlgorithm = cms.untracked.string('LZMA')
395 
def miniAOD_customizeOutput(out)