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  process.user_step.insert(0, process.hcalCalibHLTFilter)
39  process.NANOAODoutput_step.insert(0, process.hcalCalibHLTFilter)
40 
41 
42  #process.raw2digi_step = cms.Path(process.hcalCalibHLTFilter + process.RawToDigi)
43  #process.raw2digi_step.replace(process.hcalDigis, process.hcalCalibDigis)
44  #process.hcalDigiSortedTableTask.add(process.hcalCalibDigis)
45  #process.hcalDigiSortedTableSeq.add(process.hcalCalibDigis)
46 
47  #process.options.SkipEvent.append('ProductNotFound')
48 
49  #process.hcalDigiSortedTable.tagQIE11 = cms.untracked.InputTag("hcalCalibDigis")
50  #process.hcalDigiSortedTable.tagQIE10 = cms.untracked.InputTag("hcalCalibDigis")
51  #process.hcalDigiSortedTable.tagHO = cms.untracked.InputTag("hcalCalibDigis")
52 
53  process.load("FWCore.MessageService.MessageLogger_cfi")
54  process.MessageLogger.cout.threshold = "DEBUG"
55  process.MessageLogger.cerr.threshold = "DEBUG"
56  # enable LogDebug messages only for specific modules
57  process.MessageLogger.debugModules = ["*"]
58 
59  return process