CMS 3D CMS Logo

Functions
customizeMiniAOD_HcalFixLegacy2016 Namespace Reference

Functions

def addDiscardedPFCandidates (process, inputCollection, verbose=False)
 
def cleanPfCandidates (process, verbose=False)
 
def customizeAll (process, verbose=False)
 
def loadJetMETBTag (process)
 

Function Documentation

def customizeMiniAOD_HcalFixLegacy2016.addDiscardedPFCandidates (   process,
  inputCollection,
  verbose = False 
)

Definition at line 72 of file customizeMiniAOD_HcalFixLegacy2016.py.

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

Referenced by customizeAll().

72 def addDiscardedPFCandidates(process, inputCollection, verbose=False):
73 
74  task = getPatAlgosToolsTask(process)
75 
76  process.primaryVertexAssociationDiscardedCandidates = process.primaryVertexAssociation.clone(
77  particles = inputCollection,
78  )
79  task.add(process.primaryVertexAssociationDiscardedCandidates)
80 
81  process.packedPFCandidatesDiscarded = process.packedPFCandidates.clone(
82  inputCollection = inputCollection,
83  PuppiNoLepSrc = cms.InputTag(""),
84  PuppiSrc = cms.InputTag(""),
85  secondaryVerticesForWhiteList = cms.VInputTag(),
86  vertexAssociator = cms.InputTag("primaryVertexAssociationDiscardedCandidates","original")
87  )
88  task.add(process.packedPFCandidatesDiscarded)
89 
90  addKeepStatement(process, "keep patPackedCandidates_packedPFCandidates_*_*",
91  ["keep patPackedCandidates_packedPFCandidatesDiscarded_*_*"],
92  verbose=verbose)
93 
94 
def addKeepStatement(process, oldKeep, newKeeps, verbose=False)
Definition: helpers.py:352
def addDiscardedPFCandidates(process, inputCollection, verbose=False)
def getPatAlgosToolsTask(process)
Definition: helpers.py:12
def customizeMiniAOD_HcalFixLegacy2016.cleanPfCandidates (   process,
  verbose = False 
)

Definition at line 49 of file customizeMiniAOD_HcalFixLegacy2016.py.

References helpers.getPatAlgosToolsTask().

Referenced by customizeAll().

49 def cleanPfCandidates(process, verbose=False):
50  task = getPatAlgosToolsTask(process)
51 
52  #add producer at the beginning of the schedule
53  process.load("CommonTools.ParticleFlow.pfCandidateRecalibrator_cfi")
54  task.add(process.pfCandidateRecalibrator)
55 
56  replacePFCandidates = MassSearchReplaceAnyInputTagVisitor("particleFlow", "pfCandidateRecalibrator", verbose=verbose)
57  replacePFTmpPtrs = MassSearchReplaceAnyInputTagVisitor("particleFlowTmpPtrs", "particleFlowPtrs", verbose=verbose)
58  for everywhere in [ process.producers, process.filters, process.analyzers, process.psets, process.vpsets ]:
59  for name,obj in everywhere.iteritems():
60  if obj != process.pfCandidateRecalibrator:
61  replacePFCandidates.doIt(obj, name)
62  replacePFTmpPtrs.doIt(obj, name)
63 
64 
65  process.load("CommonTools.ParticleFlow.pfEGammaToCandidateRemapper_cfi")
66  task.add(process.pfEGammaToCandidateRemapper)
67  process.pfEGammaToCandidateRemapper.pf2pf = cms.InputTag("pfCandidateRecalibrator")
68  process.reducedEgamma.gsfElectronsPFValMap = cms.InputTag("pfEGammaToCandidateRemapper","electrons")
69  process.reducedEgamma.photonsPFValMap = cms.InputTag("pfEGammaToCandidateRemapper","photons")
70 
71 
def getPatAlgosToolsTask(process)
Definition: helpers.py:12
def customizeMiniAOD_HcalFixLegacy2016.customizeAll (   process,
  verbose = False 
)

Definition at line 95 of file customizeMiniAOD_HcalFixLegacy2016.py.

References addDiscardedPFCandidates(), cleanPfCandidates(), and loadJetMETBTag().

95 def customizeAll(process, verbose=False):
96 
97  if verbose:
98  print "===>>> customizing the process for legacy rereco 2016"
99 
100  loadJetMETBTag(process)
101 
102  cleanPfCandidates(process, verbose)
103  addDiscardedPFCandidates(process, cms.InputTag("pfCandidateRecalibrator","discarded"), verbose=verbose)
104 
105  return process
def customizeMiniAOD_HcalFixLegacy2016.loadJetMETBTag (   process)

Definition at line 6 of file customizeMiniAOD_HcalFixLegacy2016.py.

References helpers.getPatAlgosToolsTask().

Referenced by customizeAll().

6 def loadJetMETBTag(process):
7 
8  task = getPatAlgosToolsTask(process)
9 
11  process.particleFlowPtrs = RecoParticleFlow.PFProducer.pfLinker_cff.particleFlowPtrs.clone()
12  task.add(process.particleFlowPtrs)
13 
14  process.load("CommonTools.ParticleFlow.pfNoPileUpIso_cff")
15  task.add(process.pfNoPileUpIsoTask)
16  process.load("CommonTools.ParticleFlow.ParticleSelectors.pfSortByType_cff")
17  task.add(process.pfSortByTypeTask)
18 
20  process.ak4PFJetsCHS = RecoJets.Configuration.RecoPFJets_cff.ak4PFJetsCHS.clone()
21  task.add(process.ak4PFJetsCHS)
22  # need also the non-CHS ones as they are used to seed taus
23  process.ak4PFJets = RecoJets.Configuration.RecoPFJets_cff.ak4PFJets.clone()
24  task.add(process.ak4PFJets)
25  process.ak8PFJetsCHS = RecoJets.Configuration.RecoPFJets_cff.ak8PFJetsCHS.clone()
26  task.add(process.ak8PFJetsCHS)
27 
28  process.fixedGridRhoAll = RecoJets.Configuration.RecoPFJets_cff.fixedGridRhoAll.clone()
29  process.fixedGridRhoFastjetAll = RecoJets.Configuration.RecoPFJets_cff.fixedGridRhoFastjetAll.clone()
30  process.fixedGridRhoFastjetCentral = RecoJets.Configuration.RecoPFJets_cff.fixedGridRhoFastjetCentral.clone()
31  process.fixedGridRhoFastjetCentralChargedPileUp = RecoJets.Configuration.RecoPFJets_cff.fixedGridRhoFastjetCentralChargedPileUp.clone()
32  process.fixedGridRhoFastjetCentralNeutral = RecoJets.Configuration.RecoPFJets_cff.fixedGridRhoFastjetCentralNeutral.clone()
33  task.add( process.fixedGridRhoAll,
34  process.fixedGridRhoFastjetAll,
35  process.fixedGridRhoFastjetCentral,
36  process.fixedGridRhoFastjetCentralChargedPileUp,
37  process.fixedGridRhoFastjetCentralNeutral )
38 
39  process.load("RecoJets.JetAssociationProducers.ak4JTA_cff")
40  task.add(process.ak4JetTracksAssociatorAtVertexPF)
41 
42  process.load('RecoBTag.Configuration.RecoBTag_cff')
43  task.add(process.btaggingTask)
44 
45  process.load("RecoMET.METProducers.PFMET_cfi")
46  task.add(process.pfMet)
47 
48 
def getPatAlgosToolsTask(process)
Definition: helpers.py:12