-
Notifications
You must be signed in to change notification settings - Fork 4.4k
/
Copy pathRecoTLR.py
256 lines (201 loc) · 9.37 KB
/
RecoTLR.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
from __future__ import print_function
import FWCore.ParameterSet.Config as cms
##############################################################################
# common utilities
##############################################################################
def _swapOfflineBSwithOnline(process):
from RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi import onlineBeamSpotProducer
process.offlineBeamSpot = onlineBeamSpotProducer.clone()
return process
def _addLumiProducer(process):
if not hasattr(process,'lumiProducer'):
#unscheduled..
from RecoLuminosity.LumiProducer.lumiProducer_cff import lumiProducer,LumiDBService
process.lumiProducer=lumiProducer
#if it's scheduled
if hasattr(process, 'reconstruction_step'):
process.reconstruction_step+=process.lumiProducer
return process
def _overridesFor50ns(process):
process.bunchSpacingProducer.bunchSpacingOverride = cms.uint32(50)
process.bunchSpacingProducer.overrideBunchSpacing = cms.bool(True)
return process
##############################################################################
# post-era customizations
# these are here instead of generating Data-specific eras
##############################################################################
def _hcalCustoms25ns(process):
import RecoLocalCalo.HcalRecAlgos.RemoveAddSevLevel as HcalRemoveAddSevLevel
HcalRemoveAddSevLevel.AddFlag(process.hcalRecAlgos,"HFDigiTime",8)
HcalRemoveAddSevLevel.AddFlag(process.hcalRecAlgos,"HBHEFlatNoise",8)
return process
def customisePostEra_Run2_25ns(process):
_hcalCustoms25ns(process)
return process
def customisePostEra_Run2_2016(process):
_hcalCustoms25ns(process)
return process
def customisePostEra_Run2_2017(process):
import RecoLocalCalo.HcalRecAlgos.RemoveAddSevLevel as HcalRemoveAddSevLevel
HcalRemoveAddSevLevel.AddFlag(process.hcalRecAlgos,"HBHEFlatNoise",8)
HcalRemoveAddSevLevel.RemoveFlag(process.hcalRecAlgos,"HFDigiTime")
return process
def customisePostEra_Run2_2017_express_trackingOnly(process):
customisePostEra_Run2_2017(process)
from Calibration.TkAlCaRecoProducers.PCLHPbeamspot_custom import customise_HPbeamspot as _customise_HPbeamspot
_customise_HPbeamspot(process)
return process
def customisePostEra_Run2_2017_harvesting_trackingOnly(process):
from Calibration.TkAlCaRecoProducers.PCLHPbeamspot_custom import customise_HPbeamspot as _customise_HPbeamspot
_customise_HPbeamspot(process)
return process
def customisePostEra_Run2_2017_pp_on_XeXe(process):
customisePostEra_Run2_2017(process)
return process
def customisePostEra_Run2_2017_ppRef(process):
customisePostEra_Run2_2017(process)
return process
# 2018 equivalents
def customisePostEra_Run2_2018(process):
#start with a repeat of 2017
customisePostEra_Run2_2017(process)
return process
def customisePostEra_Run2_2018_express_trackingOnly(process):
#start with a repeat of 2017
customisePostEra_Run2_2017_express_trackingOnly(process)
return process
def customisePostEra_Run2_2018_harvesting_trackingOnly(process):
#start with a repeat of 2017
customisePostEra_Run2_2017_harvesting_trackingOnly(process)
return process
def customise_HI_PostEra_Run2_2018(process):
customisePostEra_Run2_2018(process)
return process
def customisePostEra_Run2_2018_pp_on_AA(process):
customisePostEra_Run2_2018(process)
return process
def customisePostEra_Run2_2018_pp_on_AA_express_trackingOnly(process):
customisePostEra_Run2_2018_express_trackingOnly(process)
from DQM.TrackingMonitorSource.PPonAATrackingOnly_custom import customise_PPonAATrackingOnlyDQM as _customise_PPonAATrackingOnlyDQM
_customise_PPonAATrackingOnlyDQM(process)
return process
# 2021 equivalents
def customise2021(process):
import RecoLocalCalo.HcalRecAlgos.RemoveAddSevLevel as HcalRemoveAddSevLevel
HcalRemoveAddSevLevel.AddFlag(process.hcalRecAlgos,"HBHENegativeNoise",8)
return process
def customisePostEra_Run3(process):
#start with a repeat of 2018
customisePostEra_Run2_2018(process)
#add Run3 setting
customise2021(process)
return process
def customisePostEra_Run3_express_trackingOnly(process):
#start with a repeat of 2018
customisePostEra_Run2_2018_express_trackingOnly(process)
#add Run3 setting
customise2021(process)
return process
##############################################################################
def customisePPData(process):
#deprecated process= customiseCommon(process)
##all customisation for data are now deprecated to Reconstruction_Data_cff
#left as a place holder to alter production sequences in case of emergencies
return process
##############################################################################
def customisePPMC(process):
#deprecated process=customiseCommon(process)
#left as a place holder to alter production sequences in case of emergencies
return process
##############################################################################
def customiseCosmicData(process):
return process
##############################################################################
def customiseCosmicMC(process):
return process
##############################################################################
def customiseVALSKIM(process):
print("WARNING")
print("this method is outdated, please use RecoTLR.customisePPData")
process= customisePPData(process)
return process
##############################################################################
def customiseExpress(process):
process= customisePPData(process)
process = _swapOfflineBSwithOnline(process)
return process
##############################################################################
def customisePrompt(process):
process= customisePPData(process)
process = _addLumiProducer(process)
return process
##############################################################################
# Heavy Ions
##############################################################################
# keep it in case modification is needed
def customiseCommonHI(process):
return process
##############################################################################
def customiseExpressHI(process):
process = customiseCommonHI(process)
process = _swapOfflineBSwithOnline(process)
return process
##############################################################################
def customisePromptHI(process):
process = customiseCommonHI(process)
process = _addLumiProducer(process)
return process
##############################################################################
##############################################################################
##
## ALL FUNCTIONS BELOW ARE GOING TO BE REMOVED IN 81X
##
##############################################################################
##############################################################################
# this is supposed to be added on top of other (Run1) data customs
def customiseDataRun2Common(process):
from SLHCUpgradeSimulations.Configuration.muonCustoms import unganged_me1a_geometry,customise_csc_LocalReco
process = unganged_me1a_geometry(process)
process = customise_csc_LocalReco(process)
if hasattr(process,'valCscTriggerPrimitiveDigis'):
#this is not doing anything at the moment
process.valCscTriggerPrimitiveDigis.commonParam.gangedME1a = cms.bool(False)
if hasattr(process,'valCsctfTrackDigis'):
process.valCsctfTrackDigis.gangedME1a = cms.untracked.bool(False)
from SLHCUpgradeSimulations.Configuration.postLS1Customs import customise_Reco,customise_RawToDigi,customise_DQM
if hasattr(process,'RawToDigi'):
process=customise_RawToDigi(process)
if hasattr(process,'reconstruction'):
process=customise_Reco(process)
if hasattr(process,'dqmoffline_step'):
process=customise_DQM(process)
return process
# add stage1
def customiseDataRun2Common_withStage1(process):
process = customiseDataRun2Common(process)
from L1Trigger.L1TCommon.customsPostLS1 import customiseL1RecoForStage1
process=customiseL1RecoForStage1(process)
return process
##############################################################################
# common+ "25ns" Use this for data daking starting from runs in 2015C (>= 253256 )
def customiseDataRun2Common_25ns(process):
process = customiseDataRun2Common_withStage1(process)
_hcalCustoms25ns(process)
from SLHCUpgradeSimulations.Configuration.postLS1Customs import customise_DQM_25ns
if hasattr(process,'dqmoffline_step'):
process=customise_DQM_25ns(process)
return process
# common+50ns. Needed only for runs >= 253000 if taken with 50ns
def customiseDataRun2Common_50nsRunsAfter253000(process):
process = customiseDataRun2Common_withStage1(process)
process = _overridesFor50ns(process)
return process
##############################################################################
# keep it in case modification is needed
def customiseRun2CommonHI(process):
process = customiseDataRun2Common_withStage1(process)
process = _overridesFor50ns(process)
# HI Specific additional customizations:
# from L1Trigger.L1TCommon.customsPostLS1 import customiseSimL1EmulatorForPostLS1_Additional_HI
# process = customiseSimL1EmulatorForPostLS1_Additional_HI(process)
return process