1 import FWCore.ParameterSet.Config
as cms
14 jetColName=
"ak"+
str(
int(coneSize*10))+
"PFJets" 15 internalPfCandColl=pfCandCollection
18 cms.EDProducer(
"PFCandidateFwdPtrProducer",
19 src = cms.InputTag(pfCandCollection) ),
21 process.load(
"CommonTools.ParticleFlow.pfNoPileUpJME_cff")
22 task.add(process.pfNoPileUpJMETask)
24 getattr(process,
"pfPileUpJME"+postfix).PFCandidates = cms.InputTag(
"tmpPFCandCollPtr"+postfix)
25 getattr(process,
"pfNoPileUpJME"+postfix).bottomCollection = cms.InputTag(
"tmpPFCandCollPtr"+postfix)
27 internalPfCandColl =
"pfNoPileUpJME"+postfix
31 getattr(process,jetColName).
clone(
32 src = cms.InputTag(internalPfCandColl),
33 rParam=cms.double(coneSize),
34 doAreaFastjet =
True),
41 label = jetCollection.label()
43 jetCollection.clone(),
45 process.globalReplace(label,
46 cms.EDProducer(
"PFJetCollectionReducer",
47 writeEmptyCollection = cms.bool(
True),
48 jetCollection = cms.InputTag(label+
"AllEvents"),
49 triggeringCollections=badMuons,
57 label = jetCollection.label()
59 jetCollection.clone(),
61 process.globalReplace(label,
62 cms.EDProducer(
"PATJetCollectionReducer",
63 writeEmptyCollection = cms.bool(
False),
64 jetCollection = cms.InputTag(label+
"AllEvents"),
65 triggeringCollections=badMuons,
74 """Take snapshots of the sequences before we change the PFCandidates""" 75 process.originalAK4JetTask, process.originalAK4JetSequence =
listDependencyChain(process, getattr(process,
"slimmedJets"), (
'particleFlow',
'muons'))
76 backupAK4JetSequence =
cloneProcessingSnippet(process, getattr(process,
"originalAK4JetSequence"),
"Backup", addToTask =
True )
77 process.originalAK4PuppiJetTask, process.originalAK4PuppiJetSequence =
listDependencyChain(process,getattr(process,
"slimmedJetsPuppi"), (
'particleFlow',
'muons'))
78 backupAK4PuppiJetSequence =
cloneProcessingSnippet(process, getattr(process,
"originalAK4PuppiJetSequence"),
"Backup", addToTask =
True )
79 process.originalAK8JetTask,process.originalAK8JetSequence =
listDependencyChain(process, getattr(process,
"slimmedJetsAK8"), (
'particleFlow',
'muons'))
80 backupAK8JetSequence =
cloneProcessingSnippet(process, getattr(process,
"originalAK8JetSequence"),
"Backup", addToTask =
True )
82 task.add(process.originalAK4JetTask)
83 task.add(process.originalAK4PuppiJetTask)
84 task.add(process.originalAK8JetTask)
86 return {
'AK4':backupAK4JetSequence,
'AK4Puppi':backupAK4PuppiJetSequence,
'AK8':backupAK8JetSequence }
90 """Deploy the snapshots after the change of PFCandidates""" 95 for sequence
in sequences.values():
104 process.patJetsBackup.userData.userInts.labelPostfixesToStrip = cms.vstring(
"Backup",)
105 process.patJetsBackup.userData.userFloats.labelPostfixesToStrip = cms.vstring(
"Backup",)
106 process.patJetsAK8Backup.userData.userFloats.labelPostfixesToStrip = cms.vstring(
"Backup",)
107 process.patJetsAK8PuppiBackup.userData.userFloats.labelPostfixesToStrip = cms.vstring(
"Backup",)
111 if hasattr(process,
"slimmedJetsBackup"):
112 process.slimmedJetsBackup.mixedDaughters =
True 113 process.slimmedJetsBackup.packedPFCandidates = cms.InputTag(
"oldPFCandToPackedOrDiscarded")
114 process.packedPatJetsAK8Backup.fixDaughters =
False 117 process.slimmedJetsAK8Backup.rekeyDaughters =
'1' 118 process.slimmedJetsAK8Backup.mixedDaughters =
False 119 process.slimmedJetsAK8Backup.packedPFCandidates = cms.InputTag(
"packedPFCandidatesBackup")
122 if hasattr(process,
"slimmedJetsAK8PFCHSSoftDropSubjetsBackup"):
123 process.slimmedJetsAK8PFCHSSoftDropSubjetsBackup.mixedDaughters =
True 124 process.slimmedJetsAK8PFCHSSoftDropSubjetsBackup.packedPFCandidates = cms.InputTag(
"oldPFCandToPackedOrDiscarded")
128 process.slimmedJetsAK8BackupAllEvents.packedPFCandidates = cms.InpuTag(
"packedPFCandidatesBackup")
131 if hasattr(process,
"slimmedJetsPuppiBackup"):
132 process.slimmedJetsPuppiBackup.dropDaughters =
'1' 133 process.slimmedJetsAK8PFPuppiSoftDropSubjetsBackup.dropDaughters =
'1' 138 "keep *_slimmedJets_*_*",
139 [
"keep *_slimmedJetsBackup_*_*"],
142 [
"keep *_slimmedJetsPuppiBackup_*_*"],
145 "keep *_slimmedJetsAK8_*_*",
146 [
"keep *_slimmedJetsAK8Backup_*_*"],
148 addKeepStatement(process,
"keep *_slimmedJetsAK8PFCHSSoftDropPacked_SubJets_*",
149 [
"keep *_slimmedJetsAK8PFCHSSoftDropPackedBackup_SubJets_*"],
151 addKeepStatement(process,
"keep *_slimmedJetsAK8PFPuppiSoftDropPacked_SubJets_*",
152 [
"keep *_slimmedJetsAK8PFPuppiSoftDropPackedBackup_SubJets_*"],
def cloneProcessingSnippet(process, sequence, postfix, removePostfix="", noClones=[], addToTask=False, verbose=False)
def massSearchReplaceAnyInputTag(sequence, oldInputTag, newInputTag, verbose=False, moduleLabelOnly=False, skipLabelTest=False)
def addToProcessAndTask(label, module, process, task)
def addKeepStatement(process, oldKeep, newKeeps, verbose=False)
def listModules(sequence)
def listDependencyChain(process, module, sources, verbose=False)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
def getPatAlgosToolsTask(process)