CMS 3D CMS Logo

Functions
aging Namespace Reference

Functions

def agedHGCal (process)
 
def ageEcal (process, lumi, instLumi)
 
def ageHB (process, turnon, scenarioHLLHC)
 
def ageHcal (process, lumi, instLumi, scenarioHLLHC)
 
def ageHE (process, turnon, scenarioHLLHC)
 
def ageHF (process, turnon)
 
def ageSiPM (process, turnon, lumi)
 
def customise_aging_1000 (process)
 
def customise_aging_300 (process)
 
def customise_aging_3000 (process)
 
def customise_aging_3000_ultimate (process)
 
def customise_aging_4500_ultimate (process)
 
def ecal_complete_aging (process)
 
def getHcalDigitizer (process)
 
def getHGCalDigitizer (process, section)
 
def hf_complete_aging (process)
 
def setScenarioHLLHC (module, scenarioHLLHC)
 
def turn_off_HB_aging (process)
 
def turn_off_HE_aging (process)
 
def turn_off_HF_aging (process)
 
def turn_off_SiPM_aging (process)
 
def turn_on_HB_aging (process)
 
def turn_on_HE_aging (process)
 
def turn_on_HF_aging (process)
 

Function Documentation

def aging.agedHGCal (   process)

Definition at line 62 of file aging.py.

References hgcalDigitizer_cfi.HGCal_setEndOfLifeNoise().

Referenced by customise_aging_3000(), customise_aging_3000_ultimate(), and customise_aging_4500_ultimate().

62 def agedHGCal(process):
63  from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import HGCal_setEndOfLifeNoise
64  process = HGCal_setEndOfLifeNoise(process)
65  return process
66 
67 # needs lumi to set proper ZS thresholds (tbd)
def agedHGCal(process)
Definition: aging.py:62
def HGCal_setEndOfLifeNoise(process)
def aging.ageEcal (   process,
  lumi,
  instLumi 
)

Definition at line 173 of file aging.py.

References objects.autophobj.float, and createfilelist.int.

Referenced by customise_aging_1000(), customise_aging_300(), customise_aging_3000(), customise_aging_3000_ultimate(), and customise_aging_4500_ultimate().

173 def ageEcal(process,lumi,instLumi):
174  if hasattr(process,'g4SimHits'):
175  #these lines need to be further activiated by tuning on 'complete' aging for ecal
176  process.g4SimHits.ECalSD.InstLuminosity = cms.double(instLumi)
177  process.g4SimHits.ECalSD.DelivLuminosity = cms.double(float(lumi))
178 
179  # available conditions
180  ecal_lumis = [300,1000,3000,4500]
181  ecal_conditions = [
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'],
187  ]
188 
189  # update PF thresholds, based on https://indico.cern.ch/event/653123/contributions/2659235/attachments/1491385/2318364/170711_upsg_ledovskoy.pdf
190  ecal_thresholds = {
191  300 : 0.103,
192  1000 : 0.175,
193  3000 : 0.435,
194  4500 : 0.707,
195  }
196  ecal_seed_multiplier = 2.5
197 
198  # try to get conditions
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")
207  )
208  )
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)])
218 
219  return process
220 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:173
def aging.ageHB (   process,
  turnon,
  scenarioHLLHC 
)

Definition at line 33 of file aging.py.

References getHcalDigitizer(), and setScenarioHLLHC().

Referenced by ageHcal(), turn_off_HB_aging(), and turn_on_HB_aging().

33 def ageHB(process,turnon,scenarioHLLHC):
34  if turnon:
35  from CalibCalorimetry.HcalPlugins.HBHEDarkening_cff import HBDarkeningEP
36  process.HBDarkeningEP = HBDarkeningEP
37  process.HBDarkeningEP = setScenarioHLLHC(process.HBDarkeningEP,scenarioHLLHC)
38  hcaldigi = getHcalDigitizer(process)
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)
42  return process
43 
def ageHB(process, turnon, scenarioHLLHC)
Definition: aging.py:33
def getHcalDigitizer(process)
Definition: aging.py:4
def setScenarioHLLHC(module, scenarioHLLHC)
Definition: aging.py:22
def aging.ageHcal (   process,
  lumi,
  instLumi,
  scenarioHLLHC 
)

