Skip to content

Commit

Permalink
Merge pull request cms-sw#56 from hqucms/dev/hgctb/hgcal-condformat-H…
Browse files Browse the repository at this point in the history
…GCalNANO-13_2_0_pre3__dqm

Update DQM to run with different types of modules
  • Loading branch information
pfs authored Sep 20, 2023
2 parents 0aab90c + 6345076 commit 02053be
Show file tree
Hide file tree
Showing 12 changed files with 538 additions and 562 deletions.
36 changes: 14 additions & 22 deletions DPGAnalysis/HGCalNanoAOD/test/tb_dqm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
process = cms.Process("TESTDQM")

options = VarParsing('analysis')
options.register('minEvents', 10000, VarParsing.multiplicity.singleton, VarParsing.varType.int, "min. events to process sequentially")
options.register('prescale', 1000, VarParsing.multiplicity.singleton, VarParsing.varType.int, "prescale every N events")
options.register('tbEra', 'default', VarParsing.multiplicity.singleton, VarParsing.varType.string, "test beam era")
options.register('minEvents', 10000, VarParsing.multiplicity.singleton,
VarParsing.varType.int, "min. events to process sequentially")
options.register('prescale', 1000, VarParsing.multiplicity.singleton, VarParsing.varType.int, "prescale every N events")
options.register('tbEra', 'default', VarParsing.multiplicity.singleton, VarParsing.varType.string, "test beam era")
options.parseArguments()


Expand All @@ -20,30 +21,21 @@
# Logical mapping
process.load('Geometry.HGCalMapping.hgCalModuleInfoESSource_cfi')
process.load('Geometry.HGCalMapping.hgCalSiModuleInfoESSource_cfi')
from DPGAnalysis.HGCalTools.tb2023_cfi import configTBConditions,addPerformanceReports
configTBConditions(process,key=options.tbEra)
addPerformanceReports(process)

process.hgCalDigisClient = cms.EDProducer(
'HGCalDigisClient',
Digis=cms.InputTag('hgcalDigis', ''),
FlaggedECONDInfo=cms.InputTag("hgcalDigis","UnpackerFlags"),
MetaData=cms.InputTag('hgcalEmulatedSlinkRawData', 'hgcalMetaData'),
ModuleMapping=cms.ESInputTag(''),
Prescale=cms.uint32(options.prescale),
MinimumNumEvents=cms.uint32(options.minEvents),
)
process.hgCalDigisClientHarvester = cms.EDProducer(
'HGCalDigisClientHarvester',
ModuleMapping=process.hgCalDigisClient.ModuleMapping,
HexTemplateFile=cms.string('/eos/cms/store/group/dpg_hgcal/comm_hgcal/ykao/hexagons_20230801.root'),
Level0CalibOut=cms.string('level0_calib_params.txt'),
)
# HGCal DQM
process.load('DQM.HGCal.hgCalDigisClient_cfi')
process.load('DQM.HGCal.hgCalDigisClientHarvester_cfi')
process.hgCalDigisClient.Prescale = options.prescale
process.hgCalDigisClient.MinimumNumEvents = options.minEvents

process.DQMStore = cms.Service("DQMStore")

process.load("DQMServices.FileIO.DQMFileSaverOnline_cfi")
process.dqmSaver.tag = 'HGCAL'

# path
process.p = cms.Path(process.hgCalDigisClient * process.hgCalDigisClientHarvester * process.dqmSaver)

# configure test beam conditions
from DPGAnalysis.HGCalTools.tb2023_cfi import configTBConditions, addPerformanceReports
configTBConditions(process, key=options.tbEra)
addPerformanceReports(process)
68 changes: 35 additions & 33 deletions DPGAnalysis/HGCalTools/python/tb2023_cfi.py
Original file line number Diff line number Diff line change
@@ -1,68 +1,70 @@
import FWCore.ParameterSet.Config as cms


def addPerformanceReports(process,addMemCheck=False):
def addPerformanceReports(process, addMemCheck=False):

#add timing and mem (too slow) for FWK jobs report
# add timing and mem (too slow) for FWK jobs report
process.Timing = cms.Service("Timing",
summaryOnly = cms.untracked.bool(True),
useJobReport = cms.untracked.bool(True))
summaryOnly=cms.untracked.bool(True),
useJobReport=cms.untracked.bool(True))


if addMemCheck:
process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",
ignoreTotal = cms.untracked.int32(1),
jobReportOutputOnly = cms.untracked.bool(True) )
ignoreTotal=cms.untracked.int32(1),
jobReportOutputOnly=cms.untracked.bool(True))

