Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"is not" -> "!=" in PatAlgos trigTools.py #34253

Merged
merged 3 commits into from
Jun 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions PhysicsTools/PatAlgos/python/tools/trigTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def toolCode( self, process ):
trigEvtProdMod = getattr( process, triggerEventProducer )
trigEvtProdMod.processName = hltProcess
trigEvtProdMod.patTriggerProducer = cms.InputTag( triggerProducer )
if not path is '':
if path != '':
if not hasattr( process, path ):
prodPath = cms.Path( trigProdMod + trigEvtProdMod )
setattr( process, path, prodPath )
Expand All @@ -171,7 +171,7 @@ def toolCode( self, process ):
prodPath += trigEvtProdMod

# Add event content
if outputModule is not '':
if outputModule != '':
patTriggerEventContent = [ 'keep patTriggerObjects_%s_*_%s'%( triggerProducer, process.name_() )
, 'keep patTriggerFilters_%s_*_%s'%( triggerProducer, process.name_() )
, 'keep patTriggerPaths_%s_*_%s'%( triggerProducer, process.name_() )
Expand Down Expand Up @@ -260,7 +260,7 @@ def toolCode( self, process ):
# Maintain configuration
trigProdMod = getattr( process, triggerProducer )
trigProdMod.processName = hltProcess
if not path is '':
if path != '':
if not hasattr( process, path ):
prodPath = cms.Path( trigProdMod )
setattr( process, path, prodPath )
Expand All @@ -273,7 +273,7 @@ def toolCode( self, process ):
prodPath += trigProdMod

# Add event content
if outputModule is not '':
if outputModule != '':
patTriggerEventContent = [ 'keep patTriggerObjectStandAlones_%s_*_%s'%( triggerProducer, process.name_() )
]
if ( hasattr( trigProdMod, 'saveL1Refs' ) and trigProdMod.saveL1Refs.value() is True ):
Expand Down Expand Up @@ -411,7 +411,7 @@ def toolCode( self, process ):
trigEvtProdMod.patTriggerMatches.append( cms.InputTag( matcher ) )

# Add event content
if outputModule is not '':
if outputModule != '':
patTriggerEventContent = []
for matcher in triggerMatchersKnown:
patTriggerEventContent += [ 'keep patTriggerObjectsedmAssociation_%s_%s_%s'%( triggerEventProducer, matcher, process.name_() )
Expand Down Expand Up @@ -527,7 +527,7 @@ def toolCode( self, process ):
trigMchMod.matched = triggerProducer

# Add event content
if outputModule is not '':
if outputModule != '':
patTriggerEventContent = []
for matcher in triggerMatchersKnown:
patTriggerEventContent += [ 'keep patTriggerObjectStandAlonesedmAssociation_%s_*_%s'%( matcher, process.name_() )
Expand Down Expand Up @@ -739,7 +739,7 @@ def toolCode( self, process ):
print(' Invalid input source for trigger match embedding')
print(' ==> %s with matchers \'%s\' is skipped'%( patObjProdType, dictConfig[ patObjProdType ] ))
print(_longLine)
if outputModule is not '':
if outputModule != '':
getattr( process, outputModule ).outputCommands = _addEventContent( getattr( process, outputModule ).outputCommands, patTriggerEventContent )

switchOnTriggerMatchEmbedding = SwitchOnTriggerMatchEmbedding()