Definition at line 117 of file aging.py.

References ageHB(), ageHE(), ageHF(), ageSiPM(), objects.autophobj.float, and getHcalDigitizer().

Referenced by customise_aging_1000(), customise_aging_300(), customise_aging_3000(), customise_aging_3000_ultimate(), and customise_aging_4500_ultimate().

117 def ageHcal(process,lumi,instLumi,scenarioHLLHC):
118  hcaldigi = getHcalDigitizer(process)
119  if hcaldigi is not None: hcaldigi.DelivLuminosity = cms.double(float(lumi)) # integrated lumi in fb-1
120 
121  # these lines need to be further activated by turning on 'complete' aging for HF
122  if hasattr(process,'g4SimHits'):
123  process.g4SimHits.HCalSD.InstLuminosity = cms.double(float(instLumi))
124  process.g4SimHits.HCalSD.DelivLuminosity = cms.double(float(lumi))
125 
126  # recalibration and darkening always together
127  if hasattr(process,'es_hardcode'):
128  process.es_hardcode.iLumi = cms.double(float(lumi))
129 
130  # functions to enable individual subdet aging
131  process = ageHB(process,True,scenarioHLLHC)
132  process = ageHE(process,True,scenarioHLLHC)
133  process = ageHF(process,True)
134  process = ageSiPM(process,True,lumi)
135 
136  return process
137 
def ageHB(process, turnon, scenarioHLLHC)
Definition: aging.py:33
def getHcalDigitizer(process)
Definition: aging.py:4
def ageSiPM(process, turnon, lumi)
Definition: aging.py:68
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:117
def ageHF(process, turnon)
Definition: aging.py:55
def ageHE(process, turnon, scenarioHLLHC)
Definition: aging.py:44
def aging.ageHE (   process,
  turnon,
  scenarioHLLHC 
)

Definition at line 44 of file aging.py.

References getHcalDigitizer(), and setScenarioHLLHC().

Referenced by ageHcal(), turn_off_HE_aging(), and turn_on_HE_aging().

44 def ageHE(process,turnon,scenarioHLLHC):
45  if turnon:
46  from CalibCalorimetry.HcalPlugins.HBHEDarkening_cff import HEDarkeningEP
47  process.HEDarkeningEP = HEDarkeningEP
48  process.HEDarkeningEP = setScenarioHLLHC(process.HEDarkeningEP,scenarioHLLHC)
49  hcaldigi = getHcalDigitizer(process)
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)
53  return process
54 
def getHcalDigitizer(process)
Definition: aging.py:4
def setScenarioHLLHC(module, scenarioHLLHC)
Definition: aging.py:22
def ageHE(process, turnon, scenarioHLLHC)
Definition: aging.py:44
def aging.ageHF (   process,
  turnon 
)

Definition at line 55 of file aging.py.

References getHcalDigitizer().

Referenced by ageHcal(), turn_off_HF_aging(), and turn_on_HF_aging().

55 def ageHF(process,turnon):
56  hcaldigi = getHcalDigitizer(process)
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)
60  return process
61 
def getHcalDigitizer(process)
Definition: aging.py:4
def ageHF(process, turnon)
Definition: aging.py:55
def aging.ageSiPM (   process,
  turnon,
  lumi 
)

Definition at line 68 of file aging.py.

Referenced by ageHcal(), and turn_off_SiPM_aging().

68 def ageSiPM(process,turnon,lumi):
69  process.es_hardcode.hbUpgrade.doRadiationDamage = turnon
70  process.es_hardcode.heUpgrade.doRadiationDamage = turnon
71 
72  # todo: determine ZS threshold adjustments
73 
74  # adjust PF thresholds for increased noise
75  # based on: https://baylor.box.com/s/w32ja75krcbxcycyifexu28dwlgrj7wg
76  hcal_lumis = [300, 1000, 3000, 4500, 1e10]
77  hcal_thresholds = {
78  300: {
79  "seed": [0.5, 0.625, 0.75, 0.75],
80  "rec": [0.4, 0.5, 0.6, 0.6],
81  },
82  1000: {
83  "seed": [1.0, 1.5, 1.5, 1.5],
84  "rec": [0.8, 1.2, 1.2, 1.2],
85  },
86  3000: {
87  "seed": [1.25, 2.5, 2.5, 2.5],
88  "rec": [1.0, 2.0, 2.0, 2.0],
89  },
90  4500: {
91  "seed": [1.5, 3.0, 3.0, 3.0],
92  "rec": [1.25, 2.5, 2.5, 2.5],
93  },
94  }
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]
113  break
114 
115  return process
116 
def ageSiPM(process, turnon, lumi)
Definition: aging.py:68
def aging.customise_aging_1000 (   process)