return process


def configTBConditions_default(process):
return configTBConditions(process,key='default')

return configTBConditions(process, key='default')


def configTBConditions_MLFL00041(process):
#cmsRun EventFilter/HGCalRawToDigi/test/tb_raw2reco.py mode=hgcmodule fedId=0 slinkBOE=0x2a cbHeaderMarker=0x0 econdHeaderMarker=0x154 ECONDsInPassthrough=0 activeECONDs=0 inputFiles=/eos/cms/store/group/dpg_hgcal/tb_hgcal/2023/BeamTestSep/SingleModuleTest/MLFL00041/position_scan/electron_200GeV/beam_run/run_20230914_153751/beam_run0_roc2root.root output=beam_run0_roc2root conditions=MLFL00041 runNumber=100000 maxEvents=1000000000 ECONDsInCharacterisation=0 numERxsPerECOND=6
return configTBConditions(process,key='MLFL00041')
# cmsRun EventFilter/HGCalRawToDigi/test/tb_raw2reco.py mode=hgcmodule fedId=0 slinkBOE=0x2a cbHeaderMarker=0x0 econdHeaderMarker=0x154 ECONDsInPassthrough=0 activeECONDs=0 inputFiles=/eos/cms/store/group/dpg_hgcal/tb_hgcal/2023/BeamTestSep/SingleModuleTest/MLFL00041/position_scan/electron_200GeV/beam_run/run_20230914_153751/beam_run0_roc2root.root output=beam_run0_roc2root conditions=MLFL00041 runNumber=100000 maxEvents=1000000000 ECONDsInCharacterisation=0 numERxsPerECOND=6
return configTBConditions(process, key='MLFL00041')


def configTBConditions_MLDSL57(process):
#cmsRun EventFilter/HGCalRawToDigi/test/tb_raw2reco.py mode=hgcmodule fedId=0 slinkBOE=0x2a cbHeaderMarker=0x0 econdHeaderMarker=0x154 ECONDsInPassthrough=0 activeECONDs=0 inputFiles=/eos/cms/store/group/dpg_hgcal/tb_hgcal/2023/BeamTestSep/SingleModuleTest/MLDSL57/position_scan/electrons_200GeV_x160_y160/beam_run/run_20230917_132125/beam_run52_roc2root.root output=beam_run52_roc2root conditions=MLDSL57 runNumber=100000 maxEvents=1000000000 ECONDsInCharacterisation=0 numERxsPerECOND=3
return configTBConditions(process,key='MLDSL57')
# cmsRun EventFilter/HGCalRawToDigi/test/tb_raw2reco.py mode=hgcmodule fedId=0 slinkBOE=0x2a cbHeaderMarker=0x0 econdHeaderMarker=0x154 ECONDsInPassthrough=0 activeECONDs=0 inputFiles=/eos/cms/store/group/dpg_hgcal/tb_hgcal/2023/BeamTestSep/SingleModuleTest/MLDSL57/position_scan/electrons_200GeV_x160_y160/beam_run/run_20230917_132125/beam_run52_roc2root.root output=beam_run52_roc2root conditions=MLDSL57 runNumber=100000 maxEvents=1000000000 ECONDsInCharacterisation=0 numERxsPerECOND=3
return configTBConditions(process, key='MLDSL57')


def configTBConditions_MLDSR01(process):
#cmsRun EventFilter/HGCalRawToDigi/test/tb_raw2reco.py mode=hgcmodule fedId=0 slinkBOE=0x2a cbHeaderMarker=0x0 econdHeaderMarker=0x154 ECONDsInPassthrough=0 activeECONDs=0 inputFiles=/eos/cms/store/group/dpg_hgcal/tb_hgcal/2023/BeamTestSep/SingleModuleTest/MLDSR01/position_scan/electrons_200GeV_x160_y160/beam_run/run_20230917_131055/beam_run0_roc2root.root output=beam_run0_roc2root.root conditions=MLDSR01 runNumber=100000 maxEvents=1000000000 ECONDsInCharacterisation=0 numERxsPerECOND=3
return configTBConditions(process,key='MLDSR01')
# cmsRun EventFilter/HGCalRawToDigi/test/tb_raw2reco.py mode=hgcmodule fedId=0 slinkBOE=0x2a cbHeaderMarker=0x0 econdHeaderMarker=0x154 ECONDsInPassthrough=0 activeECONDs=0 inputFiles=/eos/cms/store/group/dpg_hgcal/tb_hgcal/2023/BeamTestSep/SingleModuleTest/MLDSR01/position_scan/electrons_200GeV_x160_y160/beam_run/run_20230917_131055/beam_run0_roc2root.root output=beam_run0_roc2root.root conditions=MLDSR01 runNumber=100000 maxEvents=1000000000 ECONDsInCharacterisation=0 numERxsPerECOND=3
return configTBConditions(process, key='MLDSR01')


