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)
64 for subdet
in [
'EE',
'FH',
'BH']:
71 process.es_hardcode.hbUpgrade.doRadiationDamage = turnon
72 process.es_hardcode.heUpgrade.doRadiationDamage = turnon
78 hcal_lumis = [300, 1000, 3000, 4500, 1e10]
81 "seed": [0.5, 0.625, 0.75, 0.75],
82 "rec": [0.4, 0.5, 0.6, 0.6],
85 "seed": [1.0, 1.5, 1.5, 1.5],
86 "rec": [0.8, 1.2, 1.2, 1.2],
89 "seed": [1.25, 2.5, 2.5, 2.5],
90 "rec": [1.0, 2.0, 2.0, 2.0],
93 "seed": [1.5, 3.0, 3.0, 3.0],
94 "rec": [1.25, 2.5, 2.5, 2.5],
97 ctmodules = [
'calotowermaker',
'caloTowerForTrk',
'caloTowerForTrkPreSplitting',
'towerMaker',
'towerMakerWithHO']
98 for ilumi, hcal_lumi
in enumerate(hcal_lumis[:-1]):
99 if lumi >= hcal_lumi
and lumi < hcal_lumis[ilumi+1]:
100 if hasattr(process,
'particleFlowClusterHBHE'):
101 process.particleFlowClusterHBHE.seedFinder.thresholdsByDetector[0].seedingThreshold = hcal_thresholds[hcal_lumi][
"seed"]
102 process.particleFlowClusterHBHE.initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = hcal_thresholds[hcal_lumi][
"rec"]
103 process.particleFlowClusterHBHE.pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = hcal_thresholds[hcal_lumi][
"rec"]
104 process.particleFlowClusterHBHE.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
105 process.particleFlowClusterHBHE.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
106 if hasattr(process,
'particleFlowClusterHCAL'):
107 process.particleFlowClusterHCAL.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi][
"rec"]
108 if hasattr(process,
'particleFlowRecHitHBHE'):
109 process.particleFlowRecHitHBHE.producers[0].qualityTests[0].cuts[0].threshold = hcal_thresholds[hcal_lumi][
"rec"]
110 for ctmod
in ctmodules:
111 if hasattr(process,ctmod):
112 getattr(process,ctmod).HBThreshold1 = hcal_thresholds[hcal_lumi][
"rec"][0]
113 getattr(process,ctmod).HBThreshold2 = hcal_thresholds[hcal_lumi][
"rec"][1]
114 getattr(process,ctmod).HBThreshold = hcal_thresholds[hcal_lumi][
"rec"][-1]
119 def ageHcal(process,lumi,instLumi,scenarioHLLHC):
121 if hcaldigi
is not None: hcaldigi.DelivLuminosity = cms.double(
float(lumi))
124 if hasattr(process,
'g4SimHits'):
125 process.g4SimHits.HCalSD.InstLuminosity = cms.double(
float(instLumi))
126 process.g4SimHits.HCalSD.DelivLuminosity = cms.double(
float(lumi))
129 if hasattr(process,
'es_hardcode'):
130 process.es_hardcode.iLumi = cms.double(
float(lumi))
133 process =
ageHB(process,
True,scenarioHLLHC)
134 process =
ageHE(process,
True,scenarioHLLHC)
135 process =
ageHF(process,
True)
136 process =
ageSiPM(process,
True,lumi)
141 process =
ageHB(process,
True,
"")
145 process =
ageHB(process,
False,
"")
149 process =
ageHE(process,
True,
"")
153 process =
ageHE(process,
False,
"")
157 process =
ageHF(process,
True)
161 process =
ageHF(process,
False)
165 process =
ageSiPM(process,
False,0.0)
169 if hasattr(process,
'g4SimHits'):
170 process.g4SimHits.HCalSD.HFDarkening = cms.untracked.bool(
True)
172 if hcaldigi
is not None: hcaldigi.HFDarkening = cms.untracked.bool(
False)
176 if hasattr(process,
'g4SimHits'):
178 process.g4SimHits.ECalSD.InstLuminosity = cms.double(instLumi)
179 process.g4SimHits.ECalSD.DelivLuminosity = cms.double(
float(lumi))
182 ecal_lumis = [300,1000,3000,4500]
184 [
'EcalIntercalibConstantsRcd',
'EcalIntercalibConstants_TL{:d}_upgrade_8deg_v2_mc'],
185 [
'EcalIntercalibConstantsMCRcd',
'EcalIntercalibConstantsMC_TL{:d}_upgrade_8deg_v2_mc'],
186 [
'EcalLaserAPDPNRatiosRcd',
'EcalLaserAPDPNRatios_TL{:d}_upgrade_8deg_mc'],
187 [
'EcalPedestalsRcd',
'EcalPedestals_TL{:d}_upgradeTIA_8deg_mc'],
188 [
'EcalTPGLinearizationConstRcd',
'EcalTPGLinearizationConst_TL{:d}_upgrade_8deg_mc'],
198 ecal_seed_multiplier = 2.5
201 if int(lumi)
in ecal_lumis:
202 if not hasattr(process.GlobalTag,
'toGet'):
203 process.GlobalTag.toGet=cms.VPSet()
204 for ecal_condition
in ecal_conditions:
205 process.GlobalTag.toGet.append(cms.PSet(
206 record = cms.string(ecal_condition[0]),
207 tag = cms.string(ecal_condition[1].
format(
int(lumi))),
208 connect = cms.string(
"frontier://FrontierProd/CMS_CONDITIONS")
211 if hasattr(process,
"particleFlowClusterECALUncorrected"):
212 _seeds = process.particleFlowClusterECALUncorrected.seedFinder.thresholdsByDetector
213 for iseed
in range(0,len(_seeds)):
214 if _seeds[iseed].detector.value()==
"ECAL_BARREL":
215 _seeds[iseed].seedingThreshold = cms.double(ecal_thresholds[
int(lumi)]*ecal_seed_multiplier)
216 _clusters = process.particleFlowClusterECALUncorrected.initialClusteringStep.thresholdsByDetector
217 for icluster
in range(0,len(_clusters)):
218 if _clusters[icluster].detector.value()==
"ECAL_BARREL":
219 _clusters[icluster].gatheringThreshold = cms.double(ecal_thresholds[
int(lumi)])
224 if hasattr(process,
'g4SimHits'):
225 process.g4SimHits.ECalSD.AgeingWithSlopeLY = cms.untracked.bool(
True)
226 if hasattr(process,
'ecal_digi_parameters'):
227 process.ecal_digi_parameters.UseLCcorrection = cms.untracked.bool(
False)
231 process=
ageHcal(process,300,5.0e34,
"nominal")
232 process=
ageEcal(process,300,5.0e34)
236 process=
ageHcal(process,1000,5.0e34,
"nominal")
237 process=
ageEcal(process,1000,5.0e34)
241 process=
ageHcal(process,3000,5.0e34,
"nominal")
242 process=
ageEcal(process,3000,5.0e34)
247 process=
ageHcal(process,3000,7.5e34,
"ultimate")
248 process=
ageEcal(process,3000,7.5e34)
253 process=
ageHcal(process,4500,7.5e34,
"ultimate")
254 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 HGCal_setEndOfLifeNoise(digitizer, 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 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)