CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
aging.py
Go to the documentation of this file.
2 
3 def agePixel(process,lumi):
4  prd=1.0
5  if lumi>299:
6  prd=1.0
7  if lumi>499:
8  prd=1.5
9  if lumi>999:
10  prd=0.
11 
12  # danger - watch for someone turning off pixel aging - if off - leave off
13  if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process.mix.digitizers,'pixel') and not hasattr(process.mix.digitizers.pixel,'NoAging'):
14  process.mix.digitizers.pixel.PseudoRadDamage = cms.double(float(prd*7.65))
15  process.mix.digitizers.pixel.PseudoRadDamageRadius = cms.double(16.5)
16  return process
17 
18 def ageHcal(process,lumi):
19 
20  instLumi=1.0e34
21  if lumi>=1000:
22  instLumi=5.0e34
23 
24  if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process.mix.digitizers,'hcal'):
25  process.mix.digitizers.hcal.DelivLuminosity = cms.double(float(lumi)) # integrated lumi in fb-1
26  process.mix.digitizers.hcal.HEDarkening = cms.bool(True)
27  process.mix.digitizers.hcal.HFDarkening = cms.bool(True)
28 
29  #these lines need to be further activated by tuning on 'complete' aging for HF
30  if hasattr(process,'g4SimHits'):
31  process.g4SimHits.HCalSD.InstLuminosity = cms.double(float(instLumi))
32  process.g4SimHits.HCalSD.DelivLuminosity = cms.double(float(lumi))
33 
34  #recalibration and darkening always together
35  if hasattr(process,'es_hardcode'):
36  process.es_hardcode.HERecalibration = cms.bool(True)
37  process.es_hardcode.HFRecalibration = cms.bool(True)
38  process.es_hardcode.iLumi = cms.double(float(lumi))
39 
40  return process
41 
42 def ageEcal(process,lumi):
43 
44  instLumi=1.0e34
45  if lumi>=1000:
46  instLumi=5.0e34
47 
48  if hasattr(process,'g4SimHits'):
49  #these lines need to be further activiated by tuning on 'complete' aging for ecal
50  process.g4SimHits.ECalSD.InstLuminosity = cms.double(instLumi)
51  process.g4SimHits.ECalSD.DelivLuminosity = cms.double(float(lumi))
52  return process
53 
54 def customise_aging_100(process):
55 
56  process=ageHcal(process,100)
57  process=ageEcal(process,100)
58  process=agePixel(process,100)
59  return process
60 
61 def customise_aging_200(process):
62 
63  process=ageHcal(process,200)
64  process=ageEcal(process,200)
65  process=agePixel(process,200)
66  return process
67 
68 def customise_aging_300(process):
69 
70  process=ageHcal(process,300)
71  process=ageEcal(process,300)
72  process=agePixel(process,300)
73  return process
74 
75 def customise_aging_400(process):
76 
77  process=ageHcal(process,400)
78  process=ageEcal(process,400)
79  process=agePixel(process,400)
80  return process
81 
82 def customise_aging_500(process):
83 
84  process=ageHcal(process,500)
85  process=ageEcal(process,500)
86  process=agePixel(process,500)
87  return process
88 
89 def customise_aging_600(process):
90 
91  process=ageHcal(process,600)
92  process=ageEcal(process,600)
93  process=agePixel(process,600)
94  return process
95 
96 def customise_aging_700(process):
97 
98  process=ageHcal(process,700)
99  process=ageEcal(process,700)
100  process=agePixel(process,700)
101  return process
102 
103 def customise_aging_1000(process):
104 
105  process=ageHcal(process,1000)
106  process=ageEcal(process,1000)
107  process=agePixel(process,1000)
108  return process
109 
110 def customise_aging_3000(process):
111 
112  process=ageHcal(process,3000)
113  process=ageEcal(process,3000)
114  process=agePixel(process,3000)
115  return process
116 
118 
119  process=ageEcal(process,300)
120  return process
121 
123 
124  process=ageEcal(process,1000)
125  return process
126 
128 
129  process=ageEcal(process,3000)
130  return process
131 
133 
134  process=ageEcal(process,1000)
135  process=ageHcal(process,1000)
136  return process
137 
139 
140  process=ageEcal(process,3000)
141  process=ageHcal(process,3000)
142  return process
143 
144 #no hcal 3000
145 
146 def hf_complete_aging(process):
147  if hasattr(process,'g4SimHits'):
148  process.g4SimHits.HCalSD.HFDarkening = cms.untracked.bool(True)
149  if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process.mix.digitizers,'hcal'):
150  process.mix.digitizers.hcal.HFDarkening = cms.untracked.bool(False)
151  return process
152 
153 def ecal_complete_aging(process):
154  if hasattr(process,'g4SimHits'):
155  process.g4SimHits.ECalSD.AgeingWithSlopeLY = cms.untracked.bool(True)
156  if hasattr(process,'ecal_digi_parameters'):
157  process.ecal_digi_parameters.UseLCcorrection = cms.untracked.bool(False)
158  return process
159 
160 def turn_off_HE_aging(process):
161  if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process.mix.digitizers,'hcal'):
162  process.mix.digitizers.hcal.HEDarkening = cms.bool(False)
163  if hasattr(process,'es_hardcode'):
164  process.es_hardcode.HERecalibration = cms.bool(False)
165  return process
166 
167 def turn_off_HF_aging(process):
168  if hasattr(process,'g4SimHits'):
169  process.g4SimHits.HCalSD.HFDarkening = cms.untracked.bool(False)
170  if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process.mix.digitizers,'hcal'):
171  process.mix.digitizers.hcal.HFDarkening = cms.bool(False)
172  if hasattr(process,'es_hardcode'):
173  process.es_hardcode.HFRecalibration = cms.bool(False)
174  return process
175 
176 def turn_off_Pixel_aging(process):
177 
178  if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process.mix.digitizers,'hcal'):
179  setattr(process.mix.digitizers.pixel,'NoAging',cms.double(1.))
180  process.mix.digitizers.pixel.PseudoRadDamage = cms.double(0.)
181  return process
182 
184  # just incase we want aging afterall
185  if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process.mix.digitizers,'hcal'):
186  process.mix.digitizers.pixel.PseudoRadDamage = cms.double(1.5)
187  process.mix.digitizers.pixel.PseudoRadDamageRadius = cms.double(4.0)
188 
189  return process
190 
192  process=ecal_complete_aging(process)
193 
194  if not hasattr(process.GlobalTag,'toGet'):
195  process.GlobalTag.toGet=cms.VPSet()
196  process.GlobalTag.toGet.extend( cms.VPSet(
197  cms.PSet(record = cms.string("EcalPedestalsRcd"),
198  tag = cms.string("EcalPedestals_TL300_IL1E34_mc"),
199  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
200  ),
201  ## laser D
202  cms.PSet(record = cms.string("EcalLaserAPDPNRatiosRcd"),
203  tag = cms.string("EcalLaserAPDPNRatios_TL300_IL1E34_v2_mc"),
204  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
205  ),
206  ## L1 trigger
207  cms.PSet(record = cms.string("EcalTPGLinearizationConstRcd"),
208  tag = cms.string("EcalTPGLinearizationConst_TL300_IL1E34_v2_mc"),
209  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
210  ),
211  cms.PSet(record = cms.string('EcalLaserAlphasRcd'),
212  tag = cms.string('EcalLaserAlphas_EB_sic1_btcp1_EE_sic1_btcp1'),
213  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
214  ),
215  #VPT aging
216  cms.PSet(record = cms.string('EcalLinearCorrectionsRcd'),
217  tag = cms.string('EcalLinearCorrections_mc'),
218  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
219  )
220  )
221  )
222  return process
223 
224 
226  process=ecal_complete_aging(process)
227 
228  if not hasattr(process.GlobalTag,'toGet'):
229  process.GlobalTag.toGet=cms.VPSet()
230  process.GlobalTag.toGet.extend( cms.VPSet(
231  cms.PSet(record = cms.string("EcalPedestalsRcd"),
232  tag = cms.string("EcalPedestals_TL1000_IL5E34_mc"),
233  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
234  ),
235  ## laser D
236  cms.PSet(record = cms.string("EcalLaserAPDPNRatiosRcd"),
237  tag = cms.string("EcalLaserAPDPNRatios_TL1000_IL5E34_v2_mc"),
238  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
239  ),
240  ## L1 trigger
241  cms.PSet(record = cms.string("EcalTPGLinearizationConstRcd"),
242  tag = cms.string("EcalTPGLinearizationConst_TL1000_IL5E34_v2_mc"),
243  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
244  ),
245  cms.PSet(record = cms.string('EcalLaserAlphasRcd'),
246  tag = cms.string('EcalLaserAlphas_EB_sic1_btcp1_EE_sic1_btcp1'),
247  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
248  ),
249  #VPT aging
250  cms.PSet(record = cms.string('EcalLinearCorrectionsRcd'),
251  tag = cms.string('EcalLinearCorrections_mc'),
252  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
253  )
254  )
255  )
256  return process
257 
258 
260  process=ecal_complete_aging(process)
261 
262  if not hasattr(process.GlobalTag,'toGet'):
263  process.GlobalTag.toGet=cms.VPSet()
264  process.GlobalTag.toGet.extend( cms.VPSet(
265  cms.PSet(record = cms.string("EcalPedestalsRcd"),
266  tag = cms.string("EcalPedestals_TL3000_IL5E34_mc"),
267  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
268  ),
269  ## laser D
270  cms.PSet(record = cms.string("EcalLaserAPDPNRatiosRcd"),
271  tag = cms.string("EcalLaserAPDPNRatios_TL3000_IL5E34_v2_mc"),
272  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
273  ),
274  ## L1 trigger
275  cms.PSet(record = cms.string("EcalTPGLinearizationConstRcd"),
276  tag = cms.string("EcalTPGLinearizationConst_TL3000_IL5E34_v2_mc"),
277  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
278  ),
279  cms.PSet(record = cms.string('EcalLaserAlphasRcd'),
280  tag = cms.string('EcalLaserAlphas_EB_sic1_btcp1_EE_sic1_btcp1'),
281  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
282  ),
283  #VPT aging
284  cms.PSet(record = cms.string('EcalLinearCorrectionsRcd'),
285  tag = cms.string('EcalLinearCorrections_mc'),
286  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
287  )
288  )
289  )
290 
291  return process
292 
def customise_aging_3000
Definition: aging.py:110
def customise_aging_400
Definition: aging.py:75
def agePixel
Definition: aging.py:3
def turn_off_HE_aging
Definition: aging.py:160
def customise_aging_newpixel_1000
Definition: aging.py:132
def turn_off_HF_aging
Definition: aging.py:167
def customise_aging_100
Definition: aging.py:54
def hf_complete_aging
Definition: aging.py:146
def customise_aging_200
Definition: aging.py:61
def ecal_complete_aging_1000
Definition: aging.py:225
def turn_off_Pixel_aging
Definition: aging.py:176
def ecal_complete_aging_3000
Definition: aging.py:259
def ageHcal
Definition: aging.py:18
def ecal_complete_aging_300
Definition: aging.py:191
def customise_aging_300
Definition: aging.py:68
def customise_aging_newpixel_3000
Definition: aging.py:138
def customise_aging_600
Definition: aging.py:89
def customise_aging_ecalonly_3000
Definition: aging.py:127
def customise_aging_ecalonly_1000
Definition: aging.py:122
def turn_on_Pixel_aging_1000
Definition: aging.py:183
def customise_aging_500
Definition: aging.py:82
def customise_aging_ecalonly_300
Definition: aging.py:117
def ecal_complete_aging
Definition: aging.py:153
def ageEcal
Definition: aging.py:42
def customise_aging_1000
Definition: aging.py:103
def customise_aging_700
Definition: aging.py:96