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.HcalReLabel.RelabelHits=cms.untracked.bool(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 def customise_HcalPhase1(process):
25  #common stuff
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  'CholeskyMatrices',
46  'CovarianceMatrices'
47  )
48 
49  # Special Upgrade trick (if absent - regular case assumed)
50  process.es_hardcode.GainWidthsForTrigPrims = cms.bool(True)
51  process.es_hardcode.HEreCalibCutoff = cms.double(100.) #for aging
52 
53 
54  if hasattr(process,'g4SimHits'):
55  process=customise_Sim(process)
56  if hasattr(process,'DigiToRaw'):
57  process=customise_DigiToRaw(process)
58  if hasattr(process,'RawToDigi'):
59  process=customise_RawToDigi(process)
60  if hasattr(process,'digitisation_step'):
61  process=customise_Digi(process)
62  if hasattr(process,'reconstruction_step'):
63  process=customise_Reco(process)
64  if hasattr(process,'dqmoffline_step'):
65  process=customise_DQM(process)
66  if hasattr(process,'dqmHarvesting'):
67  process=customise_harvesting(process)
68  if hasattr(process,'validation_step'):
69  process=customise_Validation(process)
70  process=customise_condOverRides(process)
71  return process
72 
73 
74 def customise_Sim(process):
75  process.g4SimHits.HCalSD.TestNumberingScheme = True
76 
77  return process
78 
79 def customise_DigiToRaw(process):
80  process.digi2raw_step.remove(process.hcalRawData)
81 
82  return process
83 
84 def customise_RawToDigi(process):
85  process.raw2digi_step.remove(process.hcalDigis)
86 
87  return process
88 
89 def customise_Digi(process):
90  if hasattr(process,'mix'):
91  process.mix.digitizers.hcal.HBHEUpgradeQIE = True
92  process.mix.digitizers.hcal.hb.siPMCells = cms.vint32([1])
93  process.mix.digitizers.hcal.hb.photoelectronsToAnalog = cms.vdouble([10.]*16)
94  process.mix.digitizers.hcal.hb.pixels = cms.int32(4500*4*2)
95  process.mix.digitizers.hcal.he.photoelectronsToAnalog = cms.vdouble([10.]*16)
96  process.mix.digitizers.hcal.he.pixels = cms.int32(4500*4*2)
97  process.mix.digitizers.hcal.HFUpgradeQIE = True
98  process.mix.digitizers.hcal.HcalReLabel.RelabelHits=cms.untracked.bool(True)
99 
100  if hasattr(process,'simHcalDigis'):
101  process.simHcalDigis.useConfigZSvalues=cms.int32(1)
102  process.simHcalDigis.HBlevel=cms.int32(16)
103  process.simHcalDigis.HElevel=cms.int32(16)
104  process.simHcalDigis.HOlevel=cms.int32(16)
105  process.simHcalDigis.HFlevel=cms.int32(16)
106 
107  process.digitisation_step.remove(process.simHcalTriggerPrimitiveDigis)
108  process.digitisation_step.remove(process.simHcalTTPDigis)
109 
110  return process
111 
112 def customise_Reco(process):
113  #--- CaloTowers maker input customization
114  process.towerMaker.hfInput = cms.InputTag("hfUpgradeReco")
115  process.towerMaker.hbheInput = cms.InputTag("hbheUpgradeReco")
116  process.towerMakerPF.hfInput = cms.InputTag("hfUpgradeReco")
117  process.towerMakerPF.hbheInput = cms.InputTag("hbheUpgradeReco")
118  process.towerMakerWithHO.hfInput = cms.InputTag("hfUpgradeReco")
119  process.towerMakerWithHO.hbheInput = cms.InputTag("hbheUpgradeReco")
120  process.particleFlowRecHitHCAL.hcalRecHitsHBHE = cms.InputTag("hbheUpgradeReco")
121  process.particleFlowRecHitHCAL.hcalRecHitsHF = cms.InputTag("hfUpgradeReco")
122  process.ak4JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
123  process.ak4JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
124  process.ak7JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
125  process.ak7JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
126  process.ca4JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
127  process.ca4JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
128  process.ca6JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
129  process.ca6JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
130  process.gk5JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
131  process.gk5JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
132  process.gk7JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
133  process.gk7JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
134  process.ic5JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
135  process.ic5JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
136  process.ic7JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
137  process.ic7JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
138  process.kt4JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
139  process.kt4JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
140  process.kt6JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
141  process.kt6JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
142  process.sc5JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
143  process.sc5JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
144  process.sc7JetID.hfRecHitsColl = cms.InputTag("hfUpgradeReco")
145  process.sc7JetID.hbheRecHitsColl = cms.InputTag("hbheUpgradeReco")
146  process.hfEMClusters.hits = cms.InputTag("hfUpgradeReco")
147  process.caloRecoTauProducer.TrackAssociatorParameters.HBHERecHitCollectionLabel = cms.InputTag("hbheUpgradeReco")
148  process.caloRecoTauProducer.HFRecHitCollection=cms.InputTag("hfUpgradeReco")
149 
150  process.muons1stStep.TrackAssociatorParameters.HBHERecHitCollectionLabel=cms.InputTag("hbheUpgradeReco")
151  process.muons1stStep.CaloExtractorPSet.TrackAssociatorParameters.HBHERecHitCollectionLabel=cms.InputTag("hbheUpgradeReco")
152  process.muons1stStep.JetExtractorPSet.HBHERecHitCollectionLabel=cms.InputTag("hbheUpgradeReco")
153 
154  process.muonsFromCosmics.TrackAssociatorParameters.HBHERecHitCollectionLabel=cms.InputTag("hbheUpgradeReco")
155  process.muonsFromCosmics.CaloExtractorPSet.TrackAssociatorParameters.HBHERecHitCollectionLabel=cms.InputTag("hbheUpgradeReco")
156  process.muonsFromCosmics.JetExtractorPSet.HBHERecHitCollectionLabel=cms.InputTag("hbheUpgradeReco")
157  process.muonsFromCosmics1Leg.TrackAssociatorParameters.HBHERecHitCollectionLabel=cms.InputTag("hbheUpgradeReco")
158  process.muonsFromCosmics1Leg.CaloExtractorPSet.TrackAssociatorParameters.HBHERecHitCollectionLabel=cms.InputTag("hbheUpgradeReco")
159  process.muonsFromCosmics1Leg.JetExtractorPSet.HBHERecHitCollectionLabel=cms.InputTag("hbheUpgradeReco")
160 
161  process.interestingTrackEcalDetIds.TrackAssociatorParameters.HBHERecHitCollectionLabel=cms.InputTag("hbheUpgradeReco")
162 
163  process.hcalnoise.recHitCollName=cms.string('hbheUpgradeReco')
164  process.reducedHcalRecHits.hfTag=cms.InputTag("hfUpgradeReco")
165  process.reducedHcalRecHits.hbheTag=cms.InputTag("hbheUpgradeReco")
166 
167  process.caloRecoTauProducer.HBHERecHitCollection=cms.InputTag("hbheUpgradeReco")
168  process.caloRecoTauProducer.HFRecHitCollection=cms.InputTag("hfUpgradeReco")
169 
170  process.load("RecoLocalCalo.HcalRecProducers.HBHEUpgradeReconstructor_cfi")
171  process.load("RecoLocalCalo.HcalRecProducers.HFUpgradeReconstructor_cfi")
172 ### process.load("RecoLocalCalo.HcalRecProducers.HcalSimpleReconstructor_ho_cfi")
173 
174  process.reconstruction_step.replace(process.hfreco,process.hfUpgradeReco)
175  process.reconstruction_step.remove(process.hbhereco)
176  process.reconstruction_step.replace(process.hbheprereco,process.hbheUpgradeReco)
177 
178  process.horeco.digiLabel = "simHcalDigis"
179  process.hbhereco.digiLabel = cms.InputTag("simHcalDigis","HBHEUpgradeDigiCollection")
180  process.hfreco.digiLabel = cms.InputTag("simHcalDigis","HBHEUpgradeDigiCollection")
181 
182  process.zdcreco.digiLabel = "simHcalUnsuppressedDigis"
183  process.hcalnoise.digiCollName=cms.string('simHcalDigis')
184 
185  # not sure why these are missing - but need to investigate later
186  process.reconstruction_step.remove(process.castorreco)
187  process.reconstruction_step.remove(process.CastorTowerReco)
188  process.reconstruction_step.remove(process.ak7CastorJets)
189  process.reconstruction_step.remove(process.ak7CastorJetID)
190  return process
191 
192 def customise_DQM(process):
193  process.dqmoffline_step.remove(process.hcalDigiMonitor)
194  process.dqmoffline_step.remove(process.hcalDeadCellMonitor)
195  process.dqmoffline_step.remove(process.hcalBeamMonitor)
196  process.dqmoffline_step.remove(process.hcalRecHitMonitor)
197  process.dqmoffline_step.remove(process.hcalDetDiagNoiseMonitor)
198  process.dqmoffline_step.remove(process.hcalNoiseMonitor)
199  process.dqmoffline_step.remove(process.RecHitsDQMOffline)
200  process.dqmoffline_step.remove(process.zdcMonitor)
201  process.dqmoffline_step.remove(process.hcalMonitor)
202  process.dqmoffline_step.remove(process.hcalHotCellMonitor)
203  process.dqmoffline_step.remove(process.hcalRawDataMonitor)
204  process.ExoticaDQM.JetIDParams.hbheRecHitsColl=cms.InputTag("hbheUpgradeReco")
205  process.ExoticaDQM.JetIDParams.hfRecHitsColl=cms.InputTag("hfUpgradeReco")
206  return process
207 
208 def customise_harvesting(process):
209  return process
210 
211 def customise_Validation(process):
212  process.validation_step.remove(process.AllHcalDigisValidation)
213  process.validation_step.remove(process.RecHitsValidation)
214  process.validation_step.remove(process.globalhitsanalyze)
215  return process
216 
218  return process
def customise_Validation
Definition: HCalCustoms.py:211
def customise_HcalPhase0
Definition: HCalCustoms.py:3
def customise_harvesting
Definition: HCalCustoms.py:208
def customise_DQM
process.load("RecoLocalCalo.HcalRecProducers.HcalSimpleReconstructor_ho_cfi")
Definition: HCalCustoms.py:192
def customise_HcalPhase1
Definition: HCalCustoms.py:24
def customise_Sim
Definition: HCalCustoms.py:74
def customise_DigiToRaw
Definition: HCalCustoms.py:79
def customise_RawToDigi
Definition: HCalCustoms.py:84
def customise_Digi
Definition: HCalCustoms.py:89
def customise_Reco
Definition: HCalCustoms.py:112
def customise_condOverRides
Definition: HCalCustoms.py:217