Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-26 02:34:09

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