CMS 3D CMS Logo

customiseHcalCalib_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # Customization for running on testEnablesEcalHcal
4 # - Call from cmsDriver.py with: `--customise DPGAnalysis/HcalNanoAOD/customiseHcalCalib_cff.customiseHcalCalib`
5 def customiseHcalCalib(process):
6  # Add uMNio digi (special digi identifies calib event type)
7  process.load("DPGAnalysis.HcalNanoAOD.hcalUMNioTable_cff")
8  process.hcalNanoTask.add(process.uMNioTable)
9  process.hcalNanoDigiTask.add(process.uMNioTable)
10 
11  process.load("DPGAnalysis.HcalNanoAOD.hcalUHTRTable_cff")
12  process.hcalNanoTask.add(process.uHTRTable)
13  process.hcalNanoDigiTask.add(process.uHTRTable)
14 
15  # Raw data has a different name, hltHcalCalibrationRaw instead of rawDataCollector
16  process.hcalDigis.InputLabel = cms.InputTag('hltHcalCalibrationRaw')
17  process.uHTRTable.InputLabel = process.hcalDigis.InputLabel
18 
19  # Create EDFilter for HLT_HcalCalibration
20  # (HCAL raw data is not present in ECAL-triggered events, annoyingly. The filter stops downstream modules from throwing ProductNotFound.)
21  process.hcalCalibHLTFilter = cms.EDFilter("TriggerResultsFilter",
22  triggerConditions = cms.vstring(
23  'HLT_HcalCalibration_v* / 1'),
24  hltResults = cms.InputTag( "TriggerResults", "", "HLT" ),
25  l1tResults = cms.InputTag( "" ),
26  l1tIgnoreMask = cms.bool( False ),
27  l1techIgnorePrescales = cms.bool( False ),
28  daqPartitions = cms.uint32( 1 ),
29  throw = cms.bool( True )
30  )
31 
32  # Remove hcalDigis from normal raw2digi task, and put on a sequence after the HLT filter
33  process.RawToDigiTask.remove(process.hcalDigis)
34  process.hcalCalibDigiSequence = cms.Sequence(process.hcalCalibHLTFilter + process.hcalDigis)
35  process.raw2digi_step = cms.Path(process.hcalCalibDigiSequence, process.RawToDigiTask)
36 
37  # Insert the HLT filter at start of user path and nanoaod endpath
38  for path in process.paths.values()+process.endpaths.values():
39  path.insert(0, process.hcalCalibHLTFilter)
40 
41  return process