Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-08 02:27:16

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 import sys
0004 import os
0005 
0006 from Configuration.Eras.Era_Run3_cff import Run3
0007 process = cms.Process("DTDQM", Run3)
0008 
0009 unitTest = False
0010 if 'unitTest=True' in sys.argv:
0011     unitTest=True
0012 
0013 #----------------------------
0014 #### Event Source
0015 #----------------------------
0016 if unitTest:
0017     process.load("DQM.Integration.config.unittestinputsource_cfi")
0018     from DQM.Integration.config.unittestinputsource_cfi import options
0019 else:
0020     # for live online DQM in P5
0021     process.load("DQM.Integration.config.inputsource_cfi")
0022     from DQM.Integration.config.inputsource_cfi import options
0023 
0024 # for testing in lxplus
0025 #process.load("DQM.Integration.config.fileinputsource_cfi")
0026 #from DQM.Integration.config.fileinputsource_cfi import options
0027 
0028 #----------------------------
0029 #### DQM Environment
0030 #----------------------------
0031 process.load("DQM.Integration.config.environment_cfi")
0032 
0033 #----------------------------
0034 #### DQM Live Environment
0035 #----------------------------
0036 process.dqmEnv.subSystemFolder = 'DT'
0037 process.dqmSaver.tag = "DT"
0038 process.dqmSaver.runNumber = options.runNumber
0039 process.dqmSaverPB.tag = "DT"
0040 process.dqmSaverPB.runNumber = options.runNumber
0041 #-----------------------------
0042 
0043 ### CUSTOMIZE FOR ML
0044 
0045 # prepare the output directory
0046 filePath = "/globalscratch/dqm4ml_" + process.dqmRunConfig.type.value()
0047 if unitTest:
0048     filePath = "./dqm4ml_" + process.dqmRunConfig.type.value()
0049 try:
0050     os.makedirs(filePath)
0051 except:
0052     pass
0053 
0054 process.dqmSaver.backupLumiCount = 10
0055 process.dqmSaver.keepBackupLumi = True
0056 
0057 process.dqmSaver.path = filePath
0058 process.dqmSaverPB.path = filePath + "/pb"
0059 
0060 # disable DQM gui
0061 print("old:",process.DQM.collectorHost)
0062 process.DQM.collectorHost = 'dqm-blackhole.cms'
0063 print("new:",process.DQM.collectorHost)
0064 ### END OF CUSTOMIZE FOR ML
0065 
0066 # DT reco and DQM sequences
0067 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0068 process.load("Configuration/StandardSequences/MagneticField_cff")
0069 process.load("DQM.DTMonitorModule.dt_dqm_sourceclient_common_cff")
0070 #---- for P5 (online) DB access
0071 process.load("DQM.Integration.config.FrontierCondition_GT_cfi")
0072 #---- for offline DB: change and possibly customise the GT
0073 #from Configuration.AlCa.GlobalTag import GlobalTag as gtCustomise
0074 #process.GlobalTag = gtCustomise(process.GlobalTag, 'auto:run2_data', '')
0075 
0076 # message logger
0077 process.MessageLogger = cms.Service("MessageLogger",
0078                                     destinations = cms.untracked.vstring('cout'),
0079                                     cout = cms.untracked.PSet(threshold = cms.untracked.string('WARNING'))
0080                                     )
0081 
0082 process.dqmmodules = cms.Sequence(process.dqmEnv + process.dqmSaver + process.dqmSaverPB)
0083 
0084 process.dtDQMPathPhys = cms.Path(process.unpackers + process.dqmmodules + process.physicsEventsFilter *  process.dtDQMPhysSequence)
0085 
0086 #process.dtDQMPathCalib = cms.Path(process.unpackers + process.dqmmodules + process.calibrationEventsFilter * process.dtDQMCalib)
0087 
0088 process.twinMuxStage2Digis.DTTM7_FED_Source = "rawDataCollector"
0089 process.dtunpacker.inputLabel = "rawDataCollector"
0090 process.gtDigis.DaqGtInputTag = "rawDataCollector"
0091 process.scalersRawToDigi.scalersInputTag = "rawDataCollector"
0092 
0093 print("Running with run type = ", process.runType.getRunType())
0094 
0095 #----------------------------
0096 #### pp run settings 
0097 #----------------------------
0098 
0099 if (process.runType.getRunType() == process.runType.pp_run):
0100     pass
0101 
0102 
0103 #----------------------------
0104 #### cosmic run settings 
0105 #----------------------------
0106 
0107 if (process.runType.getRunType() == process.runType.cosmic_run):
0108     pass
0109 
0110 
0111 #----------------------------
0112 #### HI run settings 
0113 #----------------------------
0114 
0115 if (process.runType.getRunType() == process.runType.hi_run):
0116     process.twinMuxStage2Digis.DTTM7_FED_Source = "rawDataRepacker"
0117     process.dtunpacker.inputLabel = "rawDataRepacker"
0118     process.gtDigis.DaqGtInputTag = "rawDataRepacker"
0119     process.scalersRawToDigi.scalersInputTag = "rawDataRepacker"
0120     
0121     process.dtDigiMonitor.ResetCycle = 9999
0122 
0123 
0124 
0125 ### process customizations included here
0126 from DQM.Integration.config.online_customizations_cfi import *
0127 print("Final Source settings:", process.source)
0128 process = customise(process)