CMS 3D CMS Logo

hcalNano_cff.py
Go to the documentation of this file.
1 from PhysicsTools.NanoAOD.common_cff import Var,CandVars
5 
6 nanoMetadata = cms.EDProducer("UniqueStringProducer",
7  strings = cms.PSet(
8  tag = cms.string("untagged"),
9  )
10 )
11 
12 hcalNanoTask = cms.Task(
13  nanoMetadata,
14  hcalDetIdTableTask,
15  hcalDigiSortedTableTask,
16  hcalRecHitTableTask,
17 )
18 
19 hcalNanoDigiTask = cms.Task(
20  nanoMetadata,
21  hcalDetIdTableTask,
22  hcalDigiSortedTableTask,
23 )
24 
25 hcalNanoRecHitTask = cms.Task(
26  nanoMetadata,
27  hcalDetIdTableTask,
28  hcalRecHitTableTask,
29 )
30 
31 # Tasks for HCAL AlCa workflows
32 hcalNanoPhiSymTask = cms.Task(
33  nanoMetadata,
34  hcalDetIdTableTask,
35  hbheRecHitTable,
36  hfRecHitTable,
37 )
38 
39 hcalNanoIsoTrkTask = cms.Task(
40  nanoMetadata,
41  hcalDetIdTableTask,
42  hbheRecHitTable,
43 )
44 
45 # Customization for running on testEnablesEcalHcal
46 # - Call from cmsDriver.py with: `--customise DPGAnalysis/HcalNanoAOD/hcalNano_cff.customiseHcalCalib`
47 def customiseHcalCalib(process):
48  # Add uMNio digi (special digi identifies calib event type)
49  process.load("DPGAnalysis.HcalNanoAOD.hcalUMNioTable_cff")
50  process.hcalNanoTask.add(process.uMNioTable)
51  process.hcalNanoDigiTask.add(process.uMNioTable)
52 
53  # Raw data has a different name, hltHcalCalibrationRaw instead of rawDataCollector
54  process.hcalDigis.InputLabel = cms.InputTag('hltHcalCalibrationRaw')
55 
56  # Create EDFilter for HLT_HcalCalibration
57  # (HCAL raw data is not present in ECAL-triggered events, annoyingly. The filter stops downstream modules from throwing ProductNotFound.)
58  process.hcalCalibHLTFilter = cms.EDFilter("TriggerResultsFilter",
59  triggerConditions = cms.vstring(
60  'HLT_HcalCalibration_v* / 1'),
61  hltResults = cms.InputTag( "TriggerResults", "", "HLT" ),
62  l1tResults = cms.InputTag( "" ),
63  l1tIgnoreMask = cms.bool( False ),
64  l1techIgnorePrescales = cms.bool( False ),
65  daqPartitions = cms.uint32( 1 ),
66  throw = cms.bool( True )
67  )
68 
69  # Remove hcalDigis from normal raw2digi task, and put on a sequence after the HLT filter
70  process.RawToDigiTask.remove(process.hcalDigis)
71  process.hcalCalibDigiSequence = cms.Sequence(process.hcalCalibHLTFilter + process.hcalDigis)
72  process.raw2digi_step = cms.Path(process.hcalCalibDigiSequence, process.RawToDigiTask)
73 
74  # Insert the HLT filter at start of user path and nanoaod endpath
75  process.user_step.insert(0, process.hcalCalibHLTFilter)
76  process.NANOAODoutput_step.insert(0, process.hcalCalibHLTFilter)
77 
78  return process
79 
80 # Customization for running on HCAL local run data
81 # - Call from cmsDriver.py with: `--customise DPGAnalysis/HcalNanoAOD/customise_hcalLocal_cff.customiseHcalLocal`
82 def customiseHcalLocal(process):
83  input_files = process.source.fileNames
84  max_events = process.maxEvents.input
85  process.source = cms.Source("HcalTBSource",
86  fileNames = input_files,
87  maxEvents = max_events,
88  firstLuminosityBlockForEachRun = cms.untracked.VLuminosityBlockID([]),
89  )
90  process.hcalDigis.InputLabel = cms.InputTag('source')
91 
92  # Uncomment if ZDC digis (QIE10, nTS=10) are causing problems
93  #process.hcalDigis.saveQIE10DataNSamples = cms.untracked.vint32(10)
94  #process.hcalDigis.saveQIE10DataTags = cms.untracked.vstring("ZDC")
95 
96  if hasattr(process, "hcalDigiSortedTableTask"):
97  process.hcalDigiSortedTable.nTS_HB = cms.untracked.uint32(8)
98  process.hcalDigiSortedTable.nTS_HE = cms.untracked.uint32(8)
99  process.hcalDigiSortedTable.nTS_HF = cms.untracked.uint32(6)
100  process.hcalDigiSortedTable.nTS_HO = cms.untracked.uint32(10)
101 
102  process.load("DPGAnalysis.HcalNanoAOD.hcalUMNioTable_cff")
103  if hasattr(process, "hcalNanoTask"):
104  process.hcalNanoTask.add(process.uMNioTable)
105  if hasattr(process, "hcalNanoDigiTask"):
106  process.hcalNanoDigiTask.add(process.uMNioTable)
107 
108  return process
def customiseHcalCalib(process)
Definition: hcalNano_cff.py:47
def customiseHcalLocal(process)
Definition: hcalNano_cff.py:82