Skip to content

Commit

Permalink
Merge pull request #45561 from jhakala/cleanup-hcalNano
Browse files Browse the repository at this point in the history
remove redundant customizations in HcalNano
  • Loading branch information
cmsbuild authored Jul 31, 2024
2 parents ba2fbc5 + 510fdf2 commit a3b4557
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 87 deletions.
22 changes: 2 additions & 20 deletions DPGAnalysis/HcalNanoAOD/python/customiseHcalCalib_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,7 @@ def customiseHcalCalib(process):
process.raw2digi_step = cms.Path(process.hcalCalibDigiSequence, process.RawToDigiTask)

# Insert the HLT filter at start of user path and nanoaod endpath
process.user_step.insert(0, process.hcalCalibHLTFilter)
process.NANOAODoutput_step.insert(0, process.hcalCalibHLTFilter)


#process.raw2digi_step = cms.Path(process.hcalCalibHLTFilter + process.RawToDigi)
#process.raw2digi_step.replace(process.hcalDigis, process.hcalCalibDigis)
#process.hcalDigiSortedTableTask.add(process.hcalCalibDigis)
#process.hcalDigiSortedTableSeq.add(process.hcalCalibDigis)

#process.options.SkipEvent.append('ProductNotFound')

#process.hcalDigiSortedTable.tagQIE11 = cms.untracked.InputTag("hcalCalibDigis")
#process.hcalDigiSortedTable.tagQIE10 = cms.untracked.InputTag("hcalCalibDigis")
#process.hcalDigiSortedTable.tagHO = cms.untracked.InputTag("hcalCalibDigis")

process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger.cout.threshold = "DEBUG"
process.MessageLogger.cerr.threshold = "DEBUG"
# enable LogDebug messages only for specific modules
process.MessageLogger.debugModules = ["*"]
for path in process.paths.values()+process.endpaths.values():
path.insert(0, process.hcalCalibHLTFilter)

return process
4 changes: 3 additions & 1 deletion DPGAnalysis/HcalNanoAOD/python/customiseHcalLocal_cff.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

# Customization for running on HCAL local run data
# - Call from cmsDriver.py with: `--customise DPGAnalysis/HcalNanoAOD/customise_hcalLocal_cff.customiseHcalLocal`
# - Call from cmsDriver.py with: `--customise DPGAnalysis/HcalNanoAOD/customiseHcalLocal_cff.customiseHcalLocal`
def customiseHcalLocal(process):
input_files = process.source.fileNames
max_events = process.maxEvents.input
Expand All @@ -11,6 +11,8 @@ def customiseHcalLocal(process):
firstLuminosityBlockForEachRun = cms.untracked.VLuminosityBlockID([]),
)
process.hcalDigis.InputLabel = cms.InputTag('source')

# Uncomment if ZDC digis (QIE10, nTS=10) are causing problems
#process.hcalDigis.saveQIE10DataNSamples = cms.untracked.vint32(10)
#process.hcalDigis.saveQIE10DataTags = cms.untracked.vstring("ZDC")

Expand Down
65 changes: 0 additions & 65 deletions DPGAnalysis/HcalNanoAOD/python/hcalNano_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,68 +41,3 @@
hcalDetIdTableTask,
hbheRecHitTable,
)

# Customization for running on testEnablesEcalHcal
# - Call from cmsDriver.py with: `--customise DPGAnalysis/HcalNanoAOD/hcalNano_cff.customiseHcalCalib`
def customiseHcalCalib(process):
# Add uMNio digi (special digi identifies calib event type)
process.load("DPGAnalysis.HcalNanoAOD.hcalUMNioTable_cff")
process.hcalNanoTask.add(process.uMNioTable)
process.hcalNanoDigiTask.add(process.uMNioTable)

# Raw data has a different name, hltHcalCalibrationRaw instead of rawDataCollector
process.hcalDigis.InputLabel = cms.InputTag('hltHcalCalibrationRaw')

