Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-28 23:48:24

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    = 'HcalCalib'
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 #-------------------------------------
0026 #   Central DQM Stuff imports
0027 #-------------------------------------
0028 from DQM.Integration.config.online_customizations_cfi import *
0029 if useOfflineGT:
0030     process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0031     process.GlobalTag.globaltag = '106X_dataRun3_HLT_Candidate_2019_11_26_14_48_16'
0032     #process.GlobalTag.globaltag = '100X_dataRun2_HLT_v1'
0033 else:
0034     process.load('DQM.Integration.config.FrontierCondition_GT_cfi')
0035 if useFileInput:
0036     process.load("DQM.Integration.config.fileinputsource_cfi")
0037     from DQM.Integration.config.fileinputsource_cfi import options
0038 else:
0039     process.load('DQM.Integration.config.inputsource_cfi')
0040     from DQM.Integration.config.inputsource_cfi import options
0041 process.load('DQM.Integration.config.environment_cfi')
0042 
0043 #-------------------------------------
0044 #   Central DQM Customization
0045 #-------------------------------------
0046 process.source.streamLabel = cms.untracked.string("streamDQMCalibration")
0047 #process.source.SelectEvents = cms.untracked.vstring("*HcalCalibration*")
0048 process.dqmEnv.subSystemFolder = subsystem
0049 process.dqmSaver.tag = subsystem
0050 process.dqmSaver.runNumber = options.runNumber
0051 process.dqmSaverPB.tag = subsystem
0052 process.dqmSaverPB.runNumber = options.runNumber
0053 process = customise(process)
0054 if not useFileInput:
0055   if not options.BeamSplashRun : 
0056     process.source.minEventsPerLumi=100
0057 
0058 
0059 #-------------------------------------
0060 #   CMSSW/Hcal non-DQM Related Module import
0061 #-------------------------------------
0062 #process.load('Configuration.Geometry.GeometryIdeal_cff')
0063 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0064 process.load('FWCore.MessageLogger.MessageLogger_cfi')
0065 process.load("RecoLocalCalo.Configuration.hcalLocalReco_cff")
0066 process.load("SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff")
0067 process.load("L1Trigger.Configuration.L1DummyConfig_cff")
0068 process.load("EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi")
0069 process.load("EventFilter.HcalRawToDigi.HcalRawToDigi_cfi")
0070 
0071 #-------------------------------------
0072 #   CMSSW/Hcal non-DQM Related Module Settings
0073 #   -> runType
0074 #   -> Generic Input tag for the Raw Collection
0075 #   -> cmssw version
0076 #   -> Turn off default blocking of dead channels from rechit collection
0077 #   -> Drop Channel Status Bits (had benn 'HcalCellOff', "HcalCellDead")
0078 #   -> For Trigger Primitives Emulation
0079 #   -> L1 GT setting
0080 #   -> Rename the hbheprereco to hbhereco
0081 #-------------------------------------
0082 runType         = process.runType.getRunType()
0083 runTypeName     = process.runType.getRunTypeName()
0084 isCosmicRun     = runTypeName=="cosmic_run" or runTypeName=="cosmic_run_stage1"
0085 isHeavyIon      = runTypeName=="hi_run"
0086 cmssw           = os.getenv("CMSSW_VERSION").split("_")
0087 rawTag          = "hltHcalCalibrationRaw"
0088 rawTagUntracked = "hltHcalCalibrationRaw"
0089 process.essourceSev = cms.ESSource(
0090         "EmptyESSource",
0091         recordName      = cms.string("HcalSeverityLevelComputerRcd"),
0092         firstValid      = cms.vuint32(1),
0093         iovIsRunNotTime = cms.bool(True)
0094 )
0095 process.emulTPDigis = process.simHcalTriggerPrimitiveDigis.clone(
0096    inputLabel = ["hcalDigis", 'hcalDigis'],
0097    FrontEndFormatError = True,
0098    FG_threshold = 2,
0099    InputTagFEDRaw = rawTag
0100 )
0101 
0102 process.HcalTPGCoderULUT.LUTGenerationMode = cms.bool(False)
0103 process.l1GtUnpack.DaqGtInputTag = rawTag
0104 process.hbhereco = process.hbheprereco.clone()
0105 
0106 #-------------------------------------
0107 #   Hcal DQM Tasks and Clients import
0108 #-------------------------------------
0109 process.load("DQM.HcalTasks.PedestalTask")
0110 process.load('DQM.HcalTasks.RawTask')
0111 process.load("DQM.HcalTasks.LaserTask")
0112 process.load("DQM.HcalTasks.LEDTask")
0113 process.load("DQM.HcalTasks.UMNioTask")
0114 process.load('DQM.HcalTasks.HcalOnlineHarvesting')
0115 process.load("DQM.HcalTasks.HFRaddamTask")
0116 process.load('DQM.HcalTasks.QIE11Task')
0117 
0118 #-------------------------------------
0119 #   To force using uTCA
0120 #   Absent for Online Running
0121 #-------------------------------------
0122 if useMap:
0123     process.GlobalTag.toGet.append(
0124         cms.PSet(record = cms.string("HcalElectronicsMapRcd"),
0125                  #tag = cms.string("HcalElectronicsMap_v7.05_hlt"),
0126                  tag = cms.string("HcalElectronicsMap_v9.0_hlt"),
0127         ))
0128 
0129 #-------------------------------------
0130 #   Some Settings before Finishing up
0131 #-------------------------------------
0132 process.hcalDigis.InputLabel = rawTag
0133 
0134 process.hcalOnlineHarvesting.subsystem = subsystem
0135 process.rawTask.subsystem = subsystem
0136 process.rawTask.tagFEDs = rawTagUntracked
0137 process.rawTask.tagReport = "hcalDigis"
0138 process.rawTask.calibProcessing = True
0139 
0140 #-------------------------------------
0141 #   Prepare all the Laser Tasks
0142 #-------------------------------------
0143 process.hbhehpdTask = process.laserTask.clone(
0144    name = "HBHEHPDTask",
0145    laserType = 3,
0146    thresh_timingreflm_HO = [-1000., 1000.],
0147    thresh_timingreflm_HF = [-1000., 1000.],
0148    thresh_timingreflm_HB = [-1000., 1000.],
0149    thresh_timingreflm_HE = [-1000., 1000.]
0150 )
0151 
0152 process.hoTask = process.laserTask.clone(
0153    name = "HOTask",
0154    laserType = 4
0155 )
0156 
0157 process.hfTask = process.laserTask.clone(
0158    name = "HFTask",
0159    laserType = 5
0160 )
0161 
0162 process.hepmegaTask = process.laserTask.clone(
0163    name = "HEPMegaTask",
0164    laserType = 7
0165 )
0166 
0167 process.hemmegaTask = process.laserTask.clone(
0168   name = "HEMMegaTask",
0169   laserType = 8
0170 )
0171 
0172 process.hbpmegaTask = process.laserTask.clone(
0173   name = "HBPMegaTask",
0174   laserType = 9
0175 )
0176 
0177 process.hbmmegaTask = process.laserTask.clone(
0178   name = "HBMMegaTask",
0179   laserType = 10
0180 )
0181 
0182 process.qie11Task_laser = process.qie11Task.clone(
0183    name = "QIE11Task_laser",
0184    runkeyVal = runType,
0185    runkeyName = runTypeName,
0186    tagQIE11 = "hcalDigis",
0187    subsystem = "HcalCalib",
0188    laserType = 12
0189 )
0190 
0191 process.qie11Task_pedestal = process.qie11Task.clone(
0192    name = "QIE11Task_pedestal",
0193    runkeyVal = runType,
0194    runkeyName = runTypeName,
0195    tagQIE11 = "hcalDigis",
0196    subsystem = "HcalCalib",
0197    eventType = 1
0198 )
0199 
0200 process.ledTask.name = cms.untracked.string("LEDTask")
0201 
0202 #-------------------------------------
0203 #   Hcal DQM Tasks Sequence Definition
0204 #-------------------------------------
0205 process.tasksSequence = cms.Sequence(
0206         process.pedestalTask
0207         *process.hfRaddamTask
0208         *process.rawTask
0209         *process.hbhehpdTask
0210         *process.hoTask
0211         *process.hfTask
0212         *process.hepmegaTask
0213         *process.hemmegaTask
0214         *process.hbpmegaTask
0215         *process.hbmmegaTask
0216         *process.umnioTask
0217         *process.qie11Task_laser
0218         *process.qie11Task_pedestal
0219         *process.ledTask
0220 )
0221 
0222 process.harvestingSequence = cms.Sequence(
0223     process.hcalOnlineHarvesting
0224 )
0225 
0226 #-------------------------------------
0227 #   Execution Sequence Definition
0228 #-------------------------------------
0229 process.p = cms.Path(
0230                     process.hcalDigis
0231                     *process.tasksSequence
0232                     *process.harvestingSequence
0233                     *process.dqmEnv
0234                     *process.dqmSaver
0235             *process.dqmSaverPB)
0236 
0237 #-------------------------------------
0238 #   Scheduling
0239 #-------------------------------------
0240 print("Final Source settings:", process.source)
0241 process.options = cms.untracked.PSet(
0242         Rethrow = cms.untracked.vstring(
0243 #           "ProductNotFound",
0244             "TooManyProducts",
0245             "TooFewProducts"
0246         ),
0247         SkipEvent = cms.untracked.vstring(
0248             'ProductNotFound'
0249         )
0250 )