Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 ## VarParsing
0004 import FWCore.ParameterSet.VarParsing as VarParsing
0005 options = VarParsing.VarParsing('analysis')
0006 options.register('logLevel', 'WARNING', options.multiplicity.singleton, options.varType.string, 'value of MessageLogger.cerr.threshold')
0007 options.register('globalTag', '131X_mcRun3_2023_realistic_forEGamma_v1', options.multiplicity.singleton, options.varType.string, 'name of GlobalTag')
0008 options.setDefault('inputFiles', [
0009   '/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/131X_mcRun3_2023_realistic_forEGamma_v1_RV209-v1/2580000/0c5f48ef-554f-478b-9b58-b7bdba0d65bb.root',
0010 ])
0011 options.setDefault('maxEvents', 25)
0012 options.parseArguments()
0013 
0014 ## Process
0015 process = cms.Process('TEST')
0016 
0017 process.options.numberOfThreads = 1
0018 process.options.numberOfStreams = 0
0019 process.options.wantSummary = False
0020 process.maxEvents.input = options.maxEvents
0021 
0022 ## Source
0023 process.source = cms.Source('PoolSource',
0024   fileNames = cms.untracked.vstring(options.inputFiles)
0025 )
0026 
0027 ## GlobalTag
0028 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0029 from Configuration.AlCa.GlobalTag import GlobalTag
0030 process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '')
0031 
0032 ## EventData Modules
0033 from HLTrigger.HLTcore.hltEventAnalyzerAOD_cfi import hltEventAnalyzerAOD as _hltEventAnalyzerAOD
0034 process.triggerEventAnalyzer = _hltEventAnalyzerAOD.clone(
0035   processName = 'HLT',
0036   triggerName = '@',
0037   triggerResults = 'TriggerResults::HLT',
0038   triggerEvent = 'hltTriggerSummaryAOD::HLT',
0039   stageL1Trigger = 2,
0040   verbose = False,
0041 )
0042 
0043 from HLTrigger.HLTcore.hltEventAnalyzerRAW_cfi import hltEventAnalyzerRAW as _hltEventAnalyzerRAW
0044 process.triggerEventWithRefsAnalyzer = _hltEventAnalyzerRAW.clone(
0045   processName = 'HLT',
0046   triggerName = '@',
0047   triggerResults = 'TriggerResults::HLT',
0048   triggerEventWithRefs = 'hltTriggerSummaryRAW::HLT',
0049   verbose = False,
0050   permissive = True,
0051 )
0052 
0053 from HLTrigger.HLTcore.triggerSummaryAnalyzerAOD_cfi import triggerSummaryAnalyzerAOD as _triggerSummaryAnalyzerAOD
0054 process.triggerEventSummaryAnalyzer = _triggerSummaryAnalyzerAOD.clone(
0055   inputTag = 'hltTriggerSummaryAOD'
0056 )
0057 
0058 from HLTrigger.HLTcore.triggerSummaryAnalyzerRAW_cfi import triggerSummaryAnalyzerRAW as _triggerSummaryAnalyzerRAW
0059 process.triggerEventWithRefsSummaryAnalyzer = _triggerSummaryAnalyzerRAW.clone(
0060   inputTag = 'hltTriggerSummaryRAW'
0061 )
0062 
0063 ## MessageLogger
0064 process.load('FWCore.MessageLogger.MessageLogger_cfi')
0065 process.MessageLogger.cerr.FwkReport.reportEvery = 1 # only report every Nth event start
0066 process.MessageLogger.cerr.FwkReport.limit = -1      # max number of reported messages (all if -1)
0067 process.MessageLogger.cerr.enableStatistics = False  # enable "MessageLogger Summary" message
0068 process.MessageLogger.cerr.threshold = options.logLevel
0069 setattr(process.MessageLogger.cerr, options.logLevel,
0070   cms.untracked.PSet(
0071     reportEvery = cms.untracked.int32(1), # every event!
0072     limit = cms.untracked.int32(-1)       # no limit! (default is limit=0, i.e. no messages reported)
0073   )
0074 )
0075 process.MessageLogger.HLTEventAnalyzerAOD = dict()
0076 process.MessageLogger.HLTEventAnalyzerRAW = dict()
0077 process.MessageLogger.TriggerSummaryAnalyzerAOD = dict()
0078 process.MessageLogger.TriggerSummaryAnalyzerRAW = dict()
0079 
0080 ## Path
0081 process.triggerEventAnalysisPath = cms.Path(
0082     process.triggerEventAnalyzer
0083   + process.triggerEventSummaryAnalyzer
0084   + process.triggerEventWithRefsAnalyzer
0085   + process.triggerEventWithRefsSummaryAnalyzer
0086 )