Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 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.nanoAOD_step.insert(0, process.hcalCalibHLTFilter)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a safer way, IMO, would be to list of path of the process and insert the filter in first position, instead of calling explicitly nanoAOD_step and NANOAODoutput_step without checking their existence in the process

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to work when I replace that line with:

process.paths.values()[0].insert(0, process.hcalCalibHLTFilter)

Does that seem reasonable to you? Or is there a more preferred way to do this? (I don't see this trick anywhere else in CMSSW with an LXR search...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like

for path in self.process.paths:
     path.insert(0,process.hcalCalibHLTFilter)

I think. and verify that it does prepend it to the output path too at the next line

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 = ["*"]

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