Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:07:56

0001 from __future__ import print_function
0002 #
0003 # cfg file to run online L1 Trigger 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 l1Condition = 'legacy'
0020 #l1Condition = 'stage1'
0021 
0022 # for 'file' choose also the type of the global tag and (edit) the actual global tag
0023 if l1DqmEnv == 'file' :
0024 
0025     globalTagType = 'HLT'
0026     #globalTagType = 'P'
0027     #globalTagType = 'E'
0028     #globalTagType = 'R'
0029 
0030     if globalTagType == 'HLT' :
0031         globalTagValue = 'GR_H_V44'
0032     elif globalTagType == 'P' :
0033         globalTagValue = 'GR_P_V29'
0034     elif globalTagType == 'E' :
0035         globalTagValue = 'GR_E_V23'
0036     elif globalTagType == 'R' :
0037         globalTagValue = 'GR_R_52_V4'
0038     else :
0039         print('No valid global tag type', globalTagType)
0040         print('Valid types: HLT, P, E, R')
0041         sys.exit()
0042 
0043 
0044 process = cms.Process("DQM")
0045 
0046 # check that a valid choice for environment exists
0047 
0048 if not ((l1DqmEnv == 'live') or l1DqmEnv == 'playback' or l1DqmEnv == 'file-P5' or l1DqmEnv == 'file' ) :
0049     print('No valid input source was chosen. Your value for l1DqmEnv input parameter is:')
0050     print('l1DqmEnv = ', l1DqmEnv)
0051     print('Available options: "live", "playback", "file-P5", "file" ')
0052     sys.exit()
0053 
0054 #----------------------------
0055 # Event Source
0056 #
0057 
0058 if l1DqmEnv == 'live' :
0059     process.load("DQM.Integration.test.inputsource_cfi")
0060     process.EventStreamHttpReader.SelectEvents = cms.untracked.PSet(
0061             SelectEvents = cms.vstring("*")
0062             )
0063     process.EventStreamHttpReader.consumerName = 'L1T DQM Consumer'
0064     process.EventStreamHttpReader.maxEventRequestRate = cms.untracked.double(25.0)
0065 
0066 elif l1DqmEnv == 'playback' :
0067     print('FIXME')
0068     sys.exit()
0069 
0070 else :
0071     # running on a file
0072     process.load("DQM.L1TMonitor.inputsource_file_cfi")
0073 
0074 
0075 #----------------------------
0076 # DQM Environment
0077 #
0078 
0079 #process.load("DQMServices.Core.DQM_cfg")
0080 process.load("DQMServices.Components.DQMEnvironment_cfi")
0081 process.dqmEnv.subSystemFolder = 'L1T'
0082 
0083 if l1DqmEnv == 'live' :
0084     process.load("DQM.Integration.test.environment_cfi")
0085 
0086     #
0087     # load and configure modules via Global Tag
0088     # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions
0089     process.load("DQM.Integration.test.FrontierCondition_GT_cfi")
0090     es_prefer_GlobalTag = cms.ESPrefer('GlobalTag')
0091     process.GlobalTag.RefreshEachRun = cms.untracked.bool(True)
0092 
0093 elif l1DqmEnv == 'playback' :
0094     print('FIXME')
0095 
0096 elif l1DqmEnv == 'file-P5' :
0097     process.load("DQM.Integration.test.FrontierCondition_GT_cfi")
0098     es_prefer_GlobalTag = cms.ESPrefer('GlobalTag')
0099     process.GlobalTag.RefreshEachRun = cms.untracked.bool(True)
0100 
0101 else :
0102     # running on a file, on lxplus (not on .cms)
0103     process.load("DQM.L1TMonitor.environment_file_cff")
0104 
0105     process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0106 
0107     if globalTagType == 'HLT' :
0108          process.GlobalTag.connect = 'frontier://FrontierProd/CMS_COND_31X_GLOBALTAG'
0109          process.GlobalTag.pfnPrefix = cms.untracked.string('frontier://FrontierProd/')
0110 
0111     process.GlobalTag.globaltag = globalTagValue+'::All'
0112     es_prefer_GlobalTag = cms.ESPrefer('GlobalTag')
0113 
0114 
0115 #process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0116 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0117 
0118 #-------------------------------------
0119 # sequences needed for L1 trigger DQM
0120 #
0121 
0122 # standard unpacking sequence
0123 process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
0124 
0125 # L1 Trigger sequences
0126 
0127 # l1tMonitor and l1tMonitorEndPathSeq
0128 process.load("DQM.L1TMonitor.L1TMonitor_cff")
0129 
0130 # L1 trigger synchronization module - it uses also HltHighLevel filter
0131 process.load("DQM.L1TMonitor.L1TSync_cff")
0132 
0133 # l1tMonitorClient and l1tMonitorClientEndPathSeq
0134 process.load("DQM.L1TMonitorClient.L1TMonitorClient_cff")
0135 
0136 # change the DB connections when not at P5 - works on lxplus only...
0137 if ( l1DqmEnv == 'file' ) :
0138     process.l1tSync.oracleDB = cms.string("oracle://cms_orcon_adg/CMS_COND_31X_L1T")
0139     process.l1tSync.pathCondDB = cms.string("/afs/cern.ch/cms/DB/conddb/ADG")
0140     #
0141     process.l1tRate.oracleDB = cms.string("oracle://cms_orcon_adg/CMS_COND_31X_L1T")
0142     process.l1tRate.pathCondDB = cms.string("/afs/cern.ch/cms/DB/conddb/ADG")
0143 
0144 
0145 #-------------------------------------
0146 # paths & schedule for L1 Trigger DQM
0147 #
0148 
0149 # TODO define a L1 trigger L1TriggerRawToDigi in the standard sequence
0150 # to avoid all these remove
0151 process.rawToDigiPath = cms.Path(process.RawToDigi)
0152 #
0153 process.RawToDigi.remove("siPixelDigis")
0154 process.RawToDigi.remove("siStripDigis")
0155 process.RawToDigi.remove("scalersRawToDigi")
0156 process.RawToDigi.remove("castorDigis")
0157 
0158 # for GCT, unpack all five samples
0159 process.gctDigis.numberOfGctSamplesToUnpack = cms.uint32(5)
0160 
0161 if l1Condition == 'stage1':
0162     process.l1tMonitorPath = cms.Path(process.l1tMonitorStage1Online)
0163     process.l1tMonitorClientPath = cms.Path(process.l1tMonitorStage1Client)
0164     # Update HfRing thresholds to accomodate di-iso tau trigger thresholds
0165     from L1TriggerConfig.L1ScalesProducers.l1CaloScales_cfi import l1CaloScales
0166     l1CaloScales.L1HfRingThresholds = cms.vdouble(0.0, 24.0, 28.0, 32.0, 36.0, 40.0, 44.0, 48.0)
0167     l1CaloScales.L1HtMissThresholds = cms.vdouble(
0168       0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09,
0169       0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19,
0170       0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29,
0171       0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39,
0172       0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49,
0173       0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59,
0174       0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69,
0175       0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79,
0176       0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89,
0177       0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99,
0178       1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09,
0179       1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19,
0180       1.20, 1.21, 1.22, 1.23, 1.24, 1.25, 1.26, 1.27
0181     )
0182 else :
0183     process.l1tMonitorPath = cms.Path(process.l1tMonitorOnline)
0184     process.l1tMonitorClientPath = cms.Path(process.l1tMonitorClient)
0185 
0186 # separate L1TSync path due to the use of the HltHighLevel filter
0187 process.l1tSyncPath = cms.Path(process.l1tSyncHltFilter+process.l1tSync)
0188 
0189 #
0190 process.l1tMonitorEndPath = cms.EndPath(process.l1tMonitorEndPathSeq)
0191 
0192 #
0193 process.l1tMonitorClientEndPath = cms.EndPath(process.l1tMonitorClientEndPathSeq)
0194 
0195 #
0196 process.dqmEndPath = cms.EndPath(
0197                                  process.dqmEnv *
0198                                  process.dqmSaver
0199                                  )
0200 
0201 
0202 process.output = cms.OutputModule(
0203     "PoolOutputModule",
0204     splitLevel = cms.untracked.int32(0),
0205     eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0206     outputCommands = cms.untracked.vstring('keep *',),
0207     # outputCommands = cms.untracked.vstring('drop *',
0208     #                                        'keep *_*_*_L1TEMULATION'),
0209     fileName = cms.untracked.string('stage1_debug.root'),
0210     dataset = cms.untracked.PSet(
0211         filterName = cms.untracked.string(''),
0212         dataTier = cms.untracked.string('')
0213         )
0214     )
0215 
0216 process.output_step = cms.EndPath(process.output)
0217 
0218 
0219 #
0220 process.schedule = cms.Schedule(process.rawToDigiPath,
0221                                 process.l1tMonitorPath,
0222                                 process.l1tSyncPath,
0223                                 process.l1tMonitorClientPath,
0224                                 process.output_step,
0225                                 process.l1tMonitorEndPath,
0226                                 process.l1tMonitorClientEndPath,
0227                                 process.dqmEndPath
0228                                 )
0229 
0230 #---------------------------------------------
0231 
0232 # examples for quick fixes in case of troubles
0233 #    please do not modify the commented lines
0234 #
0235 
0236 
0237 #
0238 # turn on verbosity in L1TEventInfoClient
0239 #
0240 # process.l1tEventInfoClient.verbose = cms.untracked.bool(True)
0241 
0242 
0243 # remove module(s) or system sequence from l1tMonitorPath
0244 #        quality test disabled also
0245 #
0246 #process.l1tMonitorOnline.remove(process.bxTiming)
0247 
0248 process.l1tMonitorOnline.remove(process.l1tBPTX)
0249 
0250 #process.l1tMonitorOnline.remove(process.l1Dttf)
0251 
0252 #process.l1tMonitorOnline.remove(process.l1tCsctf)
0253 
0254 #process.l1tMonitorOnline.remove(process.l1tRpctf)
0255 
0256 #process.l1tMonitorOnline.remove(process.l1tGmt)
0257 
0258 #process.l1tMonitorOnline.remove(process.l1tGt)
0259 
0260 #process.l1tMonitorOnline.remove(process.l1ExtraDqmSeq)
0261 
0262 process.l1tMonitorOnline.remove(process.l1tRate)
0263 
0264 #process.l1tMonitorOnline.remove(process.l1tRctSeq)
0265 
0266 #process.l1tMonitorOnline.remove(process.l1tGctSeq)
0267 
0268 
0269 # remove module(s) or system sequence from l1tMonitorEndPath
0270 #
0271 #process.l1tMonitorEndPathSeq.remove(process.l1s)
0272 #process.l1tMonitorEndPathSeq.remove(process.l1tscalers)
0273 
0274 #
0275 process.schedule.remove(process.l1tSyncPath)
0276 
0277 
0278 #
0279 # un-comment next lines in case you use the file for private tests using data from the L1T server
0280 #
0281 #process.dqmSaver.dirName = '.'
0282 #process.dqmSaver.saveByRun = 1
0283 #process.dqmSaver.saveAtJobEnd = True
0284 
0285 
0286 # Message Logger
0287 process.load('FWCore.MessageService.MessageLogger_cfi')
0288 process.MessageLogger.debugModules = ['l1tGt']
0289 
0290 process.MessageLogger.files.L1TDQM_errors = cms.untracked.PSet(
0291         threshold = cms.untracked.string('ERROR'),
0292         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(-1) )
0293        )
0294 
0295 process.MessageLogger.files.L1TDQM_warnings = cms.untracked.PSet(
0296         threshold = cms.untracked.string('WARNING'),
0297         WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0298         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0299         )
0300 
0301 process.MessageLogger.files.L1TDQM_info = cms.untracked.PSet(
0302         threshold = cms.untracked.string('INFO'),
0303         INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0304         WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0305         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0306         L1TGT = cms.untracked.PSet( limit = cms.untracked.int32(-1) )
0307         )
0308 
0309 process.MessageLogger.files.L1TDQM_debug = cms.untracked.PSet(
0310         threshold = cms.untracked.string('DEBUG'),
0311         DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0312         INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0313         WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0314         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0315         )
0316 
0317 #--------------------------------------------------
0318 # Heavy Ion Specific Fed Raw Data Collection Label
0319 #--------------------------------------------------
0320 
0321 print("Running with run type = ", process.runType.getRunType())
0322 process.castorDigis.InputLabel = cms.InputTag("rawDataCollector")
0323 process.csctfDigis.producer = cms.InputTag("rawDataCollector")
0324 process.dttfDigis.DTTF_FED_Source = cms.InputTag("rawDataCollector")
0325 process.ecalDigis.InputLabel = cms.InputTag("rawDataCollector")
0326 process.ecalPreshowerDigis.sourceTag = cms.InputTag("rawDataCollector")
0327 process.rctDigis.inputLabel = cms.InputTag("rawDataCollector")
0328 process.gctDigis.inputLabel = cms.InputTag("rawDataCollector")
0329 process.gtDigis.DaqGtInputTag = cms.InputTag("rawDataCollector")
0330 process.gtEvmDigis.EvmGtInputTag = cms.InputTag("rawDataCollector")
0331 process.hcalDigis.InputLabel = cms.InputTag("rawDataCollector")
0332 process.muonCSCDigis.InputObjects = cms.InputTag("rawDataCollector")
0333 process.muonDTDigis.inputLabel = cms.InputTag("rawDataCollector")
0334 process.muonRPCDigis.InputLabel = cms.InputTag("rawDataCollector")
0335 process.scalersRawToDigi.scalersInputTag = cms.InputTag("rawDataCollector")
0336 process.siPixelDigis.InputLabel = cms.InputTag("rawDataCollector")
0337 process.siStripDigis.ProductLabel = cms.InputTag("rawDataCollector")
0338 process.bxTiming.FedSource = cms.untracked.InputTag("rawDataCollector")
0339 process.l1s.fedRawData = cms.InputTag("rawDataCollector")
0340 
0341 if (process.runType.getRunType() == process.runType.hi_run):
0342     process.castorDigis.InputLabel = cms.InputTag("rawDataRepacker")
0343     process.csctfDigis.producer = cms.InputTag("rawDataRepacker")
0344     process.dttfDigis.DTTF_FED_Source = cms.InputTag("rawDataRepacker")
0345     process.ecalDigis.InputLabel = cms.InputTag("rawDataRepacker")
0346     process.ecalPreshowerDigis.sourceTag = cms.InputTag("rawDataRepacker")
0347     process.rctDigis.inputLabel = cms.InputTag("rawDataRepacker")
0348     process.gctDigis.inputLabel = cms.InputTag("rawDataRepacker")
0349     process.gtDigis.DaqGtInputTag = cms.InputTag("rawDataRepacker")
0350     process.gtEvmDigis.EvmGtInputTag = cms.InputTag("rawDataRepacker")
0351     process.hcalDigis.InputLabel = cms.InputTag("rawDataRepacker")
0352     process.muonCSCDigis.InputObjects = cms.InputTag("rawDataRepacker")
0353     process.muonDTDigis.inputLabel = cms.InputTag("rawDataRepacker")
0354     process.muonRPCDigis.InputLabel = cms.InputTag("rawDataRepacker")
0355     process.scalersRawToDigi.scalersInputTag = cms.InputTag("rawDataRepacker")
0356     process.siPixelDigis.InputLabel = cms.InputTag("rawDataRepacker")
0357     process.siStripDigis.ProductLabel = cms.InputTag("rawDataRepacker")
0358     process.bxTiming.FedSource = cms.untracked.InputTag("rawDataRepacker")
0359     process.l1s.fedRawData = cms.InputTag("rawDataRepacker")
0360 
0361 
0362 from SLHCUpgradeSimulations.Configuration.postLS1Customs import customise_DQM
0363 #call to customisation function customise_DQM imported from SLHCUpgradeSimulations.Configuration.postLS1Customs
0364 process = customise_DQM(process)