Definition at line 233 of file aging.py.

References ageEcal(), ageHcal(), and turn_off_HE_aging().

233 def customise_aging_1000(process):
234  process=ageHcal(process,1000,5.0e34,"nominal")
235  process=turn_off_HE_aging(process) #avoid conflict between HGCal and Hcal in phase2 geom configuration
236  process=ageEcal(process,1000,5.0e34)
237  return process
238 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:173
def turn_off_HE_aging(process)
Definition: aging.py:150
def customise_aging_1000(process)
Definition: aging.py:233
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:117
def aging.customise_aging_300 (   process)

Definition at line 228 of file aging.py.

References ageEcal(), and ageHcal().

228 def customise_aging_300(process):
229  process=ageHcal(process,300,5.0e34,"nominal")
230  process=ageEcal(process,300,5.0e34)
231  return process
232 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:173
def customise_aging_300(process)
Definition: aging.py:228
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:117
def aging.customise_aging_3000 (   process)

Definition at line 239 of file aging.py.

References agedHGCal(), ageEcal(), ageHcal(), and turn_off_HE_aging().

239 def customise_aging_3000(process):
240  process=ageHcal(process,3000,5.0e34,"nominal")
241  process=turn_off_HE_aging(process) #avoid conflict between HGCal and Hcal in phase2 geom configuration
242  process=ageEcal(process,3000,5.0e34)
243  process=agedHGCal(process)
244  return process
245 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:173
def turn_off_HE_aging(process)
Definition: aging.py:150
def agedHGCal(process)
Definition: aging.py:62
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:117
def customise_aging_3000(process)
Definition: aging.py:239
def aging.customise_aging_3000_ultimate (   process)

Definition at line 246 of file aging.py.

References agedHGCal(), ageEcal(), ageHcal(), and turn_off_HE_aging().

247  process=ageHcal(process,3000,7.5e34,"ultimate")
248  process=turn_off_HE_aging(process) #avoid conflict between HGCal and Hcal in phase2 geom configuration
249  process=ageEcal(process,3000,7.5e34)
250  process=agedHGCal(process)
251  return process
252 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:173
def turn_off_HE_aging(process)
Definition: aging.py:150
def agedHGCal(process)
Definition: aging.py:62
def customise_aging_3000_ultimate(process)
Definition: aging.py:246
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:117
def aging.customise_aging_4500_ultimate (   process)

Definition at line 253 of file aging.py.

References agedHGCal(), ageEcal(), ageHcal(), and turn_off_HE_aging().

254  process=ageHcal(process,4500,7.5e34,"ultimate")
255  process=turn_off_HE_aging(process) #avoid conflict between HGCal and Hcal in phase2 geom configuration
256  process=ageEcal(process,4500,7.5e34)
257  process=agedHGCal(process)
258  return process
259 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:173
def customise_aging_4500_ultimate(process)
Definition: aging.py:253
def turn_off_HE_aging(process)
Definition: aging.py:150
def agedHGCal(process)
Definition: aging.py:62
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:117
def aging.ecal_complete_aging (   process)

Definition at line 221 of file aging.py.

221 def ecal_complete_aging(process):
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)
226  return process
227 
def ecal_complete_aging(process)
Definition: aging.py:221
def aging.getHcalDigitizer (   process)

Definition at line 4 of file aging.py.

Referenced by ageHB(), ageHcal(), ageHE(), ageHF(), and hf_complete_aging().

