1 |
import FWCore.ParameterSet.Config as cms
|
2 |
|
3 |
def switchOffTriggerMatchingOld( process ):
|
4 |
""" Disables old style trigger matching in PAT """
|
5 |
process.allLayer1Electrons.addTrigMatch = False
|
6 |
process.allLayer1Muons.addTrigMatch = False
|
7 |
process.allLayer1Jets.addTrigMatch = False
|
8 |
process.allLayer1Photons.addTrigMatch = False
|
9 |
process.allLayer1Taus.addTrigMatch = False
|
10 |
process.layer1METs.addTrigMatch = False
|
11 |
# process.patDefaultSequence.remove( process.patTrigMatch )
|
12 |
|
13 |
# for (temporary) backwards compatibility
|
14 |
def switchTriggerOff( process ):
|
15 |
switchOffTriggerMatchingOld( process )
|
16 |
|
17 |
from PhysicsTools.PatAlgos.patEventContent_cff import *
|
18 |
|
19 |
def switchOnTrigger( process ):
|
20 |
""" Enables trigger information in PAT """
|
21 |
process.patTrigger.onlyStandAlone = False
|
22 |
# add trigger modules to path
|
23 |
process.p *= process.patTriggerSequence
|
24 |
# add trigger specific event content to PAT event content
|
25 |
process.out.outputCommands += patTriggerEventContent
|
26 |
for matchLabel in process.patTriggerEvent.patTriggerMatches:
|
27 |
process.out.outputCommands += [ 'keep patTriggerObjectsedmAssociation_patTriggerEvent_' + matchLabel + '_*' ]
|
28 |
|
29 |
def switchOnTriggerStandAlone( process ):
|
30 |
process.patTrigger.onlyStandAlone = True
|
31 |
process.patTriggerSequence.remove( process.patTriggerEvent )
|
32 |
process.p *= process.patTriggerSequence
|
33 |
process.out.outputCommands += patTriggerStandAloneEventContent
|
34 |
|
35 |
def switchOnTriggerAll( process ):
|
36 |
switchOnTrigger( process )
|
37 |
process.out.outputCommands += patTriggerStandAloneEventContent
|
38 |
|
39 |
def switchOnTriggerMatchEmbedding( process ):
|
40 |
process.patTriggerSequence += process.patTriggerMatchEmbedder
|
41 |
process.out.outputCommands += patEventContentTriggerMatch
|