Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 def addService(process, multirun=False):
0004     # remove any instance of the FastTimerService
0005     if 'FastTimerService' in process.__dict__:
0006         del process.FastTimerService
0007 
0008     # instrument the menu with the FastTimerService
0009     process.load("HLTrigger.Timer.FastTimerService_cfi")
0010 
0011     # print a text summary at the end of the job
0012     process.FastTimerService.printEventSummary        = False
0013     process.FastTimerService.printRunSummary          = False
0014     process.FastTimerService.printJobSummary          = True
0015 
0016     # enable DQM plots
0017     process.FastTimerService.enableDQM                = True
0018 
0019     # enable per-path DQM plots (starting with CMSSW 9.2.3-patch2)
0020     process.FastTimerService.enableDQMbyPath          = True
0021 
0022     # enable per-module DQM plots
0023     process.FastTimerService.enableDQMbyModule        = True
0024 
0025     # enable DQM plots vs lumisection
0026     process.FastTimerService.enableDQMbyLumiSection   = True
0027     process.FastTimerService.dqmLumiSectionsRange     = 2500    # lumisections (23.31 s)
0028 
0029     # set the time resolution of the DQM plots
0030     process.FastTimerService.dqmTimeRange             = 1000.   # ms
0031     process.FastTimerService.dqmTimeResolution        =    5.   # ms
0032     process.FastTimerService.dqmPathTimeRange         =  100.   # ms
0033     process.FastTimerService.dqmPathTimeResolution    =    0.5  # ms
0034     process.FastTimerService.dqmModuleTimeRange       =   40.   # ms
0035     process.FastTimerService.dqmModuleTimeResolution  =    0.2  # ms
0036 
0037     # set the base DQM folder for the plots
0038     process.FastTimerService.dqmPath                  = "HLT/TimerService"
0039     process.FastTimerService.enableDQMbyProcesses     = False
0040 
0041     if multirun:
0042         # disable the per-lumisection plots
0043         process.FastTimerService.enableDQMbyLumiSection = False
0044 
0045     return process
0046 
0047 def addOutput(process):
0048     # save the DQM plots in the DQMIO format
0049     process.dqmOutput = cms.OutputModule("DQMRootOutputModule",
0050         fileName = cms.untracked.string("DQM.root")
0051     )
0052     process.FastTimerOutput = cms.EndPath(process.dqmOutput)
0053     process.schedule.append(process.FastTimerOutput)
0054 
0055     return process
0056 
0057 def addPrint(process):
0058     # enable text dump
0059     if not hasattr(process,'MessageLogger'):
0060         process.load('FWCore.MessageService.MessageLogger_cfi')
0061     process.MessageLogger.cerr.FastReport = cms.untracked.PSet( limit = cms.untracked.int32( 10000000 ) )
0062     return process
0063 
0064 def addHarvest(process):
0065     # DQMStore service
0066     if not hasattr(process,'DQMStore'):
0067         process.load('DQMServices.Core.DQMStore_cfi')
0068 
0069     # FastTimerService client
0070     process.load('HLTrigger.Timer.fastTimerServiceClient_cfi')
0071     process.fastTimerServiceClient.dqmPath = "HLT/TimerService"
0072 
0073     # DQM file saver
0074     process.load('DQMServices.Components.DQMFileSaver_cfi')
0075     process.dqmSaver.workflow = "/HLT/FastTimerService/All"
0076 
0077     process.DQMFileSaverOutput = cms.EndPath(process.fastTimerServiceClient + process.dqmSaver)
0078     process.schedule.append(process.DQMFileSaverOutput)
0079 
0080     return process
0081 
0082 # customise functions for cmsDriver
0083 
0084 def customise_timer_service(process):
0085     process = addService(process)
0086     process = addOutput(process)
0087     return process
0088 
0089 def customise_timer_service_singlejob(process):
0090     process = addService(process)
0091     process = addHarvest(process)
0092     return process
0093 
0094 def customise_timer_service_multirun(process):
0095     process = addService(process,True)
0096     process = addOutput(process)
0097     return process
0098 
0099 def customise_timer_service_print(process):
0100     process = addService(process)
0101     process = addPrint(process)
0102     return process
0103