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