Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-03 00:58:52

0001 from __future__ import print_function
0002 
0003 import sys
0004 import FWCore.ParameterSet.Config as cms
0005 
0006 ## Use RECO Muons flag
0007 useMuons = False
0008 isOfflineDQM = False
0009 
0010 unitTest = False
0011 if 'unitTest=True' in sys.argv:
0012     unitTest=True
0013 
0014 from Configuration.Eras.Era_Run3_cff import Run3
0015 process = cms.Process("RPCDQM", Run3)
0016 
0017 ############## Event Source #####################
0018 
0019 if unitTest:
0020     process.load("DQM.Integration.config.unittestinputsource_cfi")
0021     from DQM.Integration.config.unittestinputsource_cfi import options
0022 else:
0023     # for live online DQM in P5
0024     process.load("DQM.Integration.config.inputsource_cfi")
0025     from DQM.Integration.config.inputsource_cfi import options
0026 
0027 # for testing in lxplus
0028 #process.load("DQM.Integration.config.fileinputsource_cfi")
0029 #from DQM.Integration.config.fileinputsource_cfi import options
0030 
0031 ############### HLT Filter#######################
0032 # 0=random, 1=physics, 2=calibration, 3=technical
0033 process.hltTriggerTypeFilter = cms.EDFilter("HLTTriggerTypeFilter",
0034     SelectedTriggerType = cms.int32(1)
0035 )
0036 
0037 ################# Geometry  #####################
0038 #process.load("Geometry.MuonCommonData.muonIdealGeometryXML_cfi")
0039 #process.load("Geometry.RPCGeometry.rpcGeometry_cfi")
0040 #process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
0041 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0042 ################ Condition ######################
0043 # Condition for P5 cluster
0044 process.load("DQM.Integration.config.FrontierCondition_GT_cfi")
0045 # Condition for lxplus: change and possibly customise the GT
0046 #process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0047 #from Configuration.AlCa.GlobalTag import GlobalTag as gtCustomise
0048 #process.GlobalTag = gtCustomise(process.GlobalTag, 'auto:run2_data', '')
0049 #process.GlobalTag.globaltag = "102X_dataRun2_Express_v4"
0050 process.GlobalTag.RefreshEachRun = True
0051 
0052 ############# DQM Cetral Modules ################
0053 #process.load("DQMServices.Core.DQM_cfg")
0054 
0055 ############## DQM Enviroment ###################
0056 process.load("DQM.Integration.config.environment_cfi")
0057 process.dqmEnv.subSystemFolder = 'RPC'
0058 process.dqmSaver.tag = 'RPC'
0059 process.dqmSaver.runNumber = options.runNumber
0060 process.dqmSaverPB.tag = 'RPC'
0061 process.dqmSaverPB.runNumber = options.runNumber
0062 
0063 
0064 ############### Scaler Producer #################
0065 process.load("EventFilter.ScalersRawToDigi.ScalersRawToDigi_cfi")
0066 
0067 ############## RPC Unpacker  ####################
0068 process.rpcunpacker = cms.EDProducer("RPCUnpackingModule",
0069     InputLabel = cms.InputTag("source"),
0070     doSynchro = cms.bool(False)
0071 )
0072 
0073 ### RPC RawToDigi - from TwinMux
0074 process.load("EventFilter.RPCRawToDigi.RPCTwinMuxRawToDigi_cff")
0075 
0076 ### RPC RawToDigi - from CPPF
0077 process.load("EventFilter.RPCRawToDigi.RPCCPPFRawToDigi_cff")
0078 # process.load("EventFilter.RPCRawToDigi.RPCCPPFRawToDigi_sqlite_cff") #to load CPPF link maps from the local DB
0079 
0080 ### RPC RawToDigi - from OMTF
0081 process.omtfStage2Digis = cms.EDProducer("OmtfUnpacker",
0082   inputLabel = cms.InputTag('rawDataCollector'),
0083 )
0084 
0085 process.load("EventFilter.RPCRawToDigi.RPCDigiMerger_cff")
0086 process.rpcDigiMerger.inputTagTwinMuxDigis = 'rpcTwinMuxRawToDigi'
0087 process.rpcDigiMerger.inputTagOMTFDigis = 'omtfStage2Digis'
0088 process.rpcDigiMerger.inputTagCPPFDigis = 'rpcCPPFRawToDigi'
0089 
0090 ################# RPC Rec Hits  #################
0091 process.load("RecoLocalMuon.RPCRecHit.rpcRecHits_cfi")
0092 process.rpcRecHits.rpcDigiLabel = 'rpcunpacker'
0093 #######################################################
0094 ### RPCRecHit - from Merger
0095 process.rpcMergerRecHits = process.rpcRecHits.clone(
0096   rpcDigiLabel = 'rpcDigiMerger'
0097 )
0098 
0099 ################ DQM Digi Module ################
0100 ### DQM - from legacy
0101 process.load("DQM.RPCMonitorDigi.RPCDigiMonitoring_cfi")
0102 process.rpcdigidqm.UseMuon =  useMuons
0103 process.rpcdigidqm.NoiseFolder = "AllHitsLegacy"
0104 process.rpcdigidqm.RecHitLabel = "rpcRecHits"
0105 ### DQM - from Merger
0106 process.rpcMergerdigidqm = process.rpcdigidqm.clone(
0107   NoiseFolder = "AllHits",
0108   RecHitLabel = "rpcMergerRecHits"
0109 )
0110 
0111 #######################################################
0112 
0113 ################# DQM Client Modules ############
0114 process.load("DQM.RPCMonitorClient.RPCDqmClient_cfi")
0115 process.rpcdqmclient.RPCDqmClientList = ["RPCMultiplicityTest", "RPCDeadChannelTest", "RPCClusterSizeTest", "RPCOccupancyTest","RPCNoisyStripTest"]
0116 process.rpcdqmclient.DiagnosticPrescale = 1
0117 process.rpcdqmclient.MinimumRPCEvents  = 100
0118 process.rpcdqmclient.OfflineDQM = isOfflineDQM
0119 process.rpcdqmclient.RecHitTypeFolder = "AllHitsLegacy"
0120 ### Merger
0121 process.rpcMergerdqmclient = process.rpcdqmclient.clone(
0122   RecHitTypeFolder = "AllHits"
0123 )
0124 ################# Other Clients #################
0125 #process.load("DQM.RPCMonitorClient.RPCMon_SS_Dbx_Global_cfi")
0126 
0127 ################### FED #########################
0128 process.load("DQM.RPCMonitorClient.RPCMonitorRaw_cfi")
0129 process.load("DQM.RPCMonitorClient.RPCFEDIntegrity_cfi")
0130 process.load("DQM.RPCMonitorClient.RPCMonitorLinkSynchro_cfi")
0131 
0132 ########### RPC Event Summary Module ############
0133 process.load("DQM.RPCMonitorClient.RPCEventSummary_cfi")
0134 process.rpcEventSummary.OfflineDQM = isOfflineDQM 
0135 process.rpcEventSummary.MinimumRPCEvents  = 10000
0136 process.rpcEventSummary.RecHitTypeFolder = "AllHitsLegacy"
0137 ### Merger
0138 process.rpcEventSummaryMerger = process.rpcEventSummary.clone(
0139    RecHitTypeFolder = "AllHits"
0140 )
0141 
0142 ################# Quality Tests #################
0143 from DQMServices.Core.DQMQualityTester import DQMQualityTester
0144 process.qTesterRPC = DQMQualityTester(
0145     qtList = cms.untracked.FileInPath('DQM/RPCMonitorClient/test/RPCQualityTests.xml'),
0146     prescaleFactor = cms.untracked.int32(5),
0147     qtestOnEndLumi = cms.untracked.bool(True),
0148     qtestOnEndRun = cms.untracked.bool(True)
0149 )
0150 
0151 ###############  Sequences ######################
0152 process.rpcSource = cms.Sequence( process.rpcunpacker
0153                       * (process.rpcTwinMuxRawToDigi + process.rpcCPPFRawToDigi + process.omtfStage2Digis) 
0154                       * process.rpcDigiMerger 
0155                       * (process.rpcRecHits + process.rpcMergerRecHits)
0156                       * process.scalersRawToDigi
0157                       * (process.rpcdigidqm + process.rpcMergerdigidqm)
0158                       * process.rpcMonitorRaw*process.qTesterRPC
0159                     )
0160 process.rpcClient = cms.Sequence(process.rpcdqmclient*process.rpcMergerdqmclient*process.rpcEventSummary*process.rpcEventSummaryMerger*process.dqmEnv*process.dqmSaver*process.dqmSaverPB)
0161 process.p = cms.Path(process.hltTriggerTypeFilter*process.rpcSource*process.rpcClient)
0162 
0163 process.rpcunpacker.InputLabel = "rawDataCollector"
0164 process.scalersRawToDigi.scalersInputTag = "rawDataCollector"
0165 process.rpcCPPFRawToDigi.inputTag = "rawDataCollector"
0166 #--------------------------------------------------
0167 # Heavy Ion Specific Fed Raw Data Collection Label
0168 #--------------------------------------------------
0169 
0170 print("Running with run type = ", process.runType.getRunType())
0171 
0172 if (process.runType.getRunType() == process.runType.hi_run):
0173     process.rpcunpacker.InputLabel = "rawDataRepacker"
0174     process.scalersRawToDigi.scalersInputTag = "rawDataRepacker"
0175     process.rpcTwinMuxRawToDigi.inputTag = "rawDataRepacker"
0176     process.rpcCPPFRawToDigi.inputTag = "rawDataRepacker"
0177     process.omtfStage2Digis.inputLabel = "rawDataRepacker"
0178     process.rpcEventSummary.MinimumRPCEvents  = 100000
0179     process.rpcEventSummaryMerger.MinimumRPCEvents  = 100000
0180 
0181 ### process customizations included here
0182 from DQM.Integration.config.online_customizations_cfi import *
0183 process = customise(process)
0184 print("Final Source settings:", process.source)
0185 
0186