def configTBConditions_MHFL00056(process):
#cmsRun EventFilter/HGCalRawToDigi/test/tb_raw2reco.py mode=hgcmodule fedId=0 slinkBOE=0x2a cbHeaderMarker=0x0 econdHeaderMarker=0x154 ECONDsInPassthrough=0 activeECONDs=0 inputFiles=/eos/cms/store/group/dpg_hgcal/tb_hgcal/2023/BeamTestSep/SingleModuleTest/MHFL00056/position_scan/electron_200GeV_x160_y170/beam_run/run_20230915_154222/beam_run0_roc2root.root output=beam_run0_roc2root.root conditions=MHFL00056 runNumber=100000 maxEvents=1000000000 ECONDsInCharacterisation=0 numERxsPerECOND=12
return configTBConditions(process,key='MHFL00056')
# cmsRun EventFilter/HGCalRawToDigi/test/tb_raw2reco.py mode=hgcmodule fedId=0 slinkBOE=0x2a cbHeaderMarker=0x0 econdHeaderMarker=0x154 ECONDsInPassthrough=0 activeECONDs=0 inputFiles=/eos/cms/store/group/dpg_hgcal/tb_hgcal/2023/BeamTestSep/SingleModuleTest/MHFL00056/position_scan/electron_200GeV_x160_y170/beam_run/run_20230915_154222/beam_run0_roc2root.root output=beam_run0_roc2root.root conditions=MHFL00056 runNumber=100000 maxEvents=1000000000 ECONDsInCharacterisation=0 numERxsPerECOND=12
return configTBConditions(process, key='MHFL00056')

def configTBConditions(process,key='default'):

def configTBConditions(process, key='default'):
""" maybe here we should also set the emulator/unpacker configs in case they are in the process (see comments in the methods above) """



modulelocator_dict = {
'default':'Geometry/HGCalMapping/data/modulelocator_tb.txt',
'MLFL00041':'Geometry/HGCalMapping/data/modulelocator_tb_MLFL00041.txt',
'MLDSL57':'Geometry/HGCalMapping/data/modulelocator_tb_MLDSL57.txt',
'MLDSR01':'Geometry/HGCalMapping/data/modulelocator_tb_MLDSR01.txt',
'MHFL00056':'Geometry/HGCalMapping/data/modulelocator_tb_MHFL00056.txt',
'default': 'Geometry/HGCalMapping/data/modulelocator_tb.txt',
'MLFL00041': 'Geometry/HGCalMapping/data/modulelocator_tb_MLFL00041.txt',
'MLDSL57': 'Geometry/HGCalMapping/data/modulelocator_tb_MLDSL57.txt',
'MLDSR01': 'Geometry/HGCalMapping/data/modulelocator_tb_MLDSR01.txt',
'MHFL00056': 'Geometry/HGCalMapping/data/modulelocator_tb_MHFL00056.txt',
}
modulelocator = modulelocator_dict[key] if key in modulelocator_dict else modulelocator_dict['default']

process.hgCalModuleInfoESSource.filename = modulelocator
process.hgCalSiModuleInfoESSource.filename = 'Geometry/HGCalMapping/data/WaferCellMapTraces.txt'

pedestals_dict = {
'default': '/eos/cms/store/group/dpg_hgcal/comm_hgcal/ykao/calibration_parameters_v2.txt',
}
pedestals = pedestals_dict[key] if key in pedestals_dict else pedestals_dict['default']
if hasattr(process,'hgCalPedestalsESSource'):

if hasattr(process, 'hgCalPedestalsESSource'):
process.hgCalPedestalsESSource.filename = pedestals
if hasattr(process,'hgcalCalibESProducer'):
if hasattr(process, 'hgcalCalibESProducer'):
process.hgcalCalibESProducer.filename = pedestals
###if hasattr(process,'hgcalConfigurationESProducer'):
# if hasattr(process,'hgcalConfigurationESProducer'):
### process.hgcalConfigurationESProducer.filename = yamls[key]

return process
Loading

0 comments on commit 02053be

Please sign in to comment.