CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
hgcalDigitizer_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 from SimCalorimetry.HGCalSimProducers.hgcROCParameters_cfi import hgcROCSettings
4 
5 # Base configurations for HGCal digitizers
6 eV_per_eh_pair = 3.62
7 fC_per_ele = 1.6020506e-4
8 nonAgedCCEs = [1.0, 1.0, 1.0]
9 nonAgedNoises = [2100.0,2100.0,1600.0] #100,200,300 um (in electrons)
10 nonAgedNoises_v9 = [2000.0,2400.0,2000.0] # 120,200,300 um (in electrons)
11 thresholdTracksMIP = True
12 
13 ileakParam_600V = [0.993,-42.668]
14 ileakParam_800V = [0.996,-42.464]
15 HGCAL_ileakParam_toUse = cms.PSet(
16  ileakParam = cms.vdouble(ileakParam_600V)
17  )
18 
19 # line+log tdr 600V
20 cceParamFine_tdr600 = [1.5e+15, -3.00394e-17, 0.318083] #120
21 cceParamThin_tdr600 = [1.5e+15, -3.09878e-16, 0.211207] #200
22 cceParamThick_tdr600 = [6e+14, -7.96539e-16, 0.251751] #300
23 # line+log tdr 800V
24 cceParamFine_tdr800 = [4.2e+15, 2.35482e-18, 0.553187] #120
25 cceParamThin_tdr800 = [1.5e+15, -1.98109e-16, 0.280567] #200
26 cceParamThick_tdr800 = [6e+14, -5.24999e-16, 0.357616] #300
27 # line+log ttu 600V
28 cceParamFine_ttu600 = [1.5e+15, 9.98631e-18, 0.343774] #120
29 cceParamThin_ttu600 = [1.5e+15, -2.17083e-16, 0.304873] #200
30 cceParamThick_ttu600 = [6e+14, -8.01557e-16, 0.157375] #300
31 # line+log ttu 800V
32 cceParamFine_ttu800 = [1.5e+15, 3.35246e-17, 0.251679] #120
33 cceParamThin_ttu800 = [1.5e+15, -1.62096e-16, 0.293828] #200
34 cceParamThick_ttu800 = [6e+14, -5.95259e-16, 0.183929] #300
35 # scaling the ddfz curve to match Timo's 800V measuremetn at 3.5E15
36 cceParamFine_epi800 = [3.5e+15, -1.4285714e-17, 0.263812] #120
37 # line+log tdr 600V EPI
38 cceParamFine_epi600 = [3.5e+15, -3.428571e-17, 0.263812] #120 - scaling the ddfz curve to match Timo's 600V measurement at 3.5E15
39 cceParamThin_epi600 = [1.5e+15, -3.09878e-16, 0.211207] #200
40 cceParamThick_epi600 = [6e+14, -7.96539e-16, 0.251751] #300
41 
42 
43 HGCAL_cceParams_toUse = cms.PSet(
44  cceParamFine = cms.vdouble(cceParamFine_epi600),
45  cceParamThin = cms.vdouble(cceParamThin_tdr600),
46  cceParamThick = cms.vdouble(cceParamThick_tdr600)
47  )
48 
49 HGCAL_noise_fC = cms.PSet(
50  scaleByDose = cms.bool(False),
51  scaleByDoseAlgo = cms.uint32(0),
52  scaleByDoseFactor = cms.double(1),
53  doseMap = cms.string(""),
54  values = cms.vdouble( [x*fC_per_ele for x in nonAgedNoises] ), #100,200,300 um
55  )
56 
57 HFNose_noise_fC = HGCAL_noise_fC.clone()
58 
59 HGCAL_noise_heback = cms.PSet(
60  scaleByDose = cms.bool(False),
61  scaleByDoseAlgo = cms.uint32(0),
62  scaleByDoseFactor = cms.double(1),
63  doseMap = cms.string(""), #empty dose map at begin-of-life
64  noise_MIP = cms.double(1./100.)
65  )
66 
67 HGCAL_chargeCollectionEfficiencies = cms.PSet(
68  values = cms.vdouble( nonAgedCCEs )
69  )
70 
71 HGCAL_noises = cms.PSet(
72  values = cms.vdouble([x for x in nonAgedNoises])
73  )
74 
75 # ECAL
76 hgceeDigitizer = cms.PSet(
77  accumulatorType = cms.string("HGCDigiProducer"),
78  digitizer = cms.string("HGCEEDigitizer"),
79  hitCollection = cms.string("HGCHitsEE"),
80  digiCollection = cms.string("HGCDigisEE"),
81  NoiseGeneration_Method = cms.bool(True),
82  maxSimHitsAccTime = cms.uint32(100),
83  bxTime = cms.double(25),
84  eVPerEleHolePair = cms.double(eV_per_eh_pair),
85  tofDelay = cms.double(5),
86  digitizationType = cms.uint32(0),
87  makeDigiSimLinks = cms.bool(False),
88  premixStage1 = cms.bool(False),
89  premixStage1MinCharge = cms.double(0),
90  premixStage1MaxCharge = cms.double(1e6),
91  useAllChannels = cms.bool(True),
92  verbosity = cms.untracked.uint32(0),
93  digiCfg = cms.PSet(
94  keV2fC = cms.double(0.044259), #1000 eV/3.62 (eV per e) / 6.24150934e3 (e per fC)
95  ileakParam = cms.PSet(refToPSet_ = cms.string("HGCAL_ileakParam_toUse")),
96  cceParams = cms.PSet(refToPSet_ = cms.string("HGCAL_cceParams_toUse")),
97  chargeCollectionEfficiencies = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
98  noise_fC = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_fC")),
99  doTimeSamples = cms.bool(False),
100  thresholdFollowsMIP = cms.bool(thresholdTracksMIP),
101  feCfg = hgcROCSettings.clone()
102  )
103  )
104 
105 # HCAL front
106 hgchefrontDigitizer = cms.PSet(
107  accumulatorType = cms.string("HGCDigiProducer"),
108  digitizer = cms.string("HGCHEfrontDigitizer"),
109  hitCollection = cms.string("HGCHitsHEfront"),
110  digiCollection = cms.string("HGCDigisHEfront"),
111  NoiseGeneration_Method = cms.bool(True),
112  maxSimHitsAccTime = cms.uint32(100),
113  bxTime = cms.double(25),
114  tofDelay = cms.double(5),
115  digitizationType = cms.uint32(0),
116  makeDigiSimLinks = cms.bool(False),
117  premixStage1 = cms.bool(False),
118  premixStage1MinCharge = cms.double(0),
119  premixStage1MaxCharge = cms.double(1e6),
120  useAllChannels = cms.bool(True),
121  verbosity = cms.untracked.uint32(0),
122  digiCfg = cms.PSet(
123  keV2fC = cms.double(0.044259), #1000 eV / 3.62 (eV per e) / 6.24150934e3 (e per fC)
124  ileakParam = cms.PSet(refToPSet_ = cms.string("HGCAL_ileakParam_toUse")),
125  cceParams = cms.PSet(refToPSet_ = cms.string("HGCAL_cceParams_toUse")),
126  chargeCollectionEfficiencies = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
127  noise_fC = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_fC")),
128  doTimeSamples = cms.bool(False),
129  thresholdFollowsMIP = cms.bool(thresholdTracksMIP),
130  feCfg = hgcROCSettings.clone()
131  )
132 )
133 
134 # HCAL back
135 hgchebackDigitizer = cms.PSet(
136  accumulatorType = cms.string("HGCDigiProducer"),
137  digitizer = cms.string("HGCHEbackDigitizer"),
138  hitCollection = cms.string("HGCHitsHEback"),
139  digiCollection = cms.string("HGCDigisHEback"),
140  NoiseGeneration_Method = cms.bool(True),
141  maxSimHitsAccTime = cms.uint32(100),
142  bxTime = cms.double(25),
143  tofDelay = cms.double(1),
144  digitizationType = cms.uint32(1),
145  makeDigiSimLinks = cms.bool(False),
146  premixStage1 = cms.bool(False),
147  premixStage1MinCharge = cms.double(0),
148  premixStage1MaxCharge = cms.double(1e6),
149  useAllChannels = cms.bool(True),
150  verbosity = cms.untracked.uint32(0),
151  digiCfg = cms.PSet(
152  #0 empty digitizer, 1 calice digitizer, 2 realistic digitizer
153  algo = cms.uint32(2),
154  scaleByTileArea= cms.bool(False),
155  scaleBySipmArea= cms.bool(False),
156  sipmMap = cms.string("SimCalorimetry/HGCalSimProducers/data/sipmParams_geom-10.txt"),
157  noise = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_heback")), #scales both for scint raddam and sipm dark current
158  keV2MIP = cms.double(1./675.0),
159  doTimeSamples = cms.bool(False),
160  nPEperMIP = cms.double(21.0),
161  nTotalPE = cms.double(7500),
162  xTalk = cms.double(0.01),
163  sdPixels = cms.double(1e-6), # this is additional photostatistics noise (as implemented), not sure why it's here...
164  thresholdFollowsMIP = cms.bool(thresholdTracksMIP),
165  feCfg = hgcROCSettings.clone(
166  adcNbits = 10, # standard ROC operations (was 2 bits more up to 11_0_0_pre12)
167  adcSaturation_fC = 68.75, # keep the adc LSB the same (i.e. set saturation one quarter value of pre12)
168  tdcSaturation_fC = 1000, # allow up to 1000 MIPs as a max range, including ToA mode
169  targetMIPvalue_ADC = 15, # to be used for HGCROC gain proposal
170  adcThreshold_fC = 0.5, # unchanged with respect to pre12
171  tdcOnset_fC = 55, # turn on TDC when 80% of the ADC range is reached (one quarter of pre12
172  # indicative at this point)
173  tdcForToAOnset_fC = cms.vdouble(12.,12.,12.), #turn ToA for 20% of the TDC threshold (indicative at this point)
174  )
175  )
176 )
177 
178 # HFNose
179 hfnoseDigitizer = cms.PSet(
180  accumulatorType = cms.string("HGCDigiProducer"),
181  digitizer = cms.string("HFNoseDigitizer"),
182  hitCollection = cms.string("HFNoseHits"),
183  digiCollection = cms.string("HFNoseDigis"),
184  NoiseGeneration_Method = cms.bool(True),
185  maxSimHitsAccTime = cms.uint32(100),
186  bxTime = cms.double(25),
187  eVPerEleHolePair = cms.double(eV_per_eh_pair),
188  tofDelay = cms.double(5),
189  digitizationType = cms.uint32(0),
190  makeDigiSimLinks = cms.bool(False),
191  premixStage1 = cms.bool(False),
192  premixStage1MinCharge = cms.double(0),
193  premixStage1MaxCharge = cms.double(1e6),
194  useAllChannels = cms.bool(True),
195  verbosity = cms.untracked.uint32(0),
196  digiCfg = cms.PSet(
197  keV2fC = cms.double(0.044259), #1000 eV/3.62 (eV per e) / 6.24150934e3 (e per fC)
198  ileakParam = cms.PSet(refToPSet_ = cms.string("HGCAL_ileakParam_toUse")),
199  cceParams = cms.PSet(refToPSet_ = cms.string("HGCAL_cceParams_toUse")),
200  chargeCollectionEfficiencies = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
201  noise_fC = cms.PSet(refToPSet_ = cms.string("HFNose_noise_fC")),
202  doTimeSamples = cms.bool(False),
203  thresholdFollowsMIP = cms.bool(thresholdTracksMIP),
204  feCfg = hgcROCSettings.clone()
205  )
206  )
207 
208 # this bypasses the noise simulation
209 from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1
210 for _m in [hgceeDigitizer, hgchefrontDigitizer, hgchebackDigitizer, hfnoseDigitizer]:
211  premix_stage1.toModify(_m, premixStage1 = True)
212 
213 #function to set noise to aged HGCal
214 endOfLifeCCEs = [0.5, 0.5, 0.7]
215 endOfLifeNoises = [2400.0,2250.0,1750.0]
216 def HGCal_setEndOfLifeNoise(process,byDose=True,byDoseAlgo=0,byDoseFactor=1):
217  """includes all effects from radiation and gain choice"""
218  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
219  process=HGCal_setRealisticNoiseSi(process,byDose=byDose,byDoseAlgo=byDoseAlgo,byDoseFactor=byDoseFactor)
220  process=HGCal_setRealisticNoiseSci(process,byDose=byDose,byDoseAlgo=byDoseAlgo,byDoseFactor=byDoseFactor)
221  return process
222 
224  process.HGCAL_cceParams_toUse = cms.PSet(
225  cceParamFine = cms.vdouble(cceParamFine_epi800),
226  cceParamThin = cms.vdouble(cceParamThin_tdr800),
227  cceParamThick = cms.vdouble(cceParamThick_tdr800)
228  )
229  process.HGCAL_ileakParam_toUse = cms.PSet(
230  ileakParam = cms.vdouble(ileakParam_800V)
231  )
232  return HGCal_setEndOfLifeNoise(process,byDoseFactor=1.333)
233 
235  process.HGCAL_cceParams_toUse = cms.PSet(
236  cceParamFine = cms.vdouble(cceParamFine_epi600),
237  cceParamThin = cms.vdouble(cceParamThin_tdr600),
238  cceParamThick = cms.vdouble(cceParamThick_tdr600)
239  )
240  process.HGCAL_ileakParam_toUse = cms.PSet(
241  ileakParam = cms.vdouble(ileakParam_600V)
242  )
243  return HGCal_setEndOfLifeNoise(process,byDoseFactor=0.5)
244 
245 def HGCal_ignoreFluence(process):
246  """include all effects except fluence impact on leakage current and CCE"""
247  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
248  # for instance turning on the 0th bit turns off the impact of fluence
249  process=HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=1)
250  process=HGCal_setRealisticNoiseSci(process,byDose=True,byDoseAlgo=1)
251  return process
252 
254  """include all effects except fluence impact on leakage current and CCE"""
255  #note: realistic electronics with Sci is not yet switched on
256  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
257  # for instance turning on the 0th bit turns off the impact of fluence
258  process=HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=1)
259  return process
260 
261 def HGCal_ignoreNoise(process):
262  """include all effects except noise impact on leakage current and CCE, and scint"""
263  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
264  # for instance turning on the 2nd bit activates ignoring the cache
265  process=HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=4)
266  process=HGCal_setRealisticNoiseSci(process,byDose=True,byDoseAlgo=4)
267  return process
268 
270  """include all effects except the per-gain pulse emulation"""
271  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
272  # for instance turning on the 3rd bit activates ignoring the cache
273  process=HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=8)
274  process=HGCal_setRealisticNoiseSci(process,byDose=True,byDoseAlgo=8)
275  return process
276 
277 def HGCal_useCaching(process):
278  """include all effects except cachine of siop parameters (gain cpu time)"""
279  #note: realistic electronics with Sci is not yet switched on
280  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
281  # for instance turning on the 4th bit activates using the cache
282  process=HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=16)
283  process=HGCal_setRealisticNoiseSci(process,byDose=True,byDoseAlgo=16)
284  return process
285 
286 doseMap = cms.string("SimCalorimetry/HGCalSimProducers/data/doseParams_3000fb_fluka-3.7.20.txt")
287 
288 def HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=0,byDoseMap=doseMap,byDoseFactor=1):
289  process.HGCAL_noise_fC = cms.PSet(
290  scaleByDose = cms.bool(byDose),
291  scaleByDoseAlgo = cms.uint32(byDoseAlgo),
292  scaleByDoseFactor = cms.double(byDoseFactor),
293  doseMap = byDoseMap,
294  values = cms.vdouble( [x*fC_per_ele for x in endOfLifeNoises] ), #100,200,300 um
295  )
296  process.HGCAL_chargeCollectionEfficiencies = cms.PSet(
297  values = cms.vdouble(endOfLifeCCEs)
298  )
299  process.HGCAL_noises = cms.PSet(
300  values = cms.vdouble([x for x in endOfLifeNoises])
301  )
302  return process
303 
304 def HFNose_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=0,byDoseMap=doseMap,byDoseFactor=1):
305  process.HFNose_noise_fC = cms.PSet(
306  scaleByDose = cms.bool(byDose),
307  scaleByDoseAlgo = cms.uint32(byDoseAlgo),
308  scaleByDoseFactor = cms.double(byDoseFactor),
309  doseMap = byDoseMap,
310  values = cms.vdouble( [x*fC_per_ele for x in endOfLifeNoises] ), #100,200,300 um
311  )
312  return process
313 
314 
315 def HGCal_setRealisticNoiseSci(process,byDose=True,byDoseAlgo=0,byDoseMap=doseMap,byDoseFactor=1):
316  process.HGCAL_noise_heback = cms.PSet(
317  scaleByDose = cms.bool(byDose),
318  scaleByDoseAlgo = cms.uint32(byDoseAlgo),
319  scaleByDoseFactor = cms.double(byDoseFactor),
320  doseMap = byDoseMap,
321  noise_MIP = cms.double(1./5.) #uses noise map
322  )
323  return process
324 
325 def HGCal_disableNoise(process):
326  process.HGCAL_noise_fC = cms.PSet(
327  scaleByDose = cms.bool(False),
328  scaleByDoseAlgo = cms.uint32(0),
329  scaleByDoseFactor = cms.double(1),
330  doseMap = cms.string(""),
331  values = cms.vdouble(0,0,0), #100,200,300 um
332  )
333  process.HGCAL_noise_heback = cms.PSet(
334  scaleByDose = cms.bool(False),
335  scaleByDoseAlgo = cms.uint32(0),
336  scaleByDoseFactor = cms.double(1),
337  doseMap = cms.string(""),
338  noise_MIP = cms.double(0.) #zero noise
339  )
340  process.HGCAL_noises = cms.PSet(
341  values = cms.vdouble(0,0,0)
342  )
343  return process
344 
345 from Configuration.Eras.Modifier_phase2_hgcalV10_cff import phase2_hgcalV10
346 
347 phase2_hgcalV10.toModify(HGCAL_noise_fC, values = [x*fC_per_ele for x in nonAgedNoises_v9])
348 phase2_hgcalV10.toModify(HGCAL_noises, values = [x for x in nonAgedNoises_v9])
349 
350 def HFNose_setEndOfLifeNoise(process,byDose=True,byDoseAlgo=0,byDoseFactor=1):
351  """includes all effects from radiation and gain choice"""
352  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
353  process=HFNose_setRealisticNoiseSi(process,byDose=byDose,byDoseAlgo=byDoseAlgo,byDoseMap=doseMapNose,byDoseFactor=byDoseFactor)
354  return process
355 
356 doseMapNose = cms.string("SimCalorimetry/HGCalSimProducers/data/doseParams_3000fb_fluka_HFNose_3.7.20.12_Eta2.4.txt")
hgcalDigitizer_cfi.HGCal_setEndOfLifeNoise_4000
def HGCal_setEndOfLifeNoise_4000(process)
Definition: hgcalDigitizer_cfi.py:223
hgcalDigitizer_cfi.HFNose_setEndOfLifeNoise
def HFNose_setEndOfLifeNoise(process, byDose=True, byDoseAlgo=0, byDoseFactor=1)
Definition: hgcalDigitizer_cfi.py:350
hgcalDigitizer_cfi.HGCal_ignoreFluence
def HGCal_ignoreFluence(process)
Definition: hgcalDigitizer_cfi.py:245
hgcalDigitizer_cfi.HGCal_disableNoise
def HGCal_disableNoise(process)
Definition: hgcalDigitizer_cfi.py:325
hgcalDigitizer_cfi.HGCal_ignoreNoise
def HGCal_ignoreNoise(process)
Definition: hgcalDigitizer_cfi.py:261
hgcalDigitizer_cfi.HGCal_setEndOfLifeNoise
def HGCal_setEndOfLifeNoise(process, byDose=True, byDoseAlgo=0, byDoseFactor=1)
Definition: hgcalDigitizer_cfi.py:216
hgcalDigitizer_cfi.HGCal_setEndOfLifeNoise_1500
def HGCal_setEndOfLifeNoise_1500(process)
Definition: hgcalDigitizer_cfi.py:234
hgcalDigitizer_cfi.HFNose_setRealisticNoiseSi
def HFNose_setRealisticNoiseSi(process, byDose=True, byDoseAlgo=0, byDoseMap=doseMap, byDoseFactor=1)
Definition: hgcalDigitizer_cfi.py:304
hgcalDigitizer_cfi.HGCal_useCaching
def HGCal_useCaching(process)
Definition: hgcalDigitizer_cfi.py:277
hgcalDigitizer_cfi.HGCal_setRealisticNoiseSi
def HGCal_setRealisticNoiseSi(process, byDose=True, byDoseAlgo=0, byDoseMap=doseMap, byDoseFactor=1)
Definition: hgcalDigitizer_cfi.py:288
hgcalDigitizer_cfi.HGCal_setRealisticNoiseSci
def HGCal_setRealisticNoiseSci(process, byDose=True, byDoseAlgo=0, byDoseMap=doseMap, byDoseFactor=1)
Definition: hgcalDigitizer_cfi.py:315
hgcalDigitizer_cfi.HGCal_ignorePulsePerGain
def HGCal_ignorePulsePerGain(process)
Definition: hgcalDigitizer_cfi.py:269
hgcalDigitizer_cfi.HGCal_setRealisticStartupNoise
def HGCal_setRealisticStartupNoise(process)
Definition: hgcalDigitizer_cfi.py:253