test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HCalCustoms.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 def customise_HcalPhase0(process):
4  process.load("CalibCalorimetry/HcalPlugins/Hcal_Conditions_forGlobalTag_cff")
5 
6  if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process.mix.digitizers,'hcal'):
7  process.mix.digitizers.hcal.TestNumbering=True
8 
9  process.es_hardcode.HEreCalibCutoff = cms.double(20.) #for aging
10 
11  process.es_hardcode.toGet = cms.untracked.vstring(
12  'GainWidths',
13  'RespCorrs'
14  )
15 
16 
17  if hasattr(process,'g4SimHits'):
18  process=customise_Sim(process)
19  if hasattr(process,'validation_step'):
20  process=customise_Validation(process)
21 
22  return process
23 
24 #common stuff
25 def load_HcalHardcode(process):
26  process.load("CalibCalorimetry/HcalPlugins/Hcal_Conditions_forGlobalTag_cff")
27  process.es_hardcode.toGet = cms.untracked.vstring(
28  'GainWidths',
29  'MCParams',
30  'RecoParams',
31  'RespCorrs',
32  'QIEData',
33  'QIETypes',
34  'Gains',
35  'Pedestals',
36  'PedestalWidths',
37  'ChannelQuality',
38  'ZSThresholds',
39  'TimeCorrs',
40  'LUTCorrs',
41  'LutMetadata',
42  'L1TriggerObjects',
43  'PFCorrs',
44  'ElectronicsMap',
45  'FrontEndMap',
46  'CovarianceMatrices',
47  'SiPMParameters',
48  'SiPMCharacteristics',
49  'TPChannelParameters',
50  'TPParameters',
51  'FlagHFDigiTimeParams',
52  )
53 
54  # Special Upgrade trick (if absent - regular case assumed)
55  process.es_hardcode.GainWidthsForTrigPrims = cms.bool(True)
56 
57  return process
58 
59 #intermediate customization (HF 2016 upgrades)
60 def customise_Hcal2016(process):
61  process=load_HcalHardcode(process)
62 
63  #for now, use HE run1 conditions - SiPM/QIE11 not ready
64  process.es_hardcode.testHFQIE10 = cms.bool(True)
65 
66  # to get reco to run
67  if hasattr(process,'reconstruction_step'):
68  process.hbheprereco.setNoiseFlags = cms.bool(False)
69 
70  return process
71 
72 #intermediate customization (HCAL 2017, HE and HF upgrades - no SiPMs or QIE11)
73 def customise_Hcal2017(process):
74  process=load_HcalHardcode(process)
75 
76  #for now, use HE run1 conditions - SiPM/QIE11 not ready
77  process.es_hardcode.useHFUpgrade = cms.bool(True)
78 
79  # to get reco to run
80  if hasattr(process,'DigiToRaw'):
81  process=customise_DigiToRaw(process)
82  if hasattr(process,'RawToDigi'):
83  process=customise_RawToDigi(process)
84  if hasattr(process,'reconstruction_step'):
85  process.hbheprereco.digiLabel = cms.InputTag("simHcalDigis")
86  process.hbheprereco.setNoiseFlags = cms.bool(False)
87  # process.hbheprereco.puCorrMethod = cms.int32(0)
88  process.horeco.digiLabel = cms.InputTag("simHcalDigis")
89  process.zdcreco.digiLabel = cms.InputTag("simHcalUnsuppressedDigis")
90  process.zdcreco.digiLabelhcal = cms.InputTag("simHcalUnsuppressedDigis")
91  process.hcalnoise.digiCollName = cms.string('simHcalDigis')
92  process.load("RecoLocalCalo.HcalRecProducers.hfprereco_cfi")
93  process.hfprereco.digiLabel = cms.InputTag("simHcalDigis", "HFQIE10DigiCollection")
94  process.localreco += process.hfprereco
95  from RecoLocalCalo.HcalRecProducers.HFPhase1Reconstructor_cfi import hfreco
96  process.globalReplace("hfreco", hfreco)
97  if hasattr(process,'datamixing_step'):
98  process=customise_mixing(process)
99  if hasattr(process,'simHcalTriggerPrimitiveDigis'):
100  process.simHcalTriggerPrimitiveDigis.upgradeHF = cms.bool(True)
101  if hasattr(process,'dqmoffline_step'):
102  process.digiTask.tagHBHE = cms.untracked.InputTag("simHcalDigis")
103  process.digiTask.tagHF = cms.untracked.InputTag("simHcalDigis")
104  process.digiTask.tagHO = cms.untracked.InputTag("simHcalDigis")
105 
106  #add phase1 digi task
107  process.load('DQM.HcalTasks.DigiPhase1Task')
108  process.dqmoffline_step += process.digiPhase1Task
109  process.digiPhase1Task.tagHBHE = cms.untracked.InputTag("simHcalDigis","HBHEQIE11DigiCollection")
110  process.digiPhase1Task.tagHO = cms.untracked.InputTag("simHcalDigis")
111  process.digiPhase1Task.tagHF = cms.untracked.InputTag("simHcalDigis","HFQIE10DigiCollection")
112 
113  if hasattr(process,'validation_step'):
114  process.AllHcalDigisValidation.digiLabel = cms.string("simHcalDigis")
115 
116  return process
117 
118 #intermediate customization (HCAL 2017, HE and HF upgrades - w/ SiPMs & QIE11)
120  process=customise_Hcal2017(process)
121 
122  #use HE phase1 conditions - test SiPM/QIE11
123  process.es_hardcode.useHEUpgrade = cms.bool(True)
124 
125  if hasattr(process,'reconstruction_step'):
126  # Customise HB/HE reco
127  from RecoLocalCalo.HcalRecProducers.HBHEPhase1Reconstructor_cfi import hbheprereco
128  process.globalReplace("hbheprereco", hbheprereco)
129  process.hbheprereco.saveInfos = cms.bool(True)
130  process.hbheprereco.digiLabelQIE8 = cms.InputTag("simHcalDigis")
131  process.hbheprereco.digiLabelQIE11 = cms.InputTag("simHcalDigis", "HBHEQIE11DigiCollection")
132 
133  if hasattr(process,'simHcalTriggerPrimitiveDigis'):
134  process.simHcalTriggerPrimitiveDigis.upgradeHE = cms.bool(True)
135 
136  return process
137 
138 def customise_HcalPhase1(process):
139  process=load_HcalHardcode(process)
140 
141  process.es_hardcode.HEreCalibCutoff = cms.double(100.) #for aging
142  process.es_hardcode.useHBUpgrade = cms.bool(True)
143  process.es_hardcode.useHEUpgrade = cms.bool(True)
144  process.es_hardcode.useHFUpgrade = cms.bool(True)
145 
146  if hasattr(process,'g4SimHits'):
147  process=customise_Sim(process)
148  if hasattr(process,'DigiToRaw'):
149  process=customise_DigiToRaw(process)
150  if hasattr(process,'RawToDigi'):
151  process=customise_RawToDigi(process)
152  if hasattr(process,'digitisation_step'):
153  process=customise_Digi(process)
154  if hasattr(process,'reconstruction_step'):
155  process=customise_Reco(process)
156  if hasattr(process,'dqmoffline_step'):
157  process=customise_DQM(process)
158  if hasattr(process,'dqmHarvesting'):
159  process=customise_harvesting(process)
160  if hasattr(process,'validation_step'):
161  process=customise_Validation(process)
162  if hasattr(process,'simHcalTriggerPrimitiveDigis'):
163  process.simHcalTriggerPrimitiveDigis.upgradeHF = cms.bool(True)
164  process.simHcalTriggerPrimitiveDigis.upgradeHE = cms.bool(True)
165  process.simHcalTriggerPrimitiveDigis.upgradeHB = cms.bool(True)
166  process=customise_condOverRides(process)
167  return process
168 
169 
170 def customise_Sim(process):
171  process.g4SimHits.HCalSD.TestNumberingScheme = True
172 
173  return process
174 
175 def customise_DigiToRaw(process):
176  process.digi2raw_step.remove(process.hcalRawData)
177 
178  return process
179 
180 def customise_RawToDigi(process):
181  process.raw2digi_step.remove(process.hcalDigis)
182 
183  return process
184 
185 def customise_Digi(process):
186  if hasattr(process,'mix'):
187  process.mix.digitizers.hcal.HBHEUpgradeQIE = True
188  process.mix.digitizers.hcal.hb.photoelectronsToAnalog = cms.vdouble([10.]*16)
189  process.mix.digitizers.hcal.hb.pixels = cms.int32(4500*4*2)
190  process.mix.digitizers.hcal.he.photoelectronsToAnalog = cms.vdouble([10.]*16)
191  process.mix.digitizers.hcal.he.pixels = cms.int32(4500*4*2)
192  process.mix.digitizers.hcal.HFUpgradeQIE = True
193  process.mix.digitizers.hcal.TestNumbering = True
194 
195  if hasattr(process,'simHcalDigis'):
196  process.simHcalDigis.useConfigZSvalues=cms.int32(1)
197  process.simHcalDigis.HBlevel=cms.int32(16)
198  process.simHcalDigis.HElevel=cms.int32(16)
199  process.simHcalDigis.HOlevel=cms.int32(16)
200  process.simHcalDigis.HFlevel=cms.int32(16)
201 
202  process.digitisation_step.remove(process.simHcalTriggerPrimitiveDigis)
203  process.digitisation_step.remove(process.simHcalTTPDigis)
204 
205  return process
206 
207 def customise_Reco(process):
208  # not sure why these are missing - but need to investigate later
209  process.reconstruction_step.remove(process.castorreco)
210  process.reconstruction_step.remove(process.CastorTowerReco)
211  process.reconstruction_step.remove(process.ak7CastorJets)
212  process.reconstruction_step.remove(process.ak7CastorJetID)
213  return process
214 
215 def customise_DQM(process):
216  process.dqmoffline_step.remove(process.hcalDigiMonitor)
217  process.dqmoffline_step.remove(process.hcalDeadCellMonitor)
218  process.dqmoffline_step.remove(process.hcalBeamMonitor)
219  process.dqmoffline_step.remove(process.hcalRecHitMonitor)
220  process.dqmoffline_step.remove(process.hcalDetDiagNoiseMonitor)
221  process.dqmoffline_step.remove(process.hcalNoiseMonitor)
222  process.dqmoffline_step.remove(process.RecHitsDQMOffline)
223  process.dqmoffline_step.remove(process.zdcMonitor)
224  process.dqmoffline_step.remove(process.hcalMonitor)
225  process.dqmoffline_step.remove(process.hcalHotCellMonitor)
226  process.dqmoffline_step.remove(process.hcalRawDataMonitor)
227  return process
228 
229 def customise_harvesting(process):
230  return process
231 
232 def customise_Validation(process):
233  process.validation_step.remove(process.AllHcalDigisValidation)
234  process.validation_step.remove(process.RecHitsValidation)
235  process.validation_step.remove(process.globalhitsanalyze)
236  return process
237 
239  return process
240 
241 def customise_mixing(process):
242  process.mixData.HBHEPileInputTag = cms.InputTag("simHcalUnsuppressedDigis")
243  process.mixData.HOPileInputTag = cms.InputTag("simHcalUnsuppressedDigis")
244  process.mixData.HFPileInputTag = cms.InputTag("simHcalUnsuppressedDigis")
245  process.mixData.QIE10PileInputTag = cms.InputTag("simHcalUnsuppressedDigis","HFQIE10DigiCollection")
246  process.mixData.QIE11PileInputTag = cms.InputTag("simHcalUnsuppressedDigis","HBHEQIE11DigiCollection")
247  return process
def customise_Hcal2017
Definition: HCalCustoms.py:73
def customise_Validation
Definition: HCalCustoms.py:232
def customise_mixing
Definition: HCalCustoms.py:241
def customise_HcalPhase0
Definition: HCalCustoms.py:3
def customise_Hcal2017Full
Definition: HCalCustoms.py:119
def customise_harvesting
Definition: HCalCustoms.py:229
def customise_DQM
Definition: HCalCustoms.py:215
def load_HcalHardcode
Definition: HCalCustoms.py:25
def customise_HcalPhase1
Definition: HCalCustoms.py:138
def customise_Sim
Definition: HCalCustoms.py:170
def customise_Hcal2016
Definition: HCalCustoms.py:60
def customise_DigiToRaw
Definition: HCalCustoms.py:175
def customise_RawToDigi
Definition: HCalCustoms.py:180
def customise_Digi
Definition: HCalCustoms.py:185
def customise_Reco
Definition: HCalCustoms.py:207
def customise_condOverRides
Definition: HCalCustoms.py:238