4 def getHcalDigitizer(process):
5  if hasattr(process,'mixData'):
6  return process.mixData
7  if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process.mix.digitizers,'hcal'):
8  return process.mix.digitizers.hcal
9  return None
10 
def getHcalDigitizer(process)
Definition: aging.py:4
def aging.getHGCalDigitizer (   process,
  section 
)

Definition at line 11 of file aging.py.

11 def getHGCalDigitizer(process,section):
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  return None
20 
21 # change assumptions about lumi rate
def getHGCalDigitizer(process, section)
Definition: aging.py:11
def aging.hf_complete_aging (   process)

Definition at line 166 of file aging.py.

References getHcalDigitizer().

166 def hf_complete_aging(process):
167  if hasattr(process,'g4SimHits'):
168  process.g4SimHits.HCalSD.HFDarkening = cms.untracked.bool(True)
169  hcaldigi = getHcalDigitizer(process)
170  if hcaldigi is not None: hcaldigi.HFDarkening = cms.untracked.bool(False)
171  return process
172 
def getHcalDigitizer(process)
Definition: aging.py:4
def hf_complete_aging(process)
Definition: aging.py:166
def aging.setScenarioHLLHC (   module,
  scenarioHLLHC 
)

Definition at line 22 of file aging.py.

Referenced by ageHB(), and ageHE().

22 def setScenarioHLLHC(module,scenarioHLLHC):
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
29  return module
30 
31 # turnon = True enables default, False disables
32 # recalibration and darkening always together
def setScenarioHLLHC(module, scenarioHLLHC)
Definition: aging.py:22
def aging.turn_off_HB_aging (   process)

Definition at line 142 of file aging.py.

References ageHB().

142 def turn_off_HB_aging(process):
143  process = ageHB(process,False,"")
144  return process
145 
def ageHB(process, turnon, scenarioHLLHC)
Definition: aging.py:33
def turn_off_HB_aging(process)
Definition: aging.py:142
def aging.turn_off_HE_aging (   process)

Definition at line 150 of file aging.py.

References ageHE().

Referenced by customise_aging_1000(), customise_aging_3000(), customise_aging_3000_ultimate(), and customise_aging_4500_ultimate().

150 def turn_off_HE_aging(process):
151  process = ageHE(process,False,"")
152  return process
153 
def turn_off_HE_aging(process)
Definition: aging.py:150
def ageHE(process, turnon, scenarioHLLHC)
Definition: aging.py:44
def aging.turn_off_HF_aging (   process)

Definition at line 158 of file aging.py.

References ageHF().

158 def turn_off_HF_aging(process):
159  process = ageHF(process,False)
160  return process
161 
def turn_off_HF_aging(process)
Definition: aging.py:158
def ageHF(process, turnon)
Definition: aging.py:55
def aging.turn_off_SiPM_aging (   process)

Definition at line 162 of file aging.py.

References ageSiPM().

162 def turn_off_SiPM_aging(process):
163  process = ageSiPM(process,False,0.0)
164  return process
165 
def turn_off_SiPM_aging(process)
Definition: aging.py:162
def ageSiPM(process, turnon, lumi)
Definition: aging.py:68
def aging.turn_on_HB_aging (   process)

Definition at line 138 of file aging.py.

References ageHB().

138 def turn_on_HB_aging(process):
139  process = ageHB(process,True,"")
140  return process
141 
def ageHB(process, turnon, scenarioHLLHC)
Definition: aging.py:33
def turn_on_HB_aging(process)
Definition: aging.py:138
def aging.turn_on_HE_aging (   process)

Definition at line 146 of file aging.py.

References ageHE().

146 def turn_on_HE_aging(process):
147  process = ageHE(process,True,"")
148  return process
149 
def ageHE(process, turnon, scenarioHLLHC)
Definition: aging.py:44
def turn_on_HE_aging(process)
Definition: aging.py:146
def aging.turn_on_HF_aging (   process)

Definition at line 154 of file aging.py.

References ageHF().

154 def turn_on_HF_aging(process):
155  process = ageHF(process,True)
156  return process
157 
def ageHF(process, turnon)
Definition: aging.py:55
def turn_on_HF_aging(process)
Definition: aging.py:154