1 import FWCore.ParameterSet.Config
as cms
15 jetColName=
"ak"+
str(
int(coneSize*10))+
"PFJets"
16 internalPfCandColl=pfCandCollection
19 cms.EDProducer(
"PFCandidateFwdPtrProducer",
20 src = cms.InputTag(pfCandCollection) ),
22 process.load(
"CommonTools.ParticleFlow.pfNoPileUpJME_cff")
23 task.add(process.pfNoPileUpJMETask)
25 getattr(process,
"pfPileUpJME"+postfix).PFCandidates = cms.InputTag(
"tmpPFCandCollPtr"+postfix)
26 getattr(process,
"pfNoPileUpJME"+postfix).bottomCollection = cms.InputTag(
"tmpPFCandCollPtr"+postfix)
28 internalPfCandColl =
"pfNoPileUpJME"+postfix
32 getattr(process,jetColName).
clone(
33 src = cms.InputTag(internalPfCandColl),
34 rParam=cms.double(coneSize),
35 doAreaFastjet =
True),
42 label = jetCollection.label()
44 jetCollection.clone(),
46 process.globalReplace(label,
47 cms.EDProducer(
"PFJetCollectionReducer",
48 writeEmptyCollection = cms.bool(
True),
49 jetCollection = cms.InputTag(label+
"AllEvents"),
50 triggeringCollections=badMuons,
58 label = jetCollection.label()
60 jetCollection.clone(),
62 process.globalReplace(label,
63 cms.EDProducer(
"PATJetCollectionReducer",
64 writeEmptyCollection = cms.bool(
False),
65 jetCollection = cms.InputTag(label+
"AllEvents"),
66 triggeringCollections=badMuons,
75 """Take snapshots of the sequences before we change the PFCandidates"""
76 process.originalAK4JetTask, process.originalAK4JetSequence =
listDependencyChain(process, getattr(process,
"slimmedJets"), (
'particleFlow',
'muons'))
77 backupAK4JetSequence =
cloneProcessingSnippet(process, getattr(process,
"originalAK4JetSequence"),
"Backup", addToTask =
True )
78 process.originalAK4PuppiJetTask, process.originalAK4PuppiJetSequence =
listDependencyChain(process,getattr(process,
"slimmedJetsPuppi"), (
'particleFlow',
'muons'))
79 backupAK4PuppiJetSequence =
cloneProcessingSnippet(process, getattr(process,
"originalAK4PuppiJetSequence"),
"Backup", addToTask =
True )
80 process.originalAK8JetTask,process.originalAK8JetSequence =
listDependencyChain(process, getattr(process,
"slimmedJetsAK8"), (
'particleFlow',
'muons'))
81 backupAK8JetSequence =
cloneProcessingSnippet(process, getattr(process,
"originalAK8JetSequence"),
"Backup", addToTask =
True )
83 task.add(process.originalAK4JetTask)
84 task.add(process.originalAK4PuppiJetTask)
85 task.add(process.originalAK8JetTask)
87 return {
'AK4':backupAK4JetSequence,
'AK4Puppi':backupAK4PuppiJetSequence,
'AK8':backupAK8JetSequence }
91 """Deploy the snapshots after the change of PFCandidates"""
96 for sequence
in six.itervalues(sequences):
105 process.patJetsBackup.userData.userInts.labelPostfixesToStrip = cms.vstring(
"Backup",)
106 process.patJetsBackup.userData.userFloats.labelPostfixesToStrip = cms.vstring(
"Backup",)
107 process.patJetsAK8Backup.userData.userFloats.labelPostfixesToStrip = cms.vstring(
"Backup",)
108 process.patJetsAK8PuppiBackup.userData.userFloats.labelPostfixesToStrip = cms.vstring(
"Backup",)
112 if hasattr(process,
"slimmedJetsBackup"):
113 process.slimmedJetsBackup.mixedDaughters =
True
114 process.slimmedJetsBackup.packedPFCandidates = cms.InputTag(
"oldPFCandToPackedOrDiscarded")
115 process.packedPatJetsAK8Backup.fixDaughters =
False
118 process.slimmedJetsAK8Backup.rekeyDaughters =
'1'
119 process.slimmedJetsAK8Backup.mixedDaughters =
False
120 process.slimmedJetsAK8Backup.packedPFCandidates = cms.InputTag(
"packedPFCandidatesBackup")
123 if hasattr(process,
"slimmedJetsAK8PFCHSSoftDropSubjetsBackup"):
124 process.slimmedJetsAK8PFCHSSoftDropSubjetsBackup.mixedDaughters =
True
125 process.slimmedJetsAK8PFCHSSoftDropSubjetsBackup.packedPFCandidates = cms.InputTag(
"oldPFCandToPackedOrDiscarded")
129 process.slimmedJetsAK8BackupAllEvents.packedPFCandidates = cms.InpuTag(
"packedPFCandidatesBackup")
132 if hasattr(process,
"slimmedJetsPuppiBackup"):
133 process.slimmedJetsPuppiBackup.dropDaughters =
'1'
134 process.slimmedJetsAK8PFPuppiSoftDropSubjetsBackup.dropDaughters =
'1'
139 "keep *_slimmedJets_*_*",
140 [
"keep *_slimmedJetsBackup_*_*"],
143 [
"keep *_slimmedJetsPuppiBackup_*_*"],
146 "keep *_slimmedJetsAK8_*_*",
147 [
"keep *_slimmedJetsAK8Backup_*_*"],
149 addKeepStatement(process,
"keep *_slimmedJetsAK8PFCHSSoftDropPacked_SubJets_*",
150 [
"keep *_slimmedJetsAK8PFCHSSoftDropPackedBackup_SubJets_*"],
152 addKeepStatement(process,
"keep *_slimmedJetsAK8PFPuppiSoftDropPacked_SubJets_*",
153 [
"keep *_slimmedJetsAK8PFPuppiSoftDropPackedBackup_SubJets_*"],