Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:42:43

0001 from __future__ import print_function
0002 #
0003 # cfg file to run online L1 Trigger emulator DQM
0004 #     the user can choose the environment (live, playback, file-P5, file)
0005 #     for 'file, one can also choose the global tag type and the actual tag
0006 #
0007 # V M Ghete 2010-07-09
0008 
0009 
0010 import FWCore.ParameterSet.Config as cms
0011 import sys
0012 
0013 # choose the environment you run
0014 #l1DqmEnv = 'live'
0015 #l1DqmEnv = 'playback'
0016 #l1DqmEnv = 'file-P5'
0017 l1DqmEnv = 'file'
0018 
0019 # for 'file' choose also the type of the global tag and (edit) the actual global tag
0020 if l1DqmEnv == 'file' :
0021     
0022     globalTagType = 'HLT'
0023     #globalTagType = 'P'
0024     #globalTagType = 'E'
0025     #globalTagType = 'R'
0026     
0027     if globalTagType == 'HLT' :
0028         globalTagValue = 'GR_H_V26'
0029     elif globalTagType == 'P' :
0030         globalTagValue = 'GR_P_V29'
0031     elif globalTagType == 'E' :
0032         globalTagValue = 'GR_E_V23'
0033     elif globalTagType == 'R' :
0034         globalTagValue = 'GR_R_52_V4'
0035     else :
0036         print('No valid global tag type', globalTagType)
0037         print('Valid types: HLT, P, E, R')
0038         sys.exit()
0039 
0040 
0041 process = cms.Process("L1TEmuDQM")
0042 
0043 # check that a valid choice for environment exists
0044 
0045 if not ((l1DqmEnv == 'live') or l1DqmEnv == 'playback' or l1DqmEnv == 'file-P5' or l1DqmEnv == 'file' ) : 
0046     print('No valid input source was chosen. Your value for l1DqmEnv input parameter is:')  
0047     print('l1DqmEnv = ', l1DqmEnv)
0048     print('Available options: "live", "playback", "file-P5", "file" ')
0049     sys.exit()
0050 
0051 #----------------------------
0052 # Event Source
0053 #
0054 
0055 if l1DqmEnv == 'live' :
0056     process.load("DQM.Integration.test.inputsource_cfi")
0057     process.EventStreamHttpReader.SelectEvents = cms.untracked.PSet(
0058             SelectEvents = cms.vstring("*")
0059             )
0060     process.EventStreamHttpReader.consumerName = 'L1TEMU DQM Consumer'
0061     process.EventStreamHttpReader.maxEventRequestRate = cms.untracked.double(25.0)
0062  
0063 elif l1DqmEnv == 'playback' :
0064     print('FIXME')
0065     sys.exit()
0066     
0067 else : 
0068     # running on a file
0069     process.load("DQM.L1TMonitor.inputsource_file_cfi")
0070     
0071       
0072 #----------------------------
0073 # DQM Environment
0074 #
0075 
0076 process.load("DQMServices.Core.DQM_cfg")
0077 process.load("DQMServices.Components.DQMEnvironment_cfi")
0078 process.dqmEnv.subSystemFolder = 'L1TEMU'
0079 
0080 if l1DqmEnv == 'live' :
0081     process.load("DQM.Integration.test.environment_cfi")
0082     # no references needed
0083 
0084     #
0085     # load and configure modules via Global Tag
0086     # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions
0087     process.load("DQM.Integration.test.FrontierCondition_GT_cfi")
0088     es_prefer_GlobalTag = cms.ESPrefer('GlobalTag')
0089     process.GlobalTag.RefreshEachRun = cms.untracked.bool(True)
0090 
0091 elif l1DqmEnv == 'playback' :
0092     print('FIXME')
0093     
0094 elif l1DqmEnv == 'file-P5' :
0095     process.load("DQM.Integration.test.FrontierCondition_GT_cfi")
0096     es_prefer_GlobalTag = cms.ESPrefer('GlobalTag')
0097     process.GlobalTag.RefreshEachRun = cms.untracked.bool(True)
0098     
0099 else : 
0100     # running on a file, on lxplus (not on .cms)
0101     process.load("DQM.L1TMonitor.environment_file_cff")
0102 
0103     process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0104     
0105     if globalTagType == 'HLT' :
0106          process.GlobalTag.connect = 'frontier://FrontierProd/CMS_COND_31X_GLOBALTAG' 
0107          process.GlobalTag.pfnPrefix = cms.untracked.string('frontier://FrontierProd/') 
0108                       
0109     process.GlobalTag.globaltag = globalTagValue+'::All'
0110     es_prefer_GlobalTag = cms.ESPrefer('GlobalTag')
0111 
0112 
0113 #process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0114 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0115 
0116 #-------------------------------------
0117 # sequences needed for L1 emulator DQM
0118 #
0119 
0120 # standard unpacking sequence 
0121 process.load("Configuration.StandardSequences.RawToDigi_Data_cff")    
0122 
0123 # L1 data - emulator sequences 
0124 process.load("DQM.L1TMonitor.L1TEmulatorMonitor_cff")    
0125 process.load("DQM.L1TMonitorClient.L1TEMUMonitorClient_cff")    
0126 
0127 #-------------------------------------
0128 # paths & schedule for L1 emulator DQM
0129 #
0130 
0131 # TODO define a L1 trigger L1TriggerRawToDigi in the standard sequence 
0132 # to avoid all these remove
0133 process.rawToDigiPath = cms.Path(process.RawToDigi)
0134 #
0135 process.RawToDigi.remove("siPixelDigis")
0136 process.RawToDigi.remove("siStripDigis")
0137 process.RawToDigi.remove("scalersRawToDigi")
0138 process.RawToDigi.remove("castorDigis")
0139 
0140 # L1HvVal + emulator monitoring path
0141 process.l1HwValEmulatorMonitorPath = cms.Path(process.l1HwValEmulatorMonitor)
0142 
0143 # for RCT at P5, read FED vector from OMDS
0144 if ( l1DqmEnv != 'file' ) : 
0145     process.load("L1TriggerConfig.RCTConfigProducers.l1RCTOmdsFedVectorProducer_cfi")
0146     process.valRctDigis.getFedsFromOmds = cms.bool(True)
0147  
0148 #
0149 process.l1EmulatorMonitorClientPath = cms.Path(process.l1EmulatorMonitorClient)
0150 
0151 #
0152 process.l1EmulatorMonitorEndPath = cms.EndPath(process.dqmEnv*process.dqmSaver)
0153 
0154 #
0155 
0156 #
0157 process.schedule = cms.Schedule(process.rawToDigiPath,
0158                                 process.l1HwValEmulatorMonitorPath,
0159                                 process.l1EmulatorMonitorClientPath,
0160                                 process.l1EmulatorMonitorEndPath)
0161 
0162 #---------------------------------------------
0163 
0164 # examples for quick fixes in case of troubles 
0165 #    please do not modify the commented lines
0166 #
0167 # remove a module from hardware validation
0168 # cff file: L1Trigger.HardwareValidation.L1HardwareValidation_cff
0169 #
0170 # process.L1HardwareValidation.remove("deCsctf")
0171 #
0172 process.L1HardwareValidation.remove(process.deDt)
0173 
0174 
0175 #
0176 # remove a L1 trigger system from the comparator integrated in hardware validation
0177 # cfi file: L1Trigger.HardwareValidation.L1Comparator_cfi
0178 # remove (consistently) the same systems from L1TDEMON
0179 # cfi file: DQM.L1TMonitor.L1TDEMON_cfi
0180 #
0181 # 
0182 # process.l1compare.COMPARE_COLLS = [
0183 #        0,  0,  1,  1,   0,  1,  0,  0,  1,  0,  1, 0
0184 #        ]
0185 #    # ETP,HTP,RCT,GCT, DTP,DTF,CTP,CTF,RPC,LTC,GMT,GT
0186 #
0187 # process.l1demon.COMPARE_COLLS = [
0188 #        0,  0,  1,  1,   0,  1,  0,  0,  1,  0,  1, 0
0189 #        ]
0190 #    # ETP,HTP,RCT,GCT, DTP,DTF,CTP,CTF,RPC,LTC,GMT,GT
0191 
0192 
0193 #
0194 # remove an expert module for L1 trigger system
0195 # cff file: DQM.L1TMonitor.L1TEmulatorMonitor_cff
0196 #
0197 # process.l1ExpertDataVsEmulator.remove(process.l1GtHwValidation)
0198 #
0199 
0200 #process.l1ExpertDataVsEmulator.remove(process.l1TdeCSCTF)
0201 
0202 #
0203 # remove a module / sequence from l1EmulatorMonitorClient
0204 # cff file: DQM.L1TMonitorClient.L1TEmulatorMonitorClient_cff
0205 #
0206 # process.l1EmulatorMonitorClient.remove(process.l1EmulatorErrorFlagClient)
0207 #
0208 
0209 
0210 #
0211 # fast over-mask a system in L1TEMUEventInfoClient: 
0212 #   if the name of the system is in the list, the system will be masked
0213 #   (the default mask value is given in L1Systems VPSet)             
0214 #
0215 # names are case sensitive, order is irrelevant
0216 # "ECAL", "HCAL", "RCT", "GCT", "DTTF", "DTTPG", "CSCTF", "CSCTPG", "RPC", "GMT", "GT"
0217 #
0218 # process.l1temuEventInfoClient.MaskL1Systems = cms.vstring("ECAL")
0219 #
0220 
0221 
0222 #
0223 # fast over-mask an object in L1TEMUEventInfoClient:
0224 #   if the name of the object is in the list, the object will be masked
0225 #   (the default mask value is given in L1Objects VPSet)             
0226 #
0227 # names are case sensitive, order is irrelevant
0228 # 
0229 # "Mu", "NoIsoEG", "IsoEG", "CenJet", "ForJet", "TauJet", "ETM", "ETT", "HTT", "HTM", 
0230 # "HfBitCounts", "HfRingEtSums", "TechTrig", "GtExternal
0231 #
0232 # process.l1temuEventInfoClient.MaskL1Objects =  cms.vstring("ETM")   
0233 #
0234 
0235 
0236 #
0237 # turn on verbosity in L1TEMUEventInfoClient
0238 #
0239 # process.l1EmulatorEventInfoClient.verbose = cms.untracked.bool(True)
0240 
0241 
0242 print("Running with run type = ", process.runType.getRunType())
0243 process.castorDigis.InputLabel = cms.InputTag("rawDataCollector")
0244 process.csctfDigis.producer = cms.InputTag("rawDataCollector")
0245 process.dttfDigis.DTTF_FED_Source = cms.InputTag("rawDataCollector")
0246 process.ecalDigis.InputLabel = cms.InputTag("rawDataCollector")
0247 process.ecalPreshowerDigis.sourceTag = cms.InputTag("rawDataCollector")
0248 process.rctDigis.inputLabel = cms.InputTag("rawDataCollector")
0249 process.gctDigis.inputLabel = cms.InputTag("rawDataCollector")
0250 process.gtDigis.DaqGtInputTag = cms.InputTag("rawDataCollector")
0251 process.gtEvmDigis.EvmGtInputTag = cms.InputTag("rawDataCollector")
0252 process.hcalDigis.InputLabel = cms.InputTag("rawDataCollector")
0253 process.l1compare.FEDsourceEmul = cms.untracked.InputTag("rawDataCollector")
0254 process.l1compare.FEDsourceData = cms.untracked.InputTag("rawDataCollector")
0255 process.muonCSCDigis.InputObjects = cms.InputTag("rawDataCollector")
0256 process.muonDTDigis.inputLabel = cms.InputTag("rawDataCollector")
0257 process.muonRPCDigis.InputLabel = cms.InputTag("rawDataCollector")
0258 process.scalersRawToDigi.scalersInputTag = cms.InputTag("rawDataCollector")
0259 process.siPixelDigis.InputLabel = cms.InputTag("rawDataCollector")
0260 process.siStripDigis.ProductLabel = cms.InputTag("rawDataCollector")
0261 
0262 #--------------------------------------------------
0263 # Heavy Ion Specific Fed Raw Data Collection Label
0264 #--------------------------------------------------
0265 if (process.runType.getRunType() == process.runType.hi_run):
0266     process.castorDigis.InputLabel = cms.InputTag("rawDataRepacker")
0267     process.csctfDigis.producer = cms.InputTag("rawDataRepacker")
0268     process.dttfDigis.DTTF_FED_Source = cms.InputTag("rawDataRepacker")
0269     process.ecalDigis.InputLabel = cms.InputTag("rawDataRepacker")
0270     process.ecalPreshowerDigis.sourceTag = cms.InputTag("rawDataRepacker")
0271     process.rctDigis.inputLabel = cms.InputTag("rawDataRepacker")
0272     process.gctDigis.inputLabel = cms.InputTag("rawDataRepacker")
0273     process.gtDigis.DaqGtInputTag = cms.InputTag("rawDataRepacker")
0274     process.gtEvmDigis.EvmGtInputTag = cms.InputTag("rawDataRepacker")
0275     process.hcalDigis.InputLabel = cms.InputTag("rawDataRepacker")
0276     process.l1compare.FEDsourceEmul = cms.untracked.InputTag("rawDataRepacker")
0277     process.l1compare.FEDsourceData = cms.untracked.InputTag("rawDataRepacker")
0278     process.muonCSCDigis.InputObjects = cms.InputTag("rawDataRepacker")
0279     process.muonDTDigis.inputLabel = cms.InputTag("rawDataRepacker")
0280     process.muonRPCDigis.InputLabel = cms.InputTag("rawDataRepacker")
0281     process.scalersRawToDigi.scalersInputTag = cms.InputTag("rawDataRepacker")
0282     process.siPixelDigis.InputLabel = cms.InputTag("rawDataRepacker")
0283     process.siStripDigis.ProductLabel = cms.InputTag("rawDataRepacker")
0284 
0285 
0286