Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-01-24 01:14:43

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process('TEST')
0004 
0005 process.options = cms.untracked.PSet(
0006     wantSummary = cms.untracked.bool(True)
0007 )
0008 process.load('FWCore.MessageService.MessageLogger_cfi')
0009 #process.MessageLogger.cerr.INFO = cms.untracked.PSet(
0010 #    reportEvery = cms.untracked.int32(1), # every!
0011 #    limit = cms.untracked.int32(-1)       # no limit!
0012 #    )
0013 #process.MessageLogger.cerr.FwkReport.reportEvery = 10 # only report every 10th event start
0014 #process.MessageLogger.cerr_stats.threshold = 'INFO' # also info in statistics
0015 
0016 # load conditions from the global tag
0017 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0018 from Configuration.AlCa.GlobalTag import GlobalTag
0019 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')
0020 
0021 # read back the trigger decisions
0022 process.source = cms.Source('PoolSource',
0023     fileNames = cms.untracked.vstring('file:trigger.root')
0024 )
0025 
0026 from HLTrigger.HLTfilters.triggerResultsFilter_cfi import triggerResultsFilter
0027 
0028 # accept if 'Path_1' succeeds
0029 process.filter_1 = triggerResultsFilter.clone(
0030     triggerConditions =  ( 'Path_1', ),
0031     l1tResults = '',
0032     throw = False
0033     )
0034 
0035 # accept if 'Path_2' succeeds
0036 process.filter_2 = triggerResultsFilter.clone(
0037     triggerConditions = ( 'Path_2', ),
0038     l1tResults = '',
0039     throw = False
0040     )
0041 
0042 # accept if 'Path_3' succeeds
0043 process.filter_3 = triggerResultsFilter.clone(
0044     triggerConditions = ( 'Path_3', ),
0045     l1tResults = '',
0046     throw = False
0047     )
0048 
0049 # accept if any path succeeds (explicit OR)
0050 process.filter_any_or = triggerResultsFilter.clone(
0051     triggerConditions = ( 'Path_1', 'Path_2', 'Path_3' ),
0052     l1tResults = '',
0053     throw = False
0054     )
0055 
0056 # accept if 'Path_1' succeeds, prescaled by 2
0057 process.filter_1_pre = triggerResultsFilter.clone(
0058     triggerConditions =  ( '(Path_1) / 15', ),
0059     l1tResults = '',
0060     throw = False
0061     )
0062 
0063 # accept if 'Path_2' succeeds, prescaled by 10
0064 process.filter_2_pre = triggerResultsFilter.clone(
0065     triggerConditions = ( '(Path_2 / 10)', ),
0066     l1tResults = '',
0067     throw = False
0068     )
0069 
0070 # accept if any path succeeds, with different prescales (explicit OR, prescaled)
0071 process.filter_any_pre = triggerResultsFilter.clone(
0072     triggerConditions = ( 'Path_1 / 15', 'Path_2 / 10', 'Path_3 / 6', ),
0073     l1tResults = '',
0074     throw = False
0075     )
0076 
0077 # accept if any path succeeds (wildcard, '*')
0078 process.filter_any_star = triggerResultsFilter.clone(
0079     triggerConditions = ( '*', ),
0080     l1tResults = '',
0081     throw = False
0082     )
0083 
0084 # accept if any path succeeds (wildcard, twice '*')
0085 process.filter_any_doublestar = triggerResultsFilter.clone(
0086     triggerConditions = ( '*_*', ),
0087     l1tResults = '',
0088     throw = False
0089     )
0090 
0091 
0092 # accept if any path succeeds (wildcard, '?')
0093 process.filter_any_question = triggerResultsFilter.clone(
0094     triggerConditions = ( 'Path_?', ),
0095     l1tResults = '',
0096     throw = False
0097     )
0098 
0099 # accept if all path succeed (explicit AND)
0100 process.filter_all_explicit = triggerResultsFilter.clone(
0101     triggerConditions = ( 'Path_1 AND Path_2 AND Path_3', ),
0102     l1tResults = '',
0103     throw = False
0104 )
0105 
0106 # wrong path name (explicit)
0107 process.filter_wrong_name = triggerResultsFilter.clone(
0108     triggerConditions = ( 'Wrong', ),
0109     l1tResults = '',
0110     throw = False
0111 )
0112 
0113 # wrong path name (wildcard)
0114 process.filter_wrong_pattern = triggerResultsFilter.clone(
0115     triggerConditions = ( '*_Wrong', ),
0116     l1tResults = '',
0117     throw = False
0118 )
0119 
0120 # empty path list
0121 process.filter_empty_pattern = triggerResultsFilter.clone(
0122     triggerConditions = ( ),
0123     l1tResults = '',
0124     throw = False
0125 )
0126 
0127 # L1-like path name
0128 process.filter_l1path_pattern = triggerResultsFilter.clone(
0129     triggerConditions = ( 'L1_Path', ),
0130     l1tResults = '',
0131     throw = False
0132 )
0133 
0134 # real L1 trigger
0135 process.filter_l1singlemuopen_pattern = triggerResultsFilter.clone(
0136     triggerConditions = ( 'L1_SingleMuOpen', ),
0137     l1tResults = '',
0138     throw = False
0139 )
0140 
0141 # TRUE
0142 process.filter_true_pattern = triggerResultsFilter.clone(
0143     triggerConditions = ( 'TRUE', ),
0144     l1tResults = '',
0145     throw = False
0146 )
0147 
0148 # FALSE
0149 process.filter_false_pattern = triggerResultsFilter.clone(
0150     triggerConditions = ( 'FALSE', ),
0151     l1tResults = '',
0152     throw = False
0153 )
0154 
0155 
0156 process.path_1 = cms.Path( process.filter_1 )
0157 process.path_2 = cms.Path( process.filter_2 )
0158 process.path_3 = cms.Path( process.filter_3 )
0159 
0160 process.path_all_explicit = cms.Path( process.filter_all_explicit )
0161 
0162 process.path_any_or   = cms.Path( process.filter_any_or )
0163 process.path_any_star = cms.Path( process.filter_any_star )
0164 
0165 process.path_1_pre    = cms.Path( process.filter_1_pre )
0166 process.path_2_pre    = cms.Path( process.filter_2_pre )
0167 process.path_any_pre  = cms.Path( process.filter_any_pre ) 
0168 
0169 process.path_any_doublestar      = cms.Path( process.filter_any_doublestar )
0170 process.path_any_question        = cms.Path( process.filter_any_question )
0171 process.path_wrong_name          = cms.Path( process.filter_wrong_name )
0172 process.path_wrong_pattern       = cms.Path( process.filter_wrong_pattern )
0173 process.path_not_wrong_pattern   = cms.Path( ~ process.filter_wrong_pattern )
0174 process.path_empty_pattern       = cms.Path( process.filter_empty_pattern )
0175 process.path_l1path_pattern      = cms.Path( process.filter_l1path_pattern )
0176 process.path_l1singlemuopen_pattern = cms.Path( process.filter_l1singlemuopen_pattern )
0177 process.path_true_pattern        = cms.Path( process.filter_true_pattern )
0178 process.path_false_pattern       = cms.Path( process.filter_false_pattern )
0179 
0180 # define an EndPath to analyze all other path results
0181 process.hltTrigReport = cms.EDAnalyzer( 'HLTrigReport',
0182     HLTriggerResults = cms.InputTag( 'TriggerResults', '', 'TEST' )
0183 )
0184 process.HLTAnalyzerEndpath = cms.EndPath( process.hltTrigReport )