1 import FWCore.ParameterSet.Config
as cms
5 if hasattr(process,
'mixData'):
7 if hasattr(process,
'mix')
and hasattr(process.mix,
'digitizers')
and hasattr(process.mix.digitizers,
'hcal'):
8 return process.mix.digitizers.hcal
12 if hasattr(process,
'mix')
and hasattr(process.mix,
'digitizers'):
13 if section ==
'EE' and hasattr(process.mix.digitizers,
'hgceeDigitizer'):
14 return process.mix.digitizers.hgceeDigitizer
15 elif section ==
'FH' and hasattr(process.mix.digitizers,
'hgchefrontDigitizer'):
16 return process.mix.digitizers.hgchefrontDigitizer
17 elif section ==
'BH' and hasattr(process.mix.digitizers,
'hgchebackDigitizer'):
18 return process.mix.digitizers.hgchebackDigitizer
23 if scenarioHLLHC==
"nominal":
24 from CalibCalorimetry.HcalPlugins.HBHEDarkening_cff
import _years_LHC, _years_HLLHC_nominal
25 module.years = _years_LHC + _years_HLLHC_nominal
26 elif scenarioHLLHC==
"ultimate":
27 from CalibCalorimetry.HcalPlugins.HBHEDarkening_cff
import _years_LHC, _years_HLLHC_ultimate
28 module.years = _years_LHC + _years_HLLHC_ultimate
33 def ageHB(process,turnon,scenarioHLLHC):
35 from CalibCalorimetry.HcalPlugins.HBHEDarkening_cff
import HBDarkeningEP
36 process.HBDarkeningEP = HBDarkeningEP
37 process.HBDarkeningEP =
setScenarioHLLHC(process.HBDarkeningEP,scenarioHLLHC)
39 if hcaldigi
is not None: hcaldigi.HBDarkening = cms.bool(turnon)
40 if hasattr(process,
'es_hardcode'):
41 process.es_hardcode.HBRecalibration = cms.bool(turnon)
44 def ageHE(process,turnon,scenarioHLLHC):
46 from CalibCalorimetry.HcalPlugins.HBHEDarkening_cff
import HEDarkeningEP
47 process.HEDarkeningEP = HEDarkeningEP
48 process.HEDarkeningEP =
setScenarioHLLHC(process.HEDarkeningEP,scenarioHLLHC)
50 if hcaldigi
is not None: hcaldigi.HEDarkening = cms.bool(turnon)
51 if hasattr(process,
'es_hardcode'):
52 process.es_hardcode.HERecalibration = cms.bool(turnon)
57 if hcaldigi
is not None: hcaldigi.HFDarkening = cms.bool(turnon)
58 if hasattr(process,
'es_hardcode'):
59 process.es_hardcode.HFRecalibration = cms.bool(turnon)
74 process.es_hardcode.hbUpgrade.doRadiationDamage = turnon
75 process.es_hardcode.heUpgrade.doRadiationDamage = turnon
81 hcal_lumis = [300, 1000, 3000, 4500, 1e10]
84 "seed": [0.5, 0.625, 0.75, 0.75],
85 "rec": [0.4, 0.5, 0.6, 0.6],
88 "seed": [1.0, 1.5, 1.5, 1.5],
89 "rec": [0.8, 1.2, 1.2, 1.2],
92 "seed": [1.25, 2.5, 2.5, 2.5],
93 "rec": [1.0, 2.0, 2.0, 2.0],
96 "seed": [1.5, 3.0, 3.0, 3.0],
97 "rec": [1.25, 2.5, 2.5, 2.5],
100 ctmodules = [
'calotowermaker',
'caloTowerForTrk',
'caloTowerForTrkPreSplitting',
'towerMaker',
'towerMakerWithHO']
101 for ilumi, hcal_lumi
in enumerate(hcal_lumis[:-1]):
102 if lumi >= hcal_lumi
and lumi < hcal_lumis[ilumi+1]:
103 if hasattr(process,
'particleFlowClusterHBHE'):
104 process.particleFlowClusterHBHE.seedFinder.thresholdsByDetector[0].seedingThreshold = hcal_thresholds[hcal_lumi][
"seed"]
105 process.particleFlowClusterHBHE.initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = hcal_thresholds[hcal_lumi][
"rec"]
106 process.particleFlowClusterHBHE.pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = hcal_thresholds[hcal_lumi][
"rec"]
107 process.particleFlowClusterHBHE.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
108 process.particleFlowClusterHBHE.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
109 if hasattr(process,
'particleFlowClusterHCAL'):
110 process.particleFlowClusterHCAL.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
111 if hasattr(process,
'particleFlowRecHitHBHE'):
112 process.particleFlowRecHitHBHE.producers[0].qualityTests[0].cuts[0].threshold = hcal_thresholds[hcal_lumi][
"rec"]
113 for ctmod
in ctmodules:
114 if hasattr(process,ctmod):
115 getattr(process,ctmod).HBThreshold1 = hcal_thresholds[hcal_lumi][
"rec"][0]
116 getattr(process,ctmod).HBThreshold2 = hcal_thresholds[hcal_lumi][
"rec"][1]
117 getattr(process,ctmod).HBThreshold = hcal_thresholds[hcal_lumi][
"rec"][-1]
122 def ageHcal(process,lumi,instLumi,scenarioHLLHC):
124 if hcaldigi
is not None: hcaldigi.DelivLuminosity = cms.double(
float(lumi))
127 if hasattr(process,
'g4SimHits'):
128 process.g4SimHits.HCalSD.InstLuminosity = cms.double(
float(instLumi))
129 process.g4SimHits.HCalSD.DelivLuminosity = cms.double(
float(lumi))
132 if hasattr(process,
'es_hardcode'):
133 process.es_hardcode.iLumi = cms.double(
float(lumi))
136 process =
ageHB(process,
True,scenarioHLLHC)
137 process =
ageHE(process,
True,scenarioHLLHC)
138 process =
ageHF(process,
True)
139 process =
ageSiPM(process,
True,lumi)
144 process =
ageHB(process,
True,
"")
148 process =
ageHB(process,
False,
"")
152 process =
ageHE(process,
True,
"")
156 process =
ageHE(process,
False,
"")
160 process =
ageHF(process,
True)
164 process =
ageHF(process,
False)
168 process =
ageSiPM(process,
False,0.0)
172 if hasattr(process,
'g4SimHits'):
173 process.g4SimHits.HCalSD.HFDarkening = cms.untracked.bool(
True)
175 if hcaldigi
is not None: hcaldigi.HFDarkening = cms.untracked.bool(
False)
179 if hasattr(process,
'g4SimHits'):
181 process.g4SimHits.ECalSD.InstLuminosity = cms.double(instLumi)
182 process.g4SimHits.ECalSD.DelivLuminosity = cms.double(
float(lumi))
185 ecal_lumis = [300,1000,3000,4500]
187 [
'EcalIntercalibConstantsRcd',
'EcalIntercalibConstants_TL{:d}_upgrade_8deg_v2_mc'],
188 [
'EcalIntercalibConstantsMCRcd',
'EcalIntercalibConstantsMC_TL{:d}_upgrade_8deg_v2_mc'],
189 [
'EcalLaserAPDPNRatiosRcd',
'EcalLaserAPDPNRatios_TL{:d}_upgrade_8deg_mc'],
190 [
'EcalPedestalsRcd',
'EcalPedestals_TL{:d}_upgradeTIA_8deg_mc'],
191 [
'EcalTPGLinearizationConstRcd',
'EcalTPGLinearizationConst_TL{:d}_upgrade_8deg_mc'],
201 ecal_seed_multiplier = 2.5
204 if int(lumi)
in ecal_lumis:
205 if not hasattr(process.GlobalTag,
'toGet'):
206 process.GlobalTag.toGet=cms.VPSet()
207 for ecal_condition
in ecal_conditions:
208 process.GlobalTag.toGet.append(cms.PSet(
209 record = cms.string(ecal_condition[0]),
210 tag = cms.string(ecal_condition[1].
format(
int(lumi))),
211 connect = cms.string(
"frontier://FrontierProd/CMS_CONDITIONS")
214 if hasattr(process,
"particleFlowClusterECALUncorrected"):
215 _seeds = process.particleFlowClusterECALUncorrected.seedFinder.thresholdsByDetector
216 for iseed
in range(0,len(_seeds)):
217 if _seeds[iseed].detector.value()==
"ECAL_BARREL":
218 _seeds[iseed].seedingThreshold = cms.double(ecal_thresholds[
int(lumi)]*ecal_seed_multiplier)
219 _clusters = process.particleFlowClusterECALUncorrected.initialClusteringStep.thresholdsByDetector
220 for icluster
in range(0,len(_clusters)):
221 if _clusters[icluster].detector.value()==
"ECAL_BARREL":
222 _clusters[icluster].gatheringThreshold = cms.double(ecal_thresholds[
int(lumi)])
227 if hasattr(process,
'g4SimHits'):
228 process.g4SimHits.ECalSD.AgeingWithSlopeLY = cms.untracked.bool(
True)
229 if hasattr(process,
'ecal_digi_parameters'):
230 process.ecal_digi_parameters.UseLCcorrection = cms.untracked.bool(
False)
234 process=
ageHcal(process,300,5.0e34,
"nominal")
235 process=
ageEcal(process,300,5.0e34)
239 process=
ageHcal(process,1000,5.0e34,
"nominal")
241 process=
ageEcal(process,1000,5.0e34)
245 process=
ageHcal(process,3000,5.0e34,
"nominal")
247 process=
ageEcal(process,3000,5.0e34)
252 process=
ageHcal(process,3000,7.5e34,
"ultimate")
254 process=
ageEcal(process,3000,7.5e34)
259 process=
ageHcal(process,4500,7.5e34,
"ultimate")
261 process=
ageEcal(process,4500,7.5e34)