Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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