Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:18:30

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process('TEST')
0004 
0005 process.options.wantSummary = True
0006 
0007 process.load('FWCore.MessageService.MessageLogger_cfi')
0008 process.MessageLogger.cerr.FwkReport.reportEvery = 100 # only report every 100th event start
0009 process.MessageLogger.cerr.enableStatistics = False # enable "MessageLogger Summary" message
0010 process.MessageLogger.cerr.threshold = 'INFO' # change to 'WARNING' not to show INFO-level messages
0011 ## enable reporting of INFO-level messages (default is limit=0, i.e. no messages reported)
0012 #process.MessageLogger.cerr.INFO = cms.untracked.PSet(
0013 #    reportEvery = cms.untracked.int32(1), # every event!
0014 #    limit = cms.untracked.int32(-1)       # no limit!
0015 #)
0016 
0017 # read back the trigger decisions
0018 process.source = cms.Source('PoolSource',
0019     fileNames = cms.untracked.vstring('file:trigger.root')
0020 )
0021 
0022 from HLTrigger.HLTfilters.triggerResultsFilter_cfi import triggerResultsFilter as _trigResFilter
0023 _triggerResultsFilter = _trigResFilter.clone( l1tResults = '' )
0024 
0025 # accept if 'Path_1' succeeds
0026 process.filter_1 = _triggerResultsFilter.clone(
0027     triggerConditions =  ( 'Path_1', )
0028 )
0029 
0030 # accept if 'Path_2' succeeds
0031 process.filter_2 = _triggerResultsFilter.clone(
0032     triggerConditions = ( 'Path_2', )
0033 )
0034 
0035 # accept if 'Path_3' succeeds
0036 process.filter_3 = _triggerResultsFilter.clone(
0037     triggerConditions = ( 'Path_3', )
0038 )
0039 
0040 # accept if any path succeeds (explicit OR)
0041 process.filter_any_or = _triggerResultsFilter.clone(
0042     triggerConditions = ( 'Path_1', 'Path_2', 'Path_3' )
0043 )
0044 
0045 # accept if 'Path_1' succeeds, prescaled by 15
0046 process.filter_1_pre = _triggerResultsFilter.clone(
0047     triggerConditions =  ( '(Path_1) / 15', )
0048 )
0049 
0050 # accept if 'Path_1' succeeds, prescaled by 15
0051 # masking Path_2 (equivalent to filter_1_pre)
0052 process.filter_1_pre_with_masks1 = _triggerResultsFilter.clone(
0053     triggerConditions =  ( '(Path_1 / 15 OR Path_2) MASKING Path_2', )
0054 )
0055 
0056 # accept if 'Path_1' succeeds, prescaled by 15
0057 # masking Path_2 and Path_3 (equivalent to filter_1_pre)
0058 process.filter_1_pre_with_masks2 = _triggerResultsFilter.clone(
0059     triggerConditions =  ( '(Path_? / 15) MASKING Path_2 MASKING Path_3', )
0060 )
0061 
0062 # accept if 'Path_1' prescaled by 15 does not succeed
0063 process.filter_not_1_pre = _triggerResultsFilter.clone(
0064     triggerConditions =  ( 'NOT (Path_1 / 15)', )
0065 )
0066 
0067 # accept if 'Path_2' succeeds, prescaled by 10
0068 process.filter_2_pre = _triggerResultsFilter.clone(
0069     triggerConditions = ( '(Path_2 / 10)', )
0070 )
0071 
0072 # accept if any path succeeds, with different prescales (explicit OR, prescaled)
0073 process.filter_any_pre = _triggerResultsFilter.clone(
0074     triggerConditions = ( 'Path_1 / 15', 'Path_2 / 10', 'Path_3 / 6', )
0075 )
0076 
0077 # equivalent of filter_any_pre using NOT operator twice
0078 process.filter_any_pre_doubleNOT = _triggerResultsFilter.clone(
0079     triggerConditions = ( 'NOT NOT (Path_1 / 15 OR Path_2 / 10 OR Path_3 / 6)', )
0080 )
0081 
0082 # opposite of filter_any_pre without whitespaces where possible
0083 process.filter_not_any_pre = _triggerResultsFilter.clone(
0084     triggerConditions = ( 'NOT(Path_1/15)AND(NOT Path_2/10)AND(NOT Path_3/6)', )
0085 )
0086 
0087 # accept if Path_1 and Path_2 have different results (XOR) without using XOR operator
0088 process.filter_1xor2_withoutXOR = _triggerResultsFilter.clone(
0089     triggerConditions = ( 'Path_1 AND NOT Path_2', 'NOT Path_1 AND Path_2', )
0090 )
0091 
0092 # accept if Path_1 and Path_2 have different results (XOR) using XOR operator
0093 process.filter_1xor2_withXOR = _triggerResultsFilter.clone(
0094     triggerConditions = ( 'Path_1 XOR Path_2', )
0095 )
0096 
0097 # accept if any path succeeds (wildcard, '*')
0098 process.filter_any_star = _triggerResultsFilter.clone(
0099     triggerConditions = ( '*', )
0100 )
0101 
0102 # accept if any path succeeds (wildcard, twice '*')
0103 process.filter_any_doublestar = _triggerResultsFilter.clone(
0104     triggerConditions = ( '*_*', )
0105 )
0106 
0107 # accept if any path succeeds (wildcard, '?')
0108 process.filter_any_question = _triggerResultsFilter.clone(
0109     triggerConditions = ( 'Path_?', )
0110 )
0111 
0112 # accept if all path succeed (explicit AND)
0113 process.filter_all_explicit = _triggerResultsFilter.clone(
0114     triggerConditions = ( 'Path_1 AND Path_2 AND Path_3', )
0115 )
0116 
0117 # wrong path name (explicit)
0118 process.filter_wrong_name = _triggerResultsFilter.clone(
0119     triggerConditions = ( 'Wrong', ),
0120     throw = False
0121 )
0122 
0123 # wrong path name (wildcard)
0124 process.filter_wrong_pattern = _triggerResultsFilter.clone(
0125     triggerConditions = ( '*_Wrong', ),
0126     throw = False
0127 )
0128 
0129 # empty path list
0130 process.filter_empty_pattern = _triggerResultsFilter.clone(
0131     triggerConditions = ( )
0132 )
0133 
0134 # L1-like path name
0135 process.filter_l1path_pattern = _triggerResultsFilter.clone(
0136     # this returns False for every event without throwing exceptions,
0137     # because here l1tResults is an empty InputTag
0138     # (patterns starting with "L1_" are used exclusively to check the L1-Trigger decisions)
0139     triggerConditions = ( 'L1_Path', )
0140 )
0141 
0142 # real L1 trigger
0143 process.filter_l1singlemuopen_pattern = _triggerResultsFilter.clone(
0144     # this returns False for every event without throwing exceptions,
0145     # because here l1tResults is an empty InputTag
0146     # (patterns starting with "L1_" are used exclusively to check the L1-Trigger decisions)
0147     triggerConditions = ( 'L1_SingleMuOpen', )
0148 )
0149 
0150 # TRUE
0151 process.filter_true_pattern = _triggerResultsFilter.clone(
0152     triggerConditions = ( 'TRUE', )
0153 )
0154 
0155 # FALSE
0156 process.filter_false_pattern = _triggerResultsFilter.clone(
0157     triggerConditions = ( 'FALSE', )
0158 )
0159 
0160 
0161 process.path_1 = cms.Path( process.filter_1 )
0162 process.path_2 = cms.Path( process.filter_2 )
0163 process.path_3 = cms.Path( process.filter_3 )
0164 
0165 process.path_all_explicit = cms.Path( process.filter_all_explicit )
0166 
0167 process.path_any_or   = cms.Path( process.filter_any_or )
0168 process.path_any_star = cms.Path( process.filter_any_star )
0169 
0170 process.path_1_pre             = cms.Path( process.filter_1_pre )
0171 process.path_1_pre_with_masks1 = cms.Path( process.filter_1_pre_with_masks1 )
0172 process.path_1_pre_with_masks2 = cms.Path( process.filter_1_pre_with_masks2 )
0173 process.path_not_1_pre         = cms.Path( process.filter_not_1_pre )
0174 process.path_2_pre             = cms.Path( process.filter_2_pre )
0175 process.path_any_pre           = cms.Path( process.filter_any_pre )
0176 process.path_any_pre_doubleNOT = cms.Path( process.filter_any_pre_doubleNOT )
0177 process.path_not_any_pre       = cms.Path( process.filter_not_any_pre )
0178 process.Check_1xor2_withoutXOR = cms.Path( process.filter_1xor2_withoutXOR )
0179 process.Check_1xor2_withXOR    = cms.Path( process.filter_1xor2_withXOR )
0180 
0181 process.path_any_doublestar      = cms.Path( process.filter_any_doublestar )
0182 process.path_any_question        = cms.Path( process.filter_any_question )
0183 process.path_wrong_name          = cms.Path( process.filter_wrong_name )
0184 process.path_wrong_pattern       = cms.Path( process.filter_wrong_pattern )
0185 process.path_not_wrong_pattern   = cms.Path( ~ process.filter_wrong_pattern )
0186 process.path_empty_pattern       = cms.Path( process.filter_empty_pattern )
0187 process.path_l1path_pattern      = cms.Path( process.filter_l1path_pattern )
0188 process.path_l1singlemuopen_pattern = cms.Path( process.filter_l1singlemuopen_pattern )
0189 process.path_true_pattern        = cms.Path( process.filter_true_pattern )
0190 process.path_false_pattern       = cms.Path( process.filter_false_pattern )
0191 
0192 # define an EndPath to analyze all other path results
0193 process.hltTrigReport = cms.EDAnalyzer( 'HLTrigReport',
0194     HLTriggerResults = cms.InputTag( 'TriggerResults', '', '@currentProcess' )
0195 )
0196 process.HLTAnalyzerEndpath = cms.EndPath( process.hltTrigReport )