Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-26 03:51:44

0001 from __future__ import print_function
0002 #-------------------------------------
0003 #   Hcal DQM Application using New DQM Sources/Clients
0004 #   Online Mode
0005 #-------------------------------------
0006 
0007 #-------------------------------------
0008 #   Standard Python Imports
0009 #-------------------------------------
0010 import os, sys, socket, string
0011 
0012 #-------------------------------------
0013 #   Standard CMSSW Imports/Definitions
0014 #-------------------------------------
0015 import FWCore.ParameterSet.Config as cms
0016 
0017 #
0018 # these Modifiers are like eras as well, for more info check
0019 # Configuration/StandardSequences/python/Eras.py
0020 # PRocess accepts a (*list) of modifiers
0021 #
0022 from Configuration.Eras.Era_Run3_cff import Run3
0023 process      = cms.Process('HCALDQM', Run3)
0024 subsystem    = 'HcalReco'
0025 cmssw        = os.getenv("CMSSW_VERSION").split("_")
0026 debugstr     = "### HcalDQM::cfg::DEBUG: "
0027 warnstr      = "### HcalDQM::cfg::WARN: "
0028 errorstr     = "### HcalDQM::cfg::ERROR:"
0029 useOfflineGT = False
0030 useFileInput = False
0031 useMap       = False
0032 useMapText   = False
0033 
0034 unitTest = False
0035 if 'unitTest=True' in sys.argv:
0036     unitTest=True
0037     useFileInput=False
0038 
0039 #-------------------------------------
0040 #   Central DQM Stuff imports
0041 #-------------------------------------
0042 from DQM.Integration.config.online_customizations_cfi import *
0043 if useOfflineGT:
0044     process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0045     process.GlobalTag.globaltag = '106X_dataRun3_HLT_Candidate_2019_11_26_14_48_16'
0046     #process.GlobalTag.globaltag = '100X_dataRun2_HLT_Candidate_2018_01_31_16_04_35'
0047     #process.GlobalTag.globaltag = '100X_dataRun2_HLT_v1'
0048 else:
0049     process.load('DQM.Integration.config.FrontierCondition_GT_cfi')
0050 if unitTest:
0051     process.load("DQM.Integration.config.unittestinputsource_cfi")
0052     from DQM.Integration.config.unittestinputsource_cfi import options
0053 elif useFileInput:
0054     process.load("DQM.Integration.config.fileinputsource_cfi")
0055     from DQM.Integration.config.fileinputsource_cfi import options
0056 else:
0057     process.load('DQM.Integration.config.inputsource_cfi')
0058     from DQM.Integration.config.inputsource_cfi import options
0059 process.load('DQM.Integration.config.environment_cfi')
0060 
0061 #-------------------------------------
0062 #   Central DQM Customization
0063 #-------------------------------------
0064 process.dqmEnv.subSystemFolder = subsystem
0065 process.dqmSaver.tag = "HcalReco" # to have a file saved as DQM_V..._HcalReco...
0066 process.dqmSaver.runNumber = options.runNumber
0067 process.dqmSaverPB.tag = "HcalReco"
0068 process.dqmSaverPB.runNumber = options.runNumber
0069 process = customise(process)
0070 process.DQMStore.verbose = 0
0071 if not unitTest and not useFileInput:
0072   if not options.BeamSplashRun :
0073     process.source.minEventsPerLumi = 5
0074 
0075 #   Note, runType is obtained after importing DQM-related modules
0076 #   => DQM-dependent
0077 runType         = process.runType.getRunType()
0078 print(debugstr, "Running with run type= ", runType)
0079 
0080 #-------------------------------------
0081 #   CMSSW/Hcal non-DQM Related Module import
0082 #-------------------------------------
0083 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0084 process.load('FWCore.MessageLogger.MessageLogger_cfi')
0085 process.load("EventFilter.HcalRawToDigi.HcalRawToDigi_cfi")
0086 process.load("SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff")
0087 process.load("RecoLocalCalo.Configuration.hcalLocalReco_cff")
0088 process.load('CondCore.CondDB.CondDB_cfi')
0089 
0090 #-------------------------------------
0091 #   CMSSW/Hcal non-DQM Related Module Settings
0092 #   -> runType
0093 #   -> Generic Input tag for the Raw Collection
0094 #   -> cmssw version
0095 #   -> Turn off default blocking of dead channels from rechit collection
0096 #   -> Drop Channel Status Bits (had benn 'HcalCellOff', "HcalCellDead")
0097 #   -> For Trigger Primitives Emulation
0098 #   -> L1 GT setting
0099 #   -> Rename the hbheprereco to hbhereco
0100 #-------------------------------------
0101 runType         = process.runType.getRunType()
0102 runTypeName     = process.runType.getRunTypeName()
0103 isCosmicRun     = runTypeName=="cosmic_run" or runTypeName=="cosmic_run_stage1"
0104 isHeavyIon      = runTypeName=="hi_run"
0105 cmssw           = os.getenv("CMSSW_VERSION").split("_")
0106 rawTag          = "rawDataCollector"
0107 rawTagUntracked = "rawDataCollector"
0108 if isHeavyIon:
0109     rawTag          = "rawDataRepacker"
0110     rawTagUntracked = "rawDataRepacker"
0111 
0112 #   set the tag for default unpacker
0113 process.hcalDigis.InputLabel = rawTag
0114 
0115 #-------------------------------------
0116 #   Hcal DQM Tasks and Clients import
0117 #   New Style
0118 #-------------------------------------
0119 process.load('DQM.HcalTasks.RecHitTask')
0120 process.load('DQM.HcalTasks.HcalOnlineHarvesting')
0121 
0122 #-------------------------------------
0123 #   To force using uTCA
0124 #   Will not be here for Online DQM
0125 #-------------------------------------
0126 if useMap:
0127     process.GlobalTag.toGet.append(cms.PSet(
0128         record = cms.string("HcalElectronicsMapRcd"),
0129         #tag = cms.string("HcalElectronicsMap_v7.05_hlt")
0130         tag = cms.string("HcalElectronicsMap_v9.0_hlt")
0131         )
0132     )
0133 
0134 #-------------------------------------
0135 #   For Debugginb
0136 #-------------------------------------
0137 
0138 #-------------------------------------
0139 #   Settings for the Primary Modules
0140 #-------------------------------------
0141 oldsubsystem = subsystem
0142 process.recHitTask.tagHBHE = "hbheprereco"
0143 process.recHitTask.tagHO = "horeco"
0144 process.recHitTask.tagHF = "hfreco"
0145 process.recHitTask.runkeyVal = runType
0146 process.recHitTask.runkeyName = runTypeName
0147 process.recHitTask.tagRaw = rawTagUntracked
0148 process.recHitTask.subsystem = subsystem
0149 
0150 process.hcalOnlineHarvesting.subsystem = subsystem
0151 
0152 #-------------------------------------
0153 #   Hcal DQM Tasks/Clients Sequences Definition
0154 #-------------------------------------
0155 process.tasksPath = cms.Path(
0156         process.recHitTask
0157 )
0158 
0159 process.harvestingPath = cms.Path(
0160     process.hcalOnlineHarvesting
0161 )
0162 
0163 #-------------------------------------
0164 process.digiPath = cms.Path(
0165         process.hcalDigis
0166 )
0167 
0168 process.recoPath = cms.Path(
0169     process.horeco
0170     *process.hfprereco
0171     *process.hfreco
0172     *process.hbheprereco
0173 )
0174 
0175 process.dqmPath = cms.Path(
0176         process.dqmEnv
0177         *process.dqmSaver
0178         *process.dqmSaverPB
0179 )
0180 
0181 process.schedule = cms.Schedule(
0182         process.digiPath,
0183         process.recoPath,
0184         process.tasksPath,
0185         process.harvestingPath,
0186         process.dqmPath
0187 )
0188 
0189 #-------------------------------------
0190 #   Scheduling and Process Customizations
0191 #-------------------------------------
0192 process.options = cms.untracked.PSet(
0193         Rethrow = cms.untracked.vstring(
0194             "ProductNotFound",
0195             "TooManyProducts",
0196             "TooFewProducts"
0197         )
0198 )
0199 
0200 process.options.wantSummary = True
0201 print("Final Source settings:", process.source)
0202