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)
69 process.es_hardcode.hbUpgrade.doRadiationDamage = turnon
70 process.es_hardcode.heUpgrade.doRadiationDamage = turnon
76 hcal_lumis = [300, 1000, 3000, 4500, 1e10]
79 "seed": [0.5, 0.625, 0.75, 0.75],
80 "rec": [0.4, 0.5, 0.6, 0.6],
83 "seed": [1.0, 1.5, 1.5, 1.5],
84 "rec": [0.8, 1.2, 1.2, 1.2],
87 "seed": [1.25, 2.5, 2.5, 2.5],
88 "rec": [1.0, 2.0, 2.0, 2.0],
91 "seed": [1.5, 3.0, 3.0, 3.0],
92 "rec": [1.25, 2.5, 2.5, 2.5],
95 ctmodules = [
'calotowermaker',
'caloTowerForTrk',
'caloTowerForTrkPreSplitting',
'towerMaker',
'towerMakerWithHO']
96 for ilumi, hcal_lumi
in enumerate(hcal_lumis[:-1]):
97 if lumi >= hcal_lumi
and lumi < hcal_lumis[ilumi+1]:
98 if hasattr(process,
'particleFlowClusterHBHE'):
99 process.particleFlowClusterHBHE.seedFinder.thresholdsByDetector[0].seedingThreshold = hcal_thresholds[hcal_lumi][
"seed"]
100 process.particleFlowClusterHBHE.initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = hcal_thresholds[hcal_lumi][
"rec"]
101 process.particleFlowClusterHBHE.pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = hcal_thresholds[hcal_lumi][
"rec"]
102 process.particleFlowClusterHBHE.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
103 process.particleFlowClusterHBHE.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
104 if hasattr(process,
'particleFlowClusterHCAL'):
105 process.particleFlowClusterHCAL.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
106 if hasattr(process,
'particleFlowRecHitHBHE'):
107 process.particleFlowRecHitHBHE.producers[0].qualityTests[0].cuts[0].threshold = hcal_thresholds[hcal_lumi][
"rec"]
108 for ctmod
in ctmodules:
109 if hasattr(process,ctmod):
110 getattr(process,ctmod).HBThreshold1 = hcal_thresholds[hcal_lumi][
"rec"][0]
111 getattr(process,ctmod).HBThreshold2 = hcal_thresholds[hcal_lumi][
"rec"][1]
112 getattr(process,ctmod).HBThreshold = hcal_thresholds[hcal_lumi][
"rec"][-1]
117 def ageHcal(process,lumi,instLumi,scenarioHLLHC):
119 if hcaldigi
is not None: hcaldigi.DelivLuminosity = cms.double(
float(lumi))
122 if hasattr(process,
'g4SimHits'):
123 process.g4SimHits.HCalSD.InstLuminosity = cms.double(
float(instLumi))
124 process.g4SimHits.HCalSD.DelivLuminosity = cms.double(
float(lumi))
127 if hasattr(process,
'es_hardcode'):
128 process.es_hardcode.iLumi = cms.double(
float(lumi))
131 process =
ageHB(process,
True,scenarioHLLHC)
132 process =
ageHE(process,
True,scenarioHLLHC)
133 process =
ageHF(process,
True)
134 process =
ageSiPM(process,
True,lumi)
139 process =
ageHB(process,
True,
"")
143 process =
ageHB(process,
False,
"")
147 process =
ageHE(process,
True,
"")
151 process =
ageHE(process,
False,
"")
155 process =
ageHF(process,
True)
159 process =
ageHF(process,
False)
163 process =
ageSiPM(process,
False,0.0)
167 if hasattr(process,
'g4SimHits'):
168 process.g4SimHits.HCalSD.HFDarkening = cms.untracked.bool(
True)
170 if hcaldigi
is not None: hcaldigi.HFDarkening = cms.untracked.bool(
False)
174 if hasattr(process,
'g4SimHits'):
176 process.g4SimHits.ECalSD.InstLuminosity = cms.double(instLumi)
177 process.g4SimHits.ECalSD.DelivLuminosity = cms.double(
float(lumi))
180 ecal_lumis = [300,1000,3000,4500]
182 [
'EcalIntercalibConstantsRcd',
'EcalIntercalibConstants_TL{:d}_upgrade_8deg_v2_mc'],
183 [
'EcalIntercalibConstantsMCRcd',
'EcalIntercalibConstantsMC_TL{:d}_upgrade_8deg_v2_mc'],
184 [
'EcalLaserAPDPNRatiosRcd',
'EcalLaserAPDPNRatios_TL{:d}_upgrade_8deg_mc'],
185 [
'EcalPedestalsRcd',
'EcalPedestals_TL{:d}_upgradeTIA_8deg_mc'],
186 [
'EcalTPGLinearizationConstRcd',
'EcalTPGLinearizationConst_TL{:d}_upgrade_8deg_mc'],
196 ecal_seed_multiplier = 2.5
199 if int(lumi)
in ecal_lumis:
200 if not hasattr(process.GlobalTag,
'toGet'):
201 process.GlobalTag.toGet=cms.VPSet()
202 for ecal_condition
in ecal_conditions:
203 process.GlobalTag.toGet.append(cms.PSet(
204 record = cms.string(ecal_condition[0]),
205 tag = cms.string(ecal_condition[1].
format(
int(lumi))),
206 connect = cms.string(
"frontier://FrontierProd/CMS_CONDITIONS")
209 if hasattr(process,
"particleFlowClusterECALUncorrected"):
210 _seeds = process.particleFlowClusterECALUncorrected.seedFinder.thresholdsByDetector
211 for iseed
in range(0,len(_seeds)):
212 if _seeds[iseed].detector.value()==
"ECAL_BARREL":
213 _seeds[iseed].seedingThreshold = cms.double(ecal_thresholds[
int(lumi)]*ecal_seed_multiplier)
214 _clusters = process.particleFlowClusterECALUncorrected.initialClusteringStep.thresholdsByDetector
215 for icluster
in range(0,len(_clusters)):
216 if _clusters[icluster].detector.value()==
"ECAL_BARREL":
217 _clusters[icluster].gatheringThreshold = cms.double(ecal_thresholds[
int(lumi)])
222 if hasattr(process,
'g4SimHits'):
223 process.g4SimHits.ECalSD.AgeingWithSlopeLY = cms.untracked.bool(
True)
224 if hasattr(process,
'ecal_digi_parameters'):
225 process.ecal_digi_parameters.UseLCcorrection = cms.untracked.bool(
False)
229 process=
ageHcal(process,300,5.0e34,
"nominal")
230 process=
ageEcal(process,300,5.0e34)
234 process=
ageHcal(process,1000,5.0e34,
"nominal")
235 process=
ageEcal(process,1000,5.0e34)
239 process=
ageHcal(process,3000,5.0e34,
"nominal")
240 process=
ageEcal(process,3000,5.0e34)
245 process=
ageHcal(process,3000,7.5e34,
"ultimate")
246 process=
ageEcal(process,3000,7.5e34)
251 process=
ageHcal(process,4500,7.5e34,
"ultimate")
252 process=
ageEcal(process,4500,7.5e34)
def ageEcal(process, lumi, instLumi)
def ageHB(process, turnon, scenarioHLLHC)
def customise_aging_4500_ultimate(process)
def turn_off_HE_aging(process)
def getHGCalDigitizer(process, section)
def getHcalDigitizer(process)
def turn_off_HF_aging(process)
def turn_on_HB_aging(process)
def turn_off_SiPM_aging(process)
def customise_aging_1000(process)
def customise_aging_3000_ultimate(process)
def setScenarioHLLHC(module, scenarioHLLHC)
def customise_aging_300(process)
def ageSiPM(process, turnon, lumi)
def ecal_complete_aging(process)
def turn_off_HB_aging(process)
def hf_complete_aging(process)
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
def HGCal_setEndOfLifeNoise(process)
def ageHF(process, turnon)
def ageHE(process, turnon, scenarioHLLHC)
def turn_on_HF_aging(process)
def customise_aging_3000(process)
def turn_on_HE_aging(process)