Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-28 23:35:45

0001 #-------------------------------------
0002 #   Hcal DQM Application using New DQM Sources/Clients
0003 #-------------------------------------
0004 
0005 #-------------------------------------
0006 #   Standard Python Imports
0007 #-------------------------------------
0008 import os, sys, socket, string
0009 
0010 #-------------------------------------
0011 #   Standard CMSSW Imports/Definitions
0012 #-------------------------------------
0013 import FWCore.ParameterSet.Config as cms
0014 from Configuration.Eras.Era_Run3_cff import Run3
0015 process      = cms.Process('HCALDQM', Run3)
0016 subsystem    = 'Hcal'
0017 cmssw        = os.getenv("CMSSW_VERSION").split("_")
0018 debugstr     = "### HcalDQM::cfg::DEBUG: "
0019 warnstr      = "### HcalDQM::cfg::WARN: "
0020 errorstr     = "### HcalDQM::cfg::ERROR:"
0021 useOfflineGT = False
0022 useFileInput = False
0023 useMap       = False
0024 
0025 unitTest = False
0026 if 'unitTest=True' in sys.argv:
0027     unitTest=True
0028     useFileInput=False
0029 
0030 #-------------------------------------
0031 #   Central DQM Stuff imports
0032 #-------------------------------------
0033 from DQM.Integration.config.online_customizations_cfi import *
0034 if useOfflineGT:
0035     process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0036     process.GlobalTag.globaltag = autoCond['run3_data_prompt'] 
0037 else:
0038     process.load('DQM.Integration.config.FrontierCondition_GT_cfi')
0039 if unitTest:
0040     process.load("DQM.Integration.config.unittestinputsource_cfi")
0041     from DQM.Integration.config.unittestinputsource_cfi import options
0042 elif useFileInput:
0043     process.load("DQM.Integration.config.fileinputsource_cfi")
0044     from DQM.Integration.config.fileinputsource_cfi import options
0045 else:
0046     process.load('DQM.Integration.config.inputsource_cfi')
0047     from DQM.Integration.config.inputsource_cfi import options
0048 process.load('DQM.Integration.config.environment_cfi')
0049 
0050 #-------------------------------------
0051 #   Central DQM Customization
0052 #-------------------------------------
0053 process.dqmEnv.subSystemFolder = subsystem
0054 process.dqmSaver.tag = subsystem
0055 process.dqmSaver.runNumber = options.runNumber
0056 process.dqmSaverPB.tag = subsystem
0057 process.dqmSaverPB.runNumber = options.runNumber
0058 process = customise(process)
0059 process.DQMStore.verbose = 0
0060 if not unitTest and not useFileInput :
0061   if not options.BeamSplashRun :
0062     process.source.minEventsPerLumi = 100
0063 
0064 #-------------------------------------
0065 #   CMSSW/Hcal non-DQM Related Module import
0066 #-------------------------------------
0067 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0068 process.load('FWCore.MessageLogger.MessageLogger_cfi')
0069 process.load("EventFilter.HcalRawToDigi.HcalRawToDigi_cfi")
0070 process.load('EventFilter.CastorRawToDigi.CastorRawToDigi_cff')
0071 process.load("SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff")
0072 
0073 #-------------------------------------
0074 #   CMSSW/Hcal non-DQM Related Module Settings
0075 #   -> runType
0076 #   -> Generic Input tag for the Raw Collection
0077 #   -> cmssw version
0078 #   -> Turn off default blocking of dead channels from rechit collection
0079 #   -> Drop Channel Status Bits (had benn 'HcalCellOff', "HcalCellDead")
0080 #   -> For Trigger Primitives Emulation
0081 #   -> L1 GT setting
0082 #   -> Rename the hbheprereco to hbhereco
0083 #-------------------------------------
0084 runType         = process.runType.getRunType()
0085 runTypeName     = process.runType.getRunTypeName()
0086 isCosmicRun     = runTypeName=="cosmic_run" or runTypeName=="cosmic_run_stage1"
0087 isHeavyIon      = runTypeName=="hi_run"
0088 cmssw           = os.getenv("CMSSW_VERSION").split("_")
0089 rawTag          = "rawDataCollector"
0090 rawTagUntracked = "rawDataCollector"
0091 if isHeavyIon:
0092     rawTag = "rawDataRepacker"
0093     rawTagUntracked = "rawDataRepacker"
0094     process.castorDigis.InputLabel = rawTag
0095 
0096 process.emulTPDigis = process.simHcalTriggerPrimitiveDigis.clone(
0097    inputLabel = ["hcalDigis", 'hcalDigis'],
0098    FrontEndFormatError = True,
0099    FG_threshold = 2,
0100    InputTagFEDRaw = rawTag,
0101    upgradeHF = True,
0102    upgradeHE = True,
0103    upgradeHB = True,
0104    inputUpgradeLabel = ["hcalDigis", "hcalDigis"],
0105    # Enable ZS on emulated TPs, to match what is done in data
0106    RunZS = True,
0107    ZS_threshold = 0
0108 )
0109 
0110 process.hcalDigis.InputLabel = rawTag
0111 process.emulTPDigisNoTDCCut = process.emulTPDigis.clone(
0112      parameters = cms.untracked.PSet(
0113     ADCThresholdHF = cms.uint32(255),
0114     TDCMaskHF = cms.uint64(0xFFFFFFFFFFFFFFFF)
0115      )
0116 )
0117 process.HcalTPGCoderULUT.LUTGenerationMode = False
0118 
0119 # For sent-received comparison
0120 process.load("L1Trigger.Configuration.L1TRawToDigi_cff")
0121 # For heavy ion runs, need to reconfigure sources for L1TRawToDigi
0122 if isHeavyIon:
0123     process.csctfDigis.producer = "rawDataRepacker"
0124     process.dttfDigis.DTTF_FED_Source = "rawDataRepacker"
0125     process.twinMuxStage2Digis.DTTM7_FED_Source = "rawDataRepacker"
0126     process.omtfStage2Digis.inputLabel = "rawDataRepacker"
0127     process.caloStage1Digis.InputLabel = "rawDataRepacker" #new
0128     process.bmtfDigis.InputLabel = "rawDataRepacker"
0129     process.emtfStage2Digis.InputLabel = "rawDataRepacker"
0130     process.caloLayer1Digis.InputLabel = "rawDataRepacker" #not sure
0131     process.caloStage2Digis.InputLabel = "rawDataRepacker"
0132     process.gmtStage2Digis.InputLabel = "rawDataRepacker"
0133     process.gtStage2Digis.InputLabel = "rawDataRepacker"
0134     process.rpcTwinMuxRawToDigi.inputTag = "rawDataRepacker"
0135     process.rpcCPPFRawToDigi.inputTag = "rawDataRepacker"
0136 
0137 # Exclude the laser FEDs. They contaminate the QIE10/11 digi collections. 
0138 #from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017
0139 #run2_HCAL_2017.toModify(process.hcalDigis, FEDs=[724,725,726,727,728,729,730,731,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123])
0140 
0141 #-------------------------------------
0142 #   Hcal DQM Tasks and Harvesters import
0143 #   New Style
0144 #-------------------------------------
0145 process.load("DQM.HcalTasks.DigiTask")
0146 process.load('DQM.HcalTasks.TPTask')
0147 process.load('DQM.HcalTasks.RawTask')
0148 process.load('DQM.HcalTasks.NoCQTask')
0149 process.load('DQM.HcalTasks.FCDTask')
0150 process.load('DQM.HcalTasks.ZDCTask')
0151 #process.load('DQM.HcalTasks.QIE11Task') # 2018: integrate QIE11Task into DigiTask
0152 process.load('DQM.HcalTasks.HcalOnlineHarvesting')
0153 process.load('DQM.HcalTasks.HcalQualityTests')
0154 
0155 #-------------------------------------
0156 #   For Debugginb
0157 #-------------------------------------
0158 #process.hcalDigiTask.moduleParameters.debug = 10
0159 
0160 #-------------------------------------
0161 #   Some Settings before Finishing up
0162 #   New Style Modules
0163 #-------------------------------------
0164 oldsubsystem = subsystem
0165 process.rawTask.tagFEDs = rawTagUntracked
0166 process.digiTask.runkeyVal = runType
0167 process.digiTask.runkeyName = runTypeName
0168 process.nocqTask.runkeyVal = runType
0169 process.nocqTask.runkeyName = runTypeName
0170 process.rawTask.runkeyVal = runType
0171 process.rawTask.runkeyName = runTypeName
0172 process.tpTask.runkeyVal = runType
0173 process.tpTask.runkeyName = runTypeName
0174 #process.zdcTask.runkeyVal = runType
0175 #process.zdcTask.runkeyName = runTypeName
0176 #process.zdcTask.tagQIE10 = cms.untracked.InputTag("castorDigis")
0177 #process.qie11Task.runkeyVal = runType
0178 #process.qie11Task.runkeyName = runTypeName
0179 #process.qie11Task.tagQIE11 = cms.untracked.InputTag("hcalDigis")
0180 process.fcdTask.runkeyVal = runType
0181 process.fcdTask.runkeyName = runTypeName
0182 
0183 #-------------------------------------
0184 #   Hcal DQM Tasks/Clients Sequences Definition
0185 #-------------------------------------
0186 process.tasksPath = cms.Path(
0187         process.rawTask
0188         +process.digiTask
0189         +process.tpTask
0190         +process.nocqTask
0191         +process.fcdTask
0192         #+process.qie11Task
0193         #ZDC to be removed after 2018 PbPb run
0194         +process.zdcQIE10Task
0195 )
0196 
0197 if isHeavyIon:
0198     process.tasksPath += process.zdcQIE10Task
0199 
0200 process.harvestingPath = cms.Path(
0201     process.hcalOnlineHarvesting
0202 )
0203 
0204 #-------------------------------------
0205 #   Paths/Sequences Definitions
0206 #-------------------------------------
0207 process.preRecoPath = cms.Path(
0208         process.hcalDigis
0209         #*process.castorDigis # not in Run3
0210         *process.emulTPDigis
0211         *process.emulTPDigisNoTDCCut
0212         *process.L1TRawToDigi
0213 )
0214 
0215 process.dqmPath = cms.EndPath(
0216         process.dqmEnv)
0217 process.dqmPath1 = cms.EndPath(
0218         process.dqmSaver
0219         *process.dqmSaverPB
0220 )
0221 process.qtPath = cms.Path(process.hcalQualityTests)
0222 
0223 process.schedule = cms.Schedule(
0224     process.preRecoPath,
0225     process.tasksPath,
0226     process.qtPath,
0227     process.harvestingPath,
0228     process.dqmPath,
0229     process.dqmPath1
0230 )
0231 
0232 #-------------------------------------
0233 #   Scheduling and Process Customizations
0234 #-------------------------------------
0235 process.options = cms.untracked.PSet(
0236         Rethrow = cms.untracked.vstring(
0237             "ProductNotFound",
0238             "TooManyProducts",
0239             "TooFewProducts"
0240         )
0241 )
0242 process.options.wantSummary = True
0243 
0244 # tracer
0245 #process.Tracer = cms.Service("Tracer")
0246 print("Final Source settings:", process.source)
0247 process = customise(process)