Skip to content

Commit

Permalink
more robust handling of IVF modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ferencek committed Mar 30, 2015
1 parent 6956cbf commit 4ac6b11
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions PhysicsTools/PatAlgos/python/tools/jetTools.py
Expand Up @@ -392,27 +392,15 @@ def toolCode(self, process):
requiredTagInfos.append(requiredTagInfo)
## load sequences and setups needed for btagging
## This loads all available btagger, but the ones we need are added to the process by hand later. Only needed to get the ESProducer. Needs improvement
#loadWithPostFix(process,"RecoBTag.Configuration.RecoBTag_cff",postfix)
if hasattr( process, 'candidateJetProbabilityComputer' ) == False :
process.load("RecoBTag.Configuration.RecoBTag_cff")
#process.load("RecoBTag.Configuration.RecoBTag_cff") # commented out to prevent loading of IVF modules already run in the standard reconstruction. Instead, loading individual cffs from RecoBTag_cff
process.load("RecoBTag.ImpactParameter.impactParameter_cff")
process.load("RecoBTag.SecondaryVertex.secondaryVertex_cff")
process.load("RecoBTag.SoftLepton.softLepton_cff")
process.load("RecoBTau.JetTagComputer.combinedMVA_cff")
#addESProducers(process,'RecoBTag.Configuration.RecoBTag_cff')
import RecoBTag.Configuration.RecoBTag_cff as btag
import RecoJets.JetProducers.caTopTaggers_cff as toptag
## Unload IVF modules already run in the standard reconstruction (to prevent them from re-running in the unscheduled mode)
if not runIVF and process._Process__name!='RECO' and hasattr( process, 'bVertexFilter' ): # condition preventing removal of IVF modules in the standard reconstruction or if required by other jet collections
if hasattr( process, 'inclusiveCandidateVertexing' ):
for m in getattr( process, 'inclusiveCandidateVertexing' ).moduleNames():
if hasattr( process, m ):
delattr( process, m )
delattr( process, 'inclusiveCandidateVertexing' )
if hasattr( process, 'inclusiveVertexing' ):
for m in getattr( process, 'inclusiveVertexing' ).moduleNames():
if hasattr( process, m ):
delattr( process, m )
delattr( process, 'inclusiveVertexing' )
## the following module is never used explicitly but here it is used to distinguish the first from the subsequent calls to switchJetCollection()/addJetCollection()
if hasattr( process, 'bVertexFilter' ):
delattr( process, 'bVertexFilter' )

## setup all required btagInfos : we give a dedicated treatment for different
## types of tagInfos here. A common treatment is possible but might require a more
Expand Down

0 comments on commit 4ac6b11

Please sign in to comment.