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
19 elif section ==
'HFNose' and hasattr(process.mix.digitizers,
'hfnoseDigitizer'):
20 return process.mix.digitizers.hfnoseDigitizer
25 if scenarioHLLHC==
"nominal":
26 from CalibCalorimetry.HcalPlugins.HBHEDarkening_cff
import _years_LHC, _years_HLLHC_nominal
27 module.years = _years_LHC + _years_HLLHC_nominal
28 elif scenarioHLLHC==
"ultimate":
29 from CalibCalorimetry.HcalPlugins.HBHEDarkening_cff
import _years_LHC, _years_HLLHC_ultimate
30 module.years = _years_LHC + _years_HLLHC_ultimate
35 def ageHB(process,turnon,scenarioHLLHC):
37 from CalibCalorimetry.HcalPlugins.HBHEDarkening_cff
import HBDarkeningEP
38 process.HBDarkeningEP = HBDarkeningEP
39 process.HBDarkeningEP =
setScenarioHLLHC(process.HBDarkeningEP,scenarioHLLHC)
41 if hcaldigi
is not None: hcaldigi.HBDarkening = cms.bool(turnon)
42 if hasattr(process,
'es_hardcode'):
43 process.es_hardcode.HBRecalibration = cms.bool(turnon)
46 def ageHE(process,turnon,scenarioHLLHC):
48 from CalibCalorimetry.HcalPlugins.HBHEDarkening_cff
import HEDarkeningEP
49 process.HEDarkeningEP = HEDarkeningEP
50 process.HEDarkeningEP =
setScenarioHLLHC(process.HEDarkeningEP,scenarioHLLHC)
52 if hcaldigi
is not None: hcaldigi.HEDarkening = cms.bool(turnon)
53 if hasattr(process,
'es_hardcode'):
54 process.es_hardcode.HERecalibration = cms.bool(turnon)
59 if hcaldigi
is not None: hcaldigi.HFDarkening = cms.bool(turnon)
60 if hasattr(process,
'es_hardcode'):
61 process.es_hardcode.HFRecalibration = cms.bool(turnon)
81 process.es_hardcode.hbUpgrade.doRadiationDamage = turnon
82 process.es_hardcode.heUpgrade.doRadiationDamage = turnon
88 hcal_lumis = [300, 1000, 3000, 4500, 1e10]
91 "seed": [0.5, 0.625, 0.75, 0.75],
92 "rec": [0.4, 0.5, 0.6, 0.6],
95 "seed": [1.0, 1.5, 1.5, 1.5],
96 "rec": [0.8, 1.2, 1.2, 1.2],
99 "seed": [1.25, 2.5, 2.5, 2.5],
100 "rec": [1.0, 2.0, 2.0, 2.0],
103 "seed": [1.5, 3.0, 3.0, 3.0],
104 "rec": [1.25, 2.5, 2.5, 2.5],
107 ctmodules = [
'calotowermaker',
'caloTowerForTrk',
'caloTowerForTrkPreSplitting',
'towerMaker',
'towerMakerWithHO']
108 for ilumi, hcal_lumi
in enumerate(hcal_lumis[:-1]):
109 if lumi >= hcal_lumi
and lumi < hcal_lumis[ilumi+1]:
110 if hasattr(process,
'particleFlowClusterHBHE'):
111 process.particleFlowClusterHBHE.seedFinder.thresholdsByDetector[0].seedingThreshold = hcal_thresholds[hcal_lumi][
"seed"]
112 process.particleFlowClusterHBHE.initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = hcal_thresholds[hcal_lumi][
"rec"]
113 process.particleFlowClusterHBHE.pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = hcal_thresholds[hcal_lumi][
"rec"]
114 process.particleFlowClusterHBHE.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
115 process.particleFlowClusterHBHE.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
116 if hasattr(process,
'particleFlowClusterHCAL'):
117 process.particleFlowClusterHCAL.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
118 if hasattr(process,
'particleFlowRecHitHBHE'):
119 process.particleFlowRecHitHBHE.producers[0].qualityTests[0].cuts[0].threshold = hcal_thresholds[hcal_lumi][
"rec"]
120 for ctmod
in ctmodules:
121 if hasattr(process,ctmod):
122 getattr(process,ctmod).HBThreshold1 = hcal_thresholds[hcal_lumi][
"rec"][0]
123 getattr(process,ctmod).HBThreshold2 = hcal_thresholds[hcal_lumi][
"rec"][1]
124 getattr(process,ctmod).HBThreshold = hcal_thresholds[hcal_lumi][
"rec"][-1]
129 def ageHcal(process,lumi,instLumi,scenarioHLLHC):
131 if hcaldigi
is not None: hcaldigi.DelivLuminosity = cms.double(float(lumi))
134 if hasattr(process,
'g4SimHits'):
135 process.g4SimHits.HCalSD.InstLuminosity = cms.double(float(instLumi))
136 process.g4SimHits.HCalSD.DelivLuminosity = cms.double(float(lumi))
139 if hasattr(process,
'es_hardcode'):
140 process.es_hardcode.iLumi = cms.double(float(lumi))
143 process =
ageHB(process,
True,scenarioHLLHC)
144 process =
ageHE(process,
True,scenarioHLLHC)
145 process =
ageHF(process,
True)
146 process =
ageSiPM(process,
True,lumi)
151 process =
ageHB(process,
True,
"")
155 process =
ageHB(process,
False,
"")
159 process =
ageHE(process,
True,
"")
163 process =
ageHE(process,
False,
"")
167 process =
ageHF(process,
True)
171 process =
ageHF(process,
False)
175 process =
ageSiPM(process,
False,0.0)
179 if hasattr(process,
'g4SimHits'):
180 process.g4SimHits.HCalSD.HFDarkening = cms.untracked.bool(
True)
182 if hcaldigi
is not None: hcaldigi.HFDarkening = cms.untracked.bool(
False)
186 if hasattr(process,
'g4SimHits'):
188 process.g4SimHits.ECalSD.InstLuminosity = cms.double(instLumi)
189 process.g4SimHits.ECalSD.DelivLuminosity = cms.double(float(lumi))
192 ecal_lumis = [300,1000,3000,4500]
194 [
'EcalIntercalibConstantsRcd',
'EcalIntercalibConstants_TL{:d}_upgrade_8deg_v2_mc'],
195 [
'EcalIntercalibConstantsMCRcd',
'EcalIntercalibConstantsMC_TL{:d}_upgrade_8deg_v2_mc'],
196 [
'EcalLaserAPDPNRatiosRcd',
'EcalLaserAPDPNRatios_TL{:d}_upgrade_8deg_mc'],
197 [
'EcalPedestalsRcd',
'EcalPedestals_TL{:d}_upgradeTIA_8deg_mc'],
198 [
'EcalTPGLinearizationConstRcd',
'EcalTPGLinearizationConst_TL{:d}_upgrade_8deg_mc'],
208 ecal_seed_multiplier = 2.5
211 if int(lumi)
in ecal_lumis:
212 if not hasattr(process.GlobalTag,
'toGet'):
213 process.GlobalTag.toGet=cms.VPSet()
214 for ecal_condition
in ecal_conditions:
215 process.GlobalTag.toGet.append(cms.PSet(
216 record = cms.string(ecal_condition[0]),
217 tag = cms.string(ecal_condition[1].
format(int(lumi))),
218 connect = cms.string(
"frontier://FrontierProd/CMS_CONDITIONS")
221 if hasattr(process,
"particleFlowClusterECALUncorrected"):
222 _seeds = process.particleFlowClusterECALUncorrected.seedFinder.thresholdsByDetector
223 for iseed
in range(0,len(_seeds)):
224 if _seeds[iseed].detector.value()==
"ECAL_BARREL":
225 _seeds[iseed].seedingThreshold = cms.double(ecal_thresholds[int(lumi)]*ecal_seed_multiplier)
226 _clusters = process.particleFlowClusterECALUncorrected.initialClusteringStep.thresholdsByDetector
227 for icluster
in range(0,len(_clusters)):
228 if _clusters[icluster].detector.value()==
"ECAL_BARREL":
229 _clusters[icluster].gatheringThreshold = cms.double(ecal_thresholds[int(lumi)])
234 if hasattr(process,
'g4SimHits'):
235 process.g4SimHits.ECalSD.AgeingWithSlopeLY = cms.untracked.bool(
True)
236 if hasattr(process,
'ecal_digi_parameters'):
237 process.ecal_digi_parameters.UseLCcorrection = cms.untracked.bool(
False)
241 process=
ageHcal(process,300,5.0e34,
"nominal")
242 process=
ageEcal(process,300,5.0e34)
246 process=
ageHcal(process,1000,5.0e34,
"nominal")
248 process=
ageEcal(process,1000,5.0e34)
252 process=
ageHcal(process,3000,5.0e34,
"nominal")
254 process=
ageEcal(process,3000,5.0e34)
260 process=
ageHcal(process,3000,7.5e34,
"ultimate")
262 process=
ageEcal(process,3000,7.5e34)
268 process=
ageHcal(process,4500,7.5e34,
"ultimate")
270 process=
ageEcal(process,4500,7.5e34)
def customise_aging_3000_ultimate
def HFNose_setEndOfLifeNoise
const uint16_t range(const Frame &aFrame)
def HGCal_setEndOfLifeNoise
def HGCal_setRealisticStartupNoise
def customise_aging_4500_ultimate
def realisticHGCalStartup