# Create EDFilter for HLT_HcalCalibration
# (HCAL raw data is not present in ECAL-triggered events, annoyingly. The filter stops downstream modules from throwing ProductNotFound.)
process.hcalCalibHLTFilter = cms.EDFilter("TriggerResultsFilter",
triggerConditions = cms.vstring(
'HLT_HcalCalibration_v* / 1'),
hltResults = cms.InputTag( "TriggerResults", "", "HLT" ),
l1tResults = cms.InputTag( "" ),
l1tIgnoreMask = cms.bool( False ),
l1techIgnorePrescales = cms.bool( False ),
daqPartitions = cms.uint32( 1 ),
throw = cms.bool( True )
)

# Remove hcalDigis from normal raw2digi task, and put on a sequence after the HLT filter
process.RawToDigiTask.remove(process.hcalDigis)
process.hcalCalibDigiSequence = cms.Sequence(process.hcalCalibHLTFilter + process.hcalDigis)
process.raw2digi_step = cms.Path(process.hcalCalibDigiSequence, process.RawToDigiTask)

# Insert the HLT filter at start of user path and nanoaod endpath
process.nanoAOD_step.insert(0, process.hcalCalibHLTFilter)
process.NANOAODoutput_step.insert(0, process.hcalCalibHLTFilter)

return process

# Customization for running on HCAL local run data
# - Call from cmsDriver.py with: `--customise DPGAnalysis/HcalNanoAOD/customise_hcalLocal_cff.customiseHcalLocal`
def customiseHcalLocal(process):
input_files = process.source.fileNames
max_events = process.maxEvents.input
process.source = cms.Source("HcalTBSource",
fileNames = input_files,
maxEvents = max_events,
firstLuminosityBlockForEachRun = cms.untracked.VLuminosityBlockID([]),
)
process.hcalDigis.InputLabel = cms.InputTag('source')

# Uncomment if ZDC digis (QIE10, nTS=10) are causing problems
#process.hcalDigis.saveQIE10DataNSamples = cms.untracked.vint32(10)
#process.hcalDigis.saveQIE10DataTags = cms.untracked.vstring("ZDC")

if hasattr(process, "hcalDigiSortedTableTask"):
process.hcalDigiSortedTable.nTS_HB = cms.untracked.uint32(8)
process.hcalDigiSortedTable.nTS_HE = cms.untracked.uint32(8)
process.hcalDigiSortedTable.nTS_HF = cms.untracked.uint32(6)
process.hcalDigiSortedTable.nTS_HO = cms.untracked.uint32(10)

process.load("DPGAnalysis.HcalNanoAOD.hcalUMNioTable_cff")
if hasattr(process, "hcalNanoTask"):
process.hcalNanoTask.add(process.uMNioTable)
if hasattr(process, "hcalNanoDigiTask"):
process.hcalNanoDigiTask.add(process.uMNioTable)

return process
2 changes: 1 addition & 1 deletion PhysicsTools/NanoAOD/python/autoNANO.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def expandNanoMapping(seqList, mapping, key):
# HCAL flavors:
'HCAL': {'sequence': 'DPGAnalysis/HcalNanoAOD/hcalNano_cff.hcalNanoTask'},
'HCALCalib': {'sequence': 'DPGAnalysis/HcalNanoAOD/hcalNano_cff.hcalNanoTask',
'customize': 'DPGAnalysis/HcalNanoAOD/hcalNano_cff.customiseHcalCalib'},
'customize': 'DPGAnalysis/HcalNanoAOD/customiseHcalCalib_cff.customiseHcalCalib'},
# EGM flavours: add variables through customize
'EGM': {'sequence': '@PHYS',
'customize': '@PHYS+PhysicsTools/NanoAOD/egamma_custom_cff.addExtraEGammaVarsCustomize'},
Expand Down

0 comments on commit a3b4557

Please sign in to comment.