9 from copy
import deepcopy
30 print "WARNING: particle based isolation must be studied"
32 from CommonTools.ParticleFlow.Tools.pfIsolation
import setupPFElectronIso, setupPFMuonIso
35 print "using Gsf Electrons in PF2PAT"
36 print "WARNING: this will destory the feature of top projection which solves the ambiguity between leptons and jets because"
37 print "WARNING: there will be overlap between non-PF electrons and jets even though top projection is ON!"
38 print "********************* "
40 module.useParticleFlow =
False
41 print "Building particle-based isolation for GsfElectrons in PF2PAT(PFBRECO)"
42 print "********************* "
44 getattr(process,
'patDefaultSequence'+postfix).
replace( getattr(process,
"patElectrons"+postfix),
46 getattr(process,
"patElectrons"+postfix) )
50 module.isoDeposits = cms.PSet(
51 pfChargedHadrons = cms.InputTag(
"elPFIsoDepositCharged" + postfix),
52 pfChargedAll = cms.InputTag(
"elPFIsoDepositChargedAll" + postfix),
53 pfPUChargedHadrons = cms.InputTag(
"elPFIsoDepositPU" + postfix),
54 pfNeutralHadrons = cms.InputTag(
"elPFIsoDepositNeutral" + postfix),
55 pfPhotons = cms.InputTag(
"elPFIsoDepositGamma" + postfix)
57 module.isolationValues = cms.PSet(
58 pfChargedHadrons = cms.InputTag(
"elPFIsoValueCharged"+dR+
"PFId"+ postfix),
59 pfChargedAll = cms.InputTag(
"elPFIsoValueChargedAll"+dR+
"PFId"+ postfix),
60 pfPUChargedHadrons = cms.InputTag(
"elPFIsoValuePU"+dR+
"PFId" + postfix),
61 pfNeutralHadrons = cms.InputTag(
"elPFIsoValueNeutral"+dR+
"PFId" + postfix),
62 pfPhotons = cms.InputTag(
"elPFIsoValueGamma"+dR+
"PFId" + postfix)
64 module.isolationValuesNoPFId = cms.PSet(
65 pfChargedHadrons = cms.InputTag(
"elPFIsoValueCharged"+dR+
"NoPFId"+ postfix),
66 pfChargedAll = cms.InputTag(
"elPFIsoValueChargedAll"+dR+
"NoPFId"+ postfix),
67 pfPUChargedHadrons = cms.InputTag(
"elPFIsoValuePU"+dR+
"NoPFId" + postfix),
68 pfNeutralHadrons = cms.InputTag(
"elPFIsoValueNeutral"+dR+
"NoPFId" + postfix),
69 pfPhotons = cms.InputTag(
"elPFIsoValueGamma"+dR+
"NoPFId" + postfix)
74 module.isoDeposits = cms.PSet(
75 pfChargedHadrons = cms.InputTag(
"muPFIsoDepositCharged" + postfix),
76 pfChargedAll = cms.InputTag(
"muPFIsoDepositChargedAll" + postfix),
77 pfPUChargedHadrons = cms.InputTag(
"muPFIsoDepositPU" + postfix),
78 pfNeutralHadrons = cms.InputTag(
"muPFIsoDepositNeutral" + postfix),
79 pfPhotons = cms.InputTag(
"muPFIsoDepositGamma" + postfix)
81 module.isolationValues = cms.PSet(
82 pfChargedHadrons = cms.InputTag(
"muPFIsoValueCharged" + dR + postfix),
83 pfChargedAll = cms.InputTag(
"muPFIsoValueChargedAll" + dR + postfix),
84 pfPUChargedHadrons = cms.InputTag(
"muPFIsoValuePU" + dR + postfix),
85 pfNeutralHadrons = cms.InputTag(
"muPFIsoValueNeutral" + dR + postfix),
86 pfPhotons = cms.InputTag(
"muPFIsoValueGamma" + dR + postfix)
90 print "Building particle-based isolation "
91 print "***************** "
96 getattr(process,
'patDefaultSequence').
replace( getattr(process,
"patCandidates"),
97 process.pfParticleSelectionSequence +
98 process.eleIsoSequence +
99 process.muIsoSequence +
100 getattr(process,
"patCandidates") )
103 print "Adapting PF Muons "
104 print "***************** "
107 module.useParticleFlow =
True
108 module.pfMuonSource = cms.InputTag(
"pfIsolatedMuons" + postfix)
109 module.userIsolation = cms.PSet()
110 module.isoDeposits = cms.PSet(
111 pfChargedHadrons = cms.InputTag(
"muPFIsoDepositCharged" + postfix),
112 pfChargedAll = cms.InputTag(
"muPFIsoDepositChargedAll" + postfix),
113 pfPUChargedHadrons = cms.InputTag(
"muPFIsoDepositPU" + postfix),
114 pfNeutralHadrons = cms.InputTag(
"muPFIsoDepositNeutral" + postfix),
115 pfPhotons = cms.InputTag(
"muPFIsoDepositGamma" + postfix)
117 module.isolationValues = cms.PSet(
118 pfChargedHadrons = cms.InputTag(
"muPFIsoValueCharged04"+ postfix),
119 pfChargedAll = cms.InputTag(
"muPFIsoValueChargedAll04"+ postfix),
120 pfPUChargedHadrons = cms.InputTag(
"muPFIsoValuePU04" + postfix),
121 pfNeutralHadrons = cms.InputTag(
"muPFIsoValueNeutral04" + postfix),
122 pfPhotons = cms.InputTag(
"muPFIsoValueGamma04" + postfix)
125 applyPostfix(process,
"muonMatch",postfix).src = module.pfMuonSource
127 print " muon source:", module.pfMuonSource
128 print " isolation :",
129 print module.isolationValues
130 print " isodeposits: "
131 print module.isoDeposits
137 print "Adapting PF Electrons "
138 print "********************* "
141 module.useParticleFlow =
True
142 module.pfElectronSource = cms.InputTag(
"pfIsolatedElectrons" + postfix)
143 module.userIsolation = cms.PSet()
144 module.isoDeposits = cms.PSet(
145 pfChargedHadrons = cms.InputTag(
"elPFIsoDepositCharged" + postfix),
146 pfChargedAll = cms.InputTag(
"elPFIsoDepositChargedAll" + postfix),
147 pfPUChargedHadrons = cms.InputTag(
"elPFIsoDepositPU" + postfix),
148 pfNeutralHadrons = cms.InputTag(
"elPFIsoDepositNeutral" + postfix),
149 pfPhotons = cms.InputTag(
"elPFIsoDepositGamma" + postfix)
151 module.isolationValues = cms.PSet(
152 pfChargedHadrons = cms.InputTag(
"elPFIsoValueCharged04PFId"+ postfix),
153 pfChargedAll = cms.InputTag(
"elPFIsoValueChargedAll04PFId"+ postfix),
154 pfPUChargedHadrons = cms.InputTag(
"elPFIsoValuePU04PFId" + postfix),
155 pfNeutralHadrons = cms.InputTag(
"elPFIsoValueNeutral04PFId" + postfix),
156 pfPhotons = cms.InputTag(
"elPFIsoValueGamma04PFId" + postfix)
165 print " PF electron source:", module.pfElectronSource
167 print module.isolationValues
168 print " isodeposits: "
169 print module.isoDeposits
172 print "removing traditional isolation"
177 raise RuntimeError,
"Photons are not supported yet"
182 tauType=
'shrinkingConePFTau',
183 pf2patSelection=[
"DiscriminationByIsolation",
"DiscriminationByLeadingPionPtCut"],
184 selectionDependsOn=[
"DiscriminationByLeadingTrackFinding"],
185 producerFromType=
lambda producer: producer+
"Producer",
187 print "patTaus will be produced from taus of type: %s that pass %s" \
188 % (tauType, pf2patSelection)
191 baseSequence = getattr(process,
"pfTausBaseSequence"+postfix)
193 for oldBaseModuleName
in baseSequence.moduleNames():
194 oldBaseModule = getattr(process,oldBaseModuleName)
195 baseSequence.remove(oldBaseModule)
198 producerName = producerFromType(tauType)
200 applyPostfix(process,
"pfTaus", postfix).src = producerName+postfix
202 oldTauSansRefs = getattr(process,
'pfTausProducerSansRefs'+postfix)
203 oldTau = getattr(process,
'pfTausProducer'+postfix)
205 newTauSansRefs =
None
206 newTau = getattr(process,producerName).
clone()
208 if tauType==
'shrinkingConePFTau':
209 newTauSansRefs = getattr(process,producerName+
"SansRefs").
clone()
210 newTauSansRefs.modifiers[1] = cms.PSet(
211 pfTauTagInfoSrc = cms.InputTag(
"pfTauTagInfoProducer"+postfix),
212 name = cms.string(
'pfTauTTIworkaround'+postfix),
213 plugin = cms.string(
'RecoTauTagInfoWorkaroundModifer')
215 newTau.modifiers[1] = newTauSansRefs.modifiers[1]
216 newTauSansRefs.piZeroSrc =
"pfJetsLegacyTaNCPiZeros"+postfix
217 newTau.piZeroSrc = newTauSansRefs.piZeroSrc
218 newTauSansRefs.builders[0].pfCandSrc = oldTauSansRefs.builders[0].pfCandSrc
219 newTauSansRefs.jetRegionSrc = oldTauSansRefs.jetRegionSrc
220 newTauSansRefs.jetSrc = oldTauSansRefs.jetSrc
221 elif tauType==
'fixedConePFTau':
222 newTau.piZeroSrc =
"pfJetsLegacyTaNCPiZeros"+postfix
223 elif tauType==
'hpsPFTau':
224 newTau = process.combinatoricRecoTaus.clone()
225 newTau.piZeroSrc=
"pfJetsLegacyHPSPiZeros"+postfix
226 newTau.modifiers[3] = cms.PSet(
227 pfTauTagInfoSrc = cms.InputTag(
"pfTauTagInfoProducer"+postfix),
228 name = cms.string(
'pfTauTTIworkaround'+postfix),
229 plugin = cms.string(
'RecoTauTagInfoWorkaroundModifer')
235 cms.InputTag(
"combinatoricRecoTaus"),
236 cms.InputTag(
"pfTausBase"+postfix) )
239 cms.InputTag(
"combinatoricRecoTaus"),
240 cms.InputTag(
"pfTausBase"+postfix) )
242 newTau.builders[0].pfCandSrc = oldTau.builders[0].pfCandSrc
243 newTau.jetRegionSrc = oldTau.jetRegionSrc
244 newTau.jetSrc = oldTau.jetSrc
247 setattr(process,
"pfTausBase"+postfix,newTau)
248 if tauType==
'shrinkingConePFTau':
249 setattr(process,
"pfTausBaseSansRefs"+postfix,newTauSansRefs)
250 getattr(process,
"pfTausBase"+postfix).src =
"pfTausBaseSansRefs"+postfix
251 baseSequence += getattr(process,
"pfTausBaseSansRefs"+postfix)
252 baseSequence += getattr(process,
"pfTausBase"+postfix)
253 if tauType==
'hpsPFTau':
254 baseSequence += getattr(process,
"produceHPSPFTaus"+postfix)
256 def producerIsTauTypeMapperWithPostfix(tauProducer):
259 def recoTauTypeMapperWithGroup(tauProducer):
263 for predisc
in selectionDependsOn:
265 originalName = tauType+predisc
266 clonedName =
"pfTausBase"+predisc+postfix
267 clonedDisc = getattr(process, originalName).
clone()
269 setattr(process, clonedName, clonedDisc)
270 baseSequence += getattr(process, clonedName)
272 tauCollectionToSelect =
None
273 if tauType !=
'hpsPFTau' :
274 tauCollectionToSelect =
"pfTausBase"+postfix
277 tauCollectionToSelect =
"hpsPFTauProducer"+postfix
280 oldTauTypeMapper=recoTauTypeMapperWithGroup,
281 newTauTypeMapper=producerIsTauTypeMapperWithPostfix,
282 preservePFTauProducer=
True)
283 clonedDisc.PFTauProducer = tauCollectionToSelect
286 applyPostfix(process,
"pfTaus", postfix).discriminators = cms.VPSet()
287 for selection
in pf2patSelection:
289 originalName = tauType+selection
290 clonedName =
"pfTausBase"+selection+postfix
291 clonedDisc = getattr(process, originalName).
clone()
293 setattr(process, clonedName, clonedDisc)
295 tauCollectionToSelect =
None
297 if tauType !=
'hpsPFTau' :
298 tauCollectionToSelect = cms.InputTag(
"pfTausBase"+postfix)
301 tauCollectionToSelect = cms.InputTag(
"hpsPFTauProducer"+postfix)
304 oldTauTypeMapper=recoTauTypeMapperWithGroup,
305 newTauTypeMapper=producerIsTauTypeMapperWithPostfix,
306 preservePFTauProducer=
True)
307 clonedDisc.PFTauProducer = tauCollectionToSelect
308 baseSequence += clonedDisc
310 applyPostfix(process,
"pfTaus", postfix).discriminators.append(cms.PSet(
311 discriminator=cms.InputTag(clonedName), selectionCut=cms.double(0.5)))
313 if tauType !=
'hpsPFTau':
314 applyPostfix(process,
"pfTaus", postfix).src =
"pfTausBase"+postfix
318 applyPostfix(process,
"pfTaus", postfix).src =
"hpsPFTauProducer"+postfix
322 def adaptPFTaus(process,tauType = 'shrinkingConePFTau', postfix = ""):
324 if tauType !=
'hpsPFTau' :
328 [
"DiscriminationByLooseCombinedIsolationDBSumPtCorr"],
329 [
"DiscriminationByDecayModeFinding"],
332 if tauType !=
'hpsPFTau' :
333 applyPostfix(process,
"patTaus", postfix).tauSource = cms.InputTag(
"pfTausBase"+postfix)
335 applyPostfix(process,
"patTaus", postfix).tauSource = cms.InputTag(
"hpsPFTauProducer"+postfix)
341 cms.InputTag(tauType+
'Producer'),
343 tauType, postfix=postfix)
346 pfTauLabelNew=
applyPostfix(process,
"patTaus", postfix).tauSource,
347 pfTauLabelOld=cms.InputTag(tauType+
'Producer'),
351 applyPostfix(process,
"patPFCandidateIsoDepositSelection", postfix)
356 process.load(
"CommonTools.ParticleFlow.pfTaus_cff")
357 applyPostfix(process,
"pfTaus",postfix).src = cms.InputTag(tauType+
'Producer'+postfix)
361 from PhysicsTools.PatAlgos.producersLayer1.pfParticleProducer_cfi
import patPFParticles
363 producer = patPFParticles.clone(pfCandidateSource = src)
364 filter = cms.EDFilter(
"PATPFParticleSelector",
365 src = cms.InputTag(
"pat" + patLabel),
366 cut = cms.string(cut))
367 counter = cms.EDFilter(
"PATCandViewCountFilter",
368 minNumber = cms.uint32(0),
369 maxNumber = cms.uint32(999999),
370 src = cms.InputTag(
"pat" + patLabel))
372 setattr(process,
"pat" + patLabel, producer)
373 setattr(process,
"selectedPat" + patLabel, filter)
374 setattr(process,
"countPat" + patLabel, counter)
376 getattr(process,
"patDefaultSequence"+postfix).
replace(
378 producer+
applyPostfix(process,
"patCandidateSummary", postfix)
380 getattr(process,
"patDefaultSequence"+postfix).
replace(
381 applyPostfix(process,
"selectedPatCandidateSummary", postfix),
382 filter+
applyPostfix(process,
"selectedPatCandidateSummary", postfix)
384 index = len(
applyPostfix( process,
"patDefaultSequence", postfix ).moduleNames() )
387 applyPostfix(process,
"patCandidateSummary", postfix).candidates.append(cms.InputTag(
'pat' + patLabel))
388 applyPostfix(process,
"selectedPatCandidateSummary", postfix).candidates.append(cms.InputTag(
'selectedPat' + patLabel))
391 def switchToPFMET(process,input=cms.InputTag(
'pfMET'), type1=
False, postfix=
""):
392 print 'MET: using ', input
394 oldMETSource =
applyPostfix(process,
"patMETs",postfix).metSource
395 applyPostfix(process,
"patMETs",postfix).metSource = input
396 applyPostfix(process,
"patMETs",postfix).addMuonCorrections =
False
397 getattr(process,
"patDefaultSequence"+postfix).
remove(
applyPostfix(process,
"patMETCorrections",postfix))
401 print 'Apply TypeI corrections for MET'
402 getattr(process,
"patDefaultSequence"+postfix).
remove(
applyPostfix(process,
"makePatMETs",postfix))
403 jecLabel = getattr(process,
'patJetCorrFactors'+postfix).levels
405 if not hasattr(process,
'producePatPFMETCorrections'):
406 process.load(
"PhysicsTools.PatUtils.patPFMETCorrections_cff")
408 if not hasattr(process,
'producePatPFMETCorrections'+postfix):
411 getattr(process,
'patPFMet'+postfix).metSource = cms.InputTag(
'pfMET'+postfix)
413 getattr(process,
'selectedPatJetsForMETtype1p2Corr'+postfix).src = cms.InputTag(
'selectedPatJets'+postfix)
414 getattr(process,
'selectedPatJetsForMETtype2Corr'+postfix).src = cms.InputTag(
'selectedPatJets'+postfix)
416 getattr(process,
'pfCandMETcorr'+postfix).src = cms.InputTag(
'pfNoJet'+postfix)
418 getattr(process,
'patPFJetMETtype1p2Corr'+postfix).offsetCorrLabel = cms.string(jecLabel[0])
419 getattr(process,
'patPFJetMETtype1p2Corr'+postfix).jetCorrLabel = cms.string(jecLabel[-1])
420 getattr(process,
'patPFJetMETtype1p2Corr'+postfix).type1JetPtThreshold = cms.double(10.0)
421 getattr(process,
'patPFJetMETtype1p2Corr'+postfix).skipEM = cms.bool(
False)
422 getattr(process,
'patPFJetMETtype1p2Corr'+postfix).skipMuons = cms.bool(
False)
424 getattr(process,
'patPFJetMETtype2Corr'+postfix).offsetCorrLabel = cms.string(jecLabel[0])
425 getattr(process,
'patPFJetMETtype2Corr'+postfix).jetCorrLabel = cms.string(jecLabel[-1])
426 getattr(process,
'patPFJetMETtype2Corr'+postfix).type1JetPtThreshold = cms.double(10.0)
427 getattr(process,
'patPFJetMETtype2Corr'+postfix).skipEM = cms.bool(
False)
428 getattr(process,
'patPFJetMETtype2Corr'+postfix).skipMuons = cms.bool(
False)
430 getattr(process,
'patType1CorrectedPFMet'+postfix).srcType1Corrections = cms.VInputTag(
431 cms.InputTag(
"patPFJetMETtype1p2Corr"+postfix,
"type1"),
434 getattr(process,
'patType1p2CorrectedPFMet'+postfix).srcType1Corrections = cms.VInputTag(
435 cms.InputTag(
"patPFJetMETtype1p2Corr"+postfix,
"type1"),
439 getattr(process,
'patMETs'+postfix).metSource =
'patType1CorrectedPFMet'+postfix
441 getattr(process,
"patDefaultSequence"+postfix).
replace( getattr(process,
'selectedPatJets'+postfix),
442 getattr(process,
'selectedPatJets'+postfix)
443 *getattr(process,
'producePatPFMETCorrections'+postfix)
444 *getattr(process,
'patMETs'+postfix)
447 def switchToPFJets(process, input=cms.InputTag(
'pfNoTau'), algo=
'AK5', postfix =
"", jetCorrections=(
'AK5PFchs', [
'L1FastJet',
'L2Relative',
'L3Absolute']), type1=
False, outputModules=[
'out']):
449 print "Switching to PFJets, ", algo
450 print "************************ "
451 print "input collection: ", input
454 genJetCollection = cms.InputTag(
'iterativeCone5GenJetsNoNu')
456 genJetCollection = cms.InputTag(
'ak5GenJetsNoNu')
458 genJetCollection = cms.InputTag(
'ak7GenJetsNoNu')
460 print 'bad jet algorithm:', algo,
'! for now, only IC5, AK5 and AK7 are allowed. If you need other algorithms, please contact Colin'
464 from CommonTools.ParticleFlow.Tools.jetTools
import jetAlgo
465 inputCollection = getattr(process,
"pfJets"+postfix).src
466 setattr(process,
"pfJets"+postfix,
jetAlgo(algo))
467 getattr(process,
"pfJets"+postfix).src = inputCollection
468 inputJetCorrLabel=jetCorrections
469 switchJetCollection(process,
474 jetCorrLabel=inputJetCorrLabel,
476 genJetCollection = genJetCollection,
479 outputModules = outputModules
482 applyPostfix(process,
"patJetCorrFactors", postfix).useRho =
False
483 for corr
in inputJetCorrLabel[1]:
484 if corr ==
'L1FastJet':
485 applyPostfix(process,
"patJetCorrFactors", postfix).useRho =
True
486 applyPostfix(process,
"pfJets", postfix).doAreaFastjet =
True
489 for mod
in getattr(process,
'patPF2PATSequence'+postfix).moduleNames():
490 if mod.startswith(
"kt6")
and mod.endswith(
"Jets"+postfix):
491 prefix = mod.replace(postfix,
'')
492 prefix = prefix.replace(
'kt6PFJets',
'')
493 prefix = prefix.replace(
'kt6CaloJets',
'')
494 prefix = getattr(process,
'patJetCorrFactors'+prefix+postfix).payload.pythonValue().
replace(
"'",
"")
495 for essource
in process.es_sources_().
keys():
496 if essource == prefix+
'L1FastJet':
497 setattr(process,essource+postfix,getattr(process,essource).
clone(srcRho=cms.InputTag(mod,
'rho')))
498 setattr(process,prefix+
'CombinedCorrector'+postfix,getattr(process,prefix+
'CombinedCorrector').
clone())
499 getattr(process,prefix+
'CorMet'+postfix).corrector = prefix+
'CombinedCorrector'+postfix
500 for cor
in getattr(process,prefix+
'CombinedCorrector'+postfix).correctors:
502 idx = getattr(process,prefix+
'CombinedCorrector'+postfix).correctors.index(essource);
503 getattr(process,prefix+
'CombinedCorrector'+postfix).correctors[idx] = essource+postfix
505 applyPostfix(process,
"patJets", postfix).embedCaloTowers =
False
506 applyPostfix(process,
"patJets", postfix).embedPFCandidates =
True
512 removeMCMatching(process, names=[
'All'], postfix=postfix, outputModules=outputModules)
515 def adaptPVs(process, pvCollection=cms.InputTag(
'offlinePrimaryVertices'), postfix=
''):
517 print "Switching PV collection for PF2PAT:", pvCollection
518 print "***********************************"
521 pvExchange = [
'Vertices',
'vertices',
'pvSrc',
'primaryVertices',
'srcPVs']
527 for m
in getattr(process,
'patPF2PATSequence'+postfix).moduleNames():
528 if m.startswith(
'patJets')
and m.endswith(postfix)
and not len(m)==len(
'patJets')+len(postfix):
529 interPostfix = m.replace(
'patJets',
'')
530 interPostfix = interPostfix.replace(postfix,
'')
531 interPostfixes.append(interPostfix)
534 for m
in getattr(process,
'patPF2PATSequence'+postfix).moduleNames():
535 modName = m.replace(postfix,
'')
537 for namePvSrc
in pvExchange:
538 if hasattr(getattr(process,m),namePvSrc):
540 interPostFixFlag =
False
541 for pfix
in interPostfixes:
542 if modName.endswith(pfix):
543 interPostFixFlag =
True
545 if not interPostFixFlag:
546 setattr(getattr(process,m),namePvSrc,deepcopy(pvCollection))
549 def usePF2PAT(process, runPF2PAT=True, jetAlgo='AK5', runOnMC=True, postfix="", jetCorrections=(
'AK5PFchs', [
'L1FastJet',
'L2Relative',
'L3Absolute']), pvCollection=cms.InputTag(
'offlinePrimaryVertices'), typeIMetCorrections=
False, outputModules=[
'out']):
553 """Switch PAT to use PF2PAT instead of AOD sources. if 'runPF2PAT' is true, we'll also add PF2PAT in front of the PAT sequence"""
557 process.load(
"CommonTools.ParticleFlow.PF2PAT_cff")
560 process.patPF2PATSequence = cms.Sequence( process.PF2PAT + process.patDefaultSequence)
562 process.patPF2PATSequence = cms.Sequence( process.patDefaultSequence )
564 if not postfix ==
"":
575 removeCleaning(process, postfix=postfix, outputModules=outputModules)
589 print "Temporarily switching off photons completely"
591 removeSpecificPATObjects(process,names=[
'Photons'],outputModules=outputModules,postfix=postfix)
596 switchToPFJets( process, cms.InputTag(
'pfNoTau'+postfix), jetAlgo, postfix=postfix,
597 jetCorrections=jetCorrections, type1=typeIMetCorrections, outputModules=outputModules )
600 getattr(process,
"genForPF2PATSequence") *
604 if not 'L2L3Residual' in jetCorrections[1]:
605 print '#################################################'
606 print 'WARNING! Not using L2L3Residual but this is data.'
607 print 'If this is okay with you, disregard this message.'
608 print '#################################################'
609 switchToPFJets( process, cms.InputTag(
'pfNoTau'+postfix), jetAlgo, postfix=postfix,
610 jetCorrections=jetCorrections, type1=typeIMetCorrections, outputModules=outputModules )
615 adaptPFTaus( process, tauType=
'hpsPFTau', postfix=postfix )
618 switchToPFMET(process, cms.InputTag(
'pfMET'+postfix), type1=typeIMetCorrections, postfix=postfix)
620 if hasattr(process,
'patPFMet'+postfix):
621 getattr(process,
'patPFMet'+postfix).addGenMET = cms.bool(
False)
624 addPFCandidates(process,cms.InputTag(
'pfNoJet'+postfix),patLabel=
'PFParticles'+postfix,cut=
"",postfix=postfix)
627 adaptPVs(process, pvCollection=pvCollection, postfix=postfix)
630 process.load(
"CommonTools.ParticleFlow.genForPF2PAT_cff")
631 getattr(process,
"patDefaultSequence"+postfix).
replace(
633 process.genForPF2PATSequence+
applyPostfix(process,
"patCandidates",postfix)
638 print "Done: PF2PAT interfaced to PAT, postfix=", postfix
string jetAlgo
Jet configuration.
def cloneProcessingSnippet
def applyPostfix
Helpers to perform some technically boring tasks like looking for all modules with a given parameter ...
def massSearchReplaceParam
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
perl if(1 lt scalar(@::datatypes))
bool insert(Storage &, ItemType *, const IdTag &)