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('HLT')
0004 
0005 process.load('FWCore.MessageService.MessageLogger_cfi')
0006 
0007 # define the Prescaler service, and set the scale factors
0008 process.PrescaleService = cms.Service('PrescaleService',
0009     prescaleTable = cms.VPSet(
0010         cms.PSet(
0011             pathName  = cms.string('Path_1'),
0012             prescales = cms.vuint32( 2 )
0013         ),
0014         cms.PSet(
0015             pathName  = cms.string('Path_2'),
0016             prescales = cms.vuint32( 3 )
0017         ),
0018         cms.PSet(
0019             pathName  = cms.string('Path_3'),
0020             prescales = cms.vuint32( 5 )
0021         )
0022     ),
0023     lvl1Labels = cms.vstring('any'),
0024     lvl1DefaultLabel = cms.string('any')
0025 )    
0026 
0027 # load conditions from the global tag
0028 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0029 from Configuration.AlCa.GlobalTag import GlobalTag
0030 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')
0031 
0032 # define an empty source, and ask for 100 events
0033 process.source = cms.Source('EmptySource')
0034 
0035 process.maxEvents = cms.untracked.PSet(
0036     input = cms.untracked.int32(1000)
0037 )
0038 
0039 # define 3 prescalers, one per path
0040 process.scale_1 = cms.EDFilter('HLTPrescaler')
0041 process.scale_2 = cms.EDFilter('HLTPrescaler')
0042 process.scale_3 = cms.EDFilter('HLTPrescaler')
0043 process.fail    = cms.EDFilter('HLTBool', result = cms.bool(False))
0044 process.success = cms.EDFilter('HLTBool', result = cms.bool(True))
0045 
0046 process.Path_1  = cms.Path(process.scale_1)
0047 process.Path_2  = cms.Path(process.scale_2)
0048 process.Path_3  = cms.Path(process.scale_3)
0049 process.AlwaysTrue    = cms.Path(process.success)
0050 process.AlwaysFalse   = cms.Path(process.fail)
0051 process.L1_Path = cms.Path(process.success)
0052 
0053 # define the TriggerResultsFilters based on the status of the previous paths
0054 from HLTrigger.HLTfilters.triggerResultsFilter_cfi import triggerResultsFilter as _triggerResultsFilter
0055 triggerResultsFilter = _triggerResultsFilter.clone( usePathStatus = True )
0056 
0057 # accept if 'Path_1' succeeds
0058 process.filter_1 = triggerResultsFilter.clone(
0059     triggerConditions =  ( 'Path_1', ),
0060     l1tResults = '',
0061     throw = False
0062 )
0063 
0064 # accept if 'Path_2' succeeds
0065 process.filter_2 = triggerResultsFilter.clone(
0066     triggerConditions = ( 'Path_2', ),
0067     l1tResults = '',
0068     throw = False
0069 )
0070 
0071 # accept if 'Path_3' succeeds
0072 process.filter_3 = triggerResultsFilter.clone(
0073     triggerConditions = ( 'Path_3', ),
0074     l1tResults = '',
0075     throw = False
0076 )
0077 
0078 # accept if any path succeeds (explicit OR)
0079 process.filter_any_or = triggerResultsFilter.clone(
0080     triggerConditions = ( 'Path_1', 'Path_2', 'Path_3' ),
0081     l1tResults = '',
0082     throw = False
0083 )
0084 
0085 # accept if 'Path_1' succeeds, prescaled by 2
0086 process.filter_1_pre = triggerResultsFilter.clone(
0087     triggerConditions =  ( '(Path_1) / 15', ),
0088     l1tResults = '',
0089     throw = False
0090 )
0091 
0092 # accept if 'Path_2' succeeds, prescaled by 10
0093 process.filter_2_pre = triggerResultsFilter.clone(
0094     triggerConditions = ( '(Path_2 / 10)', ),
0095     l1tResults = '',
0096     throw = False
0097 )
0098 
0099 # accept if any path succeeds, with different prescales (explicit OR, prescaled)
0100 process.filter_any_pre = triggerResultsFilter.clone(
0101     triggerConditions = ( 'Path_1 / 15', 'Path_2 / 10', 'Path_3 / 6', ),
0102     l1tResults = '',
0103     throw = False
0104 )
0105 
0106 # accept if any path succeeds (wildcard, '*')
0107 process.filter_any_star = triggerResultsFilter.clone(
0108     triggerConditions = ( 'Path_*', ),
0109     l1tResults = '',
0110     throw = False
0111 )
0112 
0113 # accept if any path succeeds (wildcard, '?')
0114 process.filter_any_question = triggerResultsFilter.clone(
0115     triggerConditions = ( 'Path_?', ),
0116     l1tResults = '',
0117     throw = False
0118 )
0119 
0120 # accept if any path succeeds (double wildcard, '*_?')
0121 process.filter_any_starquestion = triggerResultsFilter.clone(
0122     triggerConditions = ( '*_?', ),
0123     l1tResults = '',
0124     throw = False
0125 )
0126 
0127 # accept if all path succeed (explicit AND)
0128 process.filter_all_explicit = triggerResultsFilter.clone(
0129     triggerConditions = ( 'Path_1 AND Path_2 AND Path_3', ),
0130     l1tResults = '',
0131     throw = False
0132 )
0133 
0134 # wrong path name (explicit)
0135 process.filter_wrong_name = triggerResultsFilter.clone(
0136     triggerConditions = ( 'Wrong', ),
0137     l1tResults = '',
0138     throw = False
0139 )
0140 
0141 # wrong path name (wildcard)
0142 process.filter_wrong_pattern = triggerResultsFilter.clone(
0143     triggerConditions = ( '*_Wrong', ),
0144     l1tResults = '',
0145     throw = False
0146 )
0147 
0148 # empty path list
0149 process.filter_empty_pattern = triggerResultsFilter.clone(
0150     triggerConditions = ( ),
0151     l1tResults = '',
0152     throw = False
0153 )
0154 
0155 # L1-like path name
0156 process.filter_l1path_pattern = triggerResultsFilter.clone(
0157     triggerConditions = ( 'L1_Path', ),
0158     l1tResults = '',
0159     throw = False
0160 )
0161 
0162 # real L1 trigger
0163 process.filter_l1singlemuopen_pattern = triggerResultsFilter.clone(
0164     triggerConditions = ( 'L1_SingleMuOpen', ),
0165     l1tResults = '',
0166     throw = False
0167 )
0168 
0169 # TRUE
0170 process.filter_true_pattern = triggerResultsFilter.clone(
0171     triggerConditions = ( 'TRUE', ),
0172     l1tResults = '',
0173     throw = False
0174 )
0175 
0176 # FALSE
0177 process.filter_false_pattern = triggerResultsFilter.clone(
0178     triggerConditions = ( 'FALSE', ),
0179     l1tResults = '',
0180     throw = False
0181 )
0182 
0183 
0184 process.Check_1 = cms.Path( process.filter_1 )
0185 process.Check_2 = cms.Path( process.filter_2 )
0186 process.Check_3 = cms.Path( process.filter_3 )
0187 
0188 process.Check_All_Explicit = cms.Path( process.filter_all_explicit )
0189 
0190 process.Check_Any_Or   = cms.Path( process.filter_any_or )
0191 process.Check_Any_Star = cms.Path( process.filter_any_star )
0192 
0193 process.Check_1_Pre    = cms.Path( process.filter_1_pre )
0194 process.Check_2_Pre    = cms.Path( process.filter_2_pre )
0195 process.Check_Any_Pre  = cms.Path( process.filter_any_pre ) 
0196 
0197 process.Check_Any_Question        = cms.Path( process.filter_any_question )
0198 process.Check_Any_StarQuestion    = cms.Path( process.filter_any_starquestion )
0199 process.Check_Wrong_Name          = cms.Path( process.filter_wrong_name )
0200 process.Check_Wrong_Pattern       = cms.Path( process.filter_wrong_pattern )
0201 process.Check_Not_Wrong_Pattern   = cms.Path( ~ process.filter_wrong_pattern )
0202 process.Check_Empty_Pattern       = cms.Path( process.filter_empty_pattern )
0203 process.Check_L1Path_Pattern      = cms.Path( process.filter_l1path_pattern )
0204 process.Check_L1Singlemuopen_Pattern = cms.Path( process.filter_l1singlemuopen_pattern )
0205 process.Check_True_Pattern        = cms.Path( process.filter_true_pattern )
0206 process.Check_False_Pattern       = cms.Path( process.filter_false_pattern )
0207 
0208 # define an EndPath to analyze all other path results
0209 process.hltTrigReport = cms.EDAnalyzer( 'HLTrigReport',
0210     HLTriggerResults = cms.InputTag( 'TriggerResults', '', 'HLT' )
0211 )
0212 process.HLTAnalyzerEndpath = cms.EndPath( process.hltTrigReport )