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 getHGCalDigitizer(), and 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  for subdet in ['EE','FH','BH']:
65  hgcaldigi = getHGCalDigitizer(process,subdet)
66  if hgcaldigi is not None: HGCal_setEndOfLifeNoise(hgcaldigi)
67  return process
68 
69 # needs lumi to set proper ZS thresholds (tbd)
def getHGCalDigitizer(process, section)
Definition: aging.py:11
def HGCal_setEndOfLifeNoise(digitizer)
def agedHGCal(process)
Definition: aging.py:62
def aging.ageEcal (   process,
  lumi,
  instLumi 
)

Definition at line 134 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().

134 def ageEcal(process,lumi,instLumi):
135  if hasattr(process,'g4SimHits'):
136  #these lines need to be further activiated by tuning on 'complete' aging for ecal
137  process.g4SimHits.ECalSD.InstLuminosity = cms.double(instLumi)
138  process.g4SimHits.ECalSD.DelivLuminosity = cms.double(float(lumi))
139 
140  # available conditions
141  ecal_lumis = [300,1000,3000,4500]
142  ecal_conditions = [
143  ['EcalIntercalibConstantsRcd','EcalIntercalibConstants_TL{:d}_upgrade_8deg_v2_mc'],
144  ['EcalIntercalibConstantsMCRcd','EcalIntercalibConstantsMC_TL{:d}_upgrade_8deg_v2_mc'],
145  ['EcalLaserAPDPNRatiosRcd','EcalLaserAPDPNRatios_TL{:d}_upgrade_8deg_mc'],
146  ['EcalPedestalsRcd','EcalPedestals_TL{:d}_upgradeTIA_8deg_mc'],
147  ['EcalTPGLinearizationConstRcd','EcalTPGLinearizationConst_TL{:d}_upgrade_8deg_mc'],
148  ]
149 
150  # update PF thresholds, based on https://indico.cern.ch/event/653123/contributions/2659235/attachments/1491385/2318364/170711_upsg_ledovskoy.pdf
151  ecal_thresholds = {
152  300 : 0.103,
153  1000 : 0.175,
154  3000 : 0.435,
155  4500 : 0.707,
156  }
157  ecal_seed_multiplier = 2.5
158 
159  # try to get conditions
160  if int(lumi) in ecal_lumis:
161  if not hasattr(process.GlobalTag,'toGet'):
162  process.GlobalTag.toGet=cms.VPSet()
163  for ecal_condition in ecal_conditions:
164  process.GlobalTag.toGet.append(cms.PSet(
165  record = cms.string(ecal_condition[0]),
166  tag = cms.string(ecal_condition[1].format(int(lumi))),
167  connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS")
168  )
169  )
170  if hasattr(process,"particleFlowClusterECALUncorrected"):
171  _seeds = process.particleFlowClusterECALUncorrected.seedFinder.thresholdsByDetector
172  for iseed in range(0,len(_seeds)):
173  if _seeds[iseed].detector.value()=="ECAL_BARREL":
174  _seeds[iseed].seedingThreshold = cms.double(ecal_thresholds[int(lumi)]*ecal_seed_multiplier)
175  _clusters = process.particleFlowClusterECALUncorrected.initialClusteringStep.thresholdsByDetector
176  for icluster in range(0,len(_clusters)):
177  if _clusters[icluster].detector.value()=="ECAL_BARREL":
178  _clusters[icluster].gatheringThreshold = cms.double(ecal_thresholds[int(lumi)])
179 
180  return process
181 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:134
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 78 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().

78 def ageHcal(process,lumi,instLumi,scenarioHLLHC):
79  hcaldigi = getHcalDigitizer(process)
80  if hcaldigi is not None: hcaldigi.DelivLuminosity = cms.double(float(lumi)) # integrated lumi in fb-1
81 
82  # these lines need to be further activated by turning on 'complete' aging for HF
83  if hasattr(process,'g4SimHits'):
84  process.g4SimHits.HCalSD.InstLuminosity = cms.double(float(instLumi))
85  process.g4SimHits.HCalSD.DelivLuminosity = cms.double(float(lumi))
86 
87  # recalibration and darkening always together
88  if hasattr(process,'es_hardcode'):
89  process.es_hardcode.iLumi = cms.double(float(lumi))
90 
91  # functions to enable individual subdet aging
92  process = ageHB(process,True,scenarioHLLHC)
93  process = ageHE(process,True,scenarioHLLHC)
94  process = ageHF(process,True)
95  process = ageSiPM(process,True,lumi)
96 
97  return process
98 
def ageHB(process, turnon, scenarioHLLHC)
Definition: aging.py:33
def getHcalDigitizer(process)
Definition: aging.py:4
def ageSiPM(process, turnon, lumi)
Definition: aging.py:70
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:78
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 70 of file aging.py.

Referenced by ageHcal(), and turn_off_SiPM_aging().

70 def ageSiPM(process,turnon,lumi):
71  process.es_hardcode.hbUpgrade.doRadiationDamage = turnon
72  process.es_hardcode.heUpgrade.doRadiationDamage = turnon
73 
74  # todo: determine ZS threshold adjustments
75 
76  return process
77 
def ageSiPM(process, turnon, lumi)
Definition: aging.py:70
def aging.customise_aging_1000 (   process)

Definition at line 194 of file aging.py.

References ageEcal(), and ageHcal().

194 def customise_aging_1000(process):
195  process=ageHcal(process,1000,5.0e34,"nominal")
196  process=ageEcal(process,1000,5.0e34)
197  return process
198 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:134
def customise_aging_1000(process)
Definition: aging.py:194
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:78
def aging.customise_aging_300 (   process)

Definition at line 189 of file aging.py.

References ageEcal(), and ageHcal().

189 def customise_aging_300(process):
190  process=ageHcal(process,300,5.0e34,"nominal")
191  process=ageEcal(process,300,5.0e34)
192  return process
193 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:134
def customise_aging_300(process)
Definition: aging.py:189
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:78
def aging.customise_aging_3000 (   process)

Definition at line 199 of file aging.py.

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

199 def customise_aging_3000(process):
200  process=ageHcal(process,3000,5.0e34,"nominal")
201  process=ageEcal(process,3000,5.0e34)
202  process=agedHGCal(process)
203  return process
204 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:134
def agedHGCal(process)
Definition: aging.py:62
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:78
def customise_aging_3000(process)
Definition: aging.py:199
def aging.customise_aging_3000_ultimate (   process)

Definition at line 205 of file aging.py.

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

206  process=ageHcal(process,3000,7.5e34,"ultimate")
207  process=ageEcal(process,3000,7.5e34)
208  process=agedHGCal(process)
209  return process
210 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:134
def agedHGCal(process)
Definition: aging.py:62
def customise_aging_3000_ultimate(process)
Definition: aging.py:205
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:78
def aging.customise_aging_4500_ultimate (   process)

Definition at line 211 of file aging.py.

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

212  process=ageHcal(process,4500,7.5e34,"ultimate")
213  process=ageEcal(process,4500,7.5e34)
214  process=agedHGCal(process)
215  return process
216 
def ageEcal(process, lumi, instLumi)
Definition: aging.py:134
def customise_aging_4500_ultimate(process)
Definition: aging.py:211
def agedHGCal(process)
Definition: aging.py:62
def ageHcal(process, lumi, instLumi, scenarioHLLHC)
Definition: aging.py:78
def aging.ecal_complete_aging (   process)

Definition at line 182 of file aging.py.

182 def ecal_complete_aging(process):
183  if hasattr(process,'g4SimHits'):
184  process.g4SimHits.ECalSD.AgeingWithSlopeLY = cms.untracked.bool(True)
185  if hasattr(process,'ecal_digi_parameters'):
186  process.ecal_digi_parameters.UseLCcorrection = cms.untracked.bool(False)
187  return process
188 
def ecal_complete_aging(process)
Definition: aging.py:182
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.

Referenced by agedHGCal().

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 127 of file aging.py.

References getHcalDigitizer().

127 def hf_complete_aging(process):
128  if hasattr(process,'g4SimHits'):
129  process.g4SimHits.HCalSD.HFDarkening = cms.untracked.bool(True)
130  hcaldigi = getHcalDigitizer(process)
131  if hcaldigi is not None: hcaldigi.HFDarkening = cms.untracked.bool(False)
132  return process
133 
def getHcalDigitizer(process)
Definition: aging.py:4
def hf_complete_aging(process)
Definition: aging.py:127
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 103 of file aging.py.

References ageHB().

103 def turn_off_HB_aging(process):
104  process = ageHB(process,False,"")
105  return process
106 
def ageHB(process, turnon, scenarioHLLHC)
Definition: aging.py:33
def turn_off_HB_aging(process)
Definition: aging.py:103
def aging.turn_off_HE_aging (   process)

Definition at line 111 of file aging.py.

References ageHE().

111 def turn_off_HE_aging(process):
112  process = ageHE(process,False,"")
113  return process
114 
def turn_off_HE_aging(process)
Definition: aging.py:111
def ageHE(process, turnon, scenarioHLLHC)
Definition: aging.py:44
def aging.turn_off_HF_aging (   process)

Definition at line 119 of file aging.py.

References ageHF().

119 def turn_off_HF_aging(process):
120  process = ageHF(process,False)
121  return process
122 
def turn_off_HF_aging(process)
Definition: aging.py:119
def ageHF(process, turnon)
Definition: aging.py:55
def aging.turn_off_SiPM_aging (   process)

Definition at line 123 of file aging.py.

References ageSiPM().

123 def turn_off_SiPM_aging(process):
124  process = ageSiPM(process,False,0.0)
125  return process
126 
def turn_off_SiPM_aging(process)
Definition: aging.py:123
def ageSiPM(process, turnon, lumi)
Definition: aging.py:70
def aging.turn_on_HB_aging (   process)

Definition at line 99 of file aging.py.

References ageHB().

99 def turn_on_HB_aging(process):
100  process = ageHB(process,True,"")
101  return process
102 
def ageHB(process, turnon, scenarioHLLHC)
Definition: aging.py:33
def turn_on_HB_aging(process)
Definition: aging.py:99
def aging.turn_on_HE_aging (   process)

Definition at line 107 of file aging.py.

References ageHE().

107 def turn_on_HE_aging(process):
108  process = ageHE(process,True,"")
109  return process
110 
def ageHE(process, turnon, scenarioHLLHC)
Definition: aging.py:44
def turn_on_HE_aging(process)
Definition: aging.py:107
def aging.turn_on_HF_aging (   process)

Definition at line 115 of file aging.py.

References ageHF().

115 def turn_on_HF_aging(process):
116  process = ageHF(process,True)
117  return process
118 
def ageHF(process, turnon)
Definition: aging.py:55
def turn_on_HF_aging(process)
Definition: aging.py:115