CMS 3D CMS Logo

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 HGCAL_noise_heback = cms.PSet(
58  scaleByDose = cms.bool(False),
59  scaleByDoseAlgo = cms.uint32(0),
60  scaleByDoseFactor = cms.double(1),
61  doseMap = cms.string(""), #empty dose map at begin-of-life
62  noise_MIP = cms.double(1./100.)
63  )
64 
65 HGCAL_chargeCollectionEfficiencies = cms.PSet(
66  values = cms.vdouble( nonAgedCCEs )
67  )
68 
69 HGCAL_noises = cms.PSet(
70  values = cms.vdouble([x for x in nonAgedNoises])
71  )
72 
73 # ECAL
74 hgceeDigitizer = cms.PSet(
75  accumulatorType = cms.string("HGCDigiProducer"),
76  digitizer = cms.string("HGCEEDigitizer"),
77  hitCollection = cms.string("HGCHitsEE"),
78  digiCollection = cms.string("HGCDigisEE"),
79  NoiseGeneration_Method = cms.bool(True),
80  maxSimHitsAccTime = cms.uint32(100),
81  bxTime = cms.double(25),
82  eVPerEleHolePair = cms.double(eV_per_eh_pair),
83  tofDelay = cms.double(5),
84  digitizationType = cms.uint32(0),
85  makeDigiSimLinks = cms.bool(False),
86  premixStage1 = cms.bool(False),
87  premixStage1MinCharge = cms.double(0),
88  premixStage1MaxCharge = cms.double(1e6),
89  useAllChannels = cms.bool(True),
90  verbosity = cms.untracked.uint32(0),
91  digiCfg = cms.PSet(
92  keV2fC = cms.double(0.044259), #1000 eV/3.62 (eV per e) / 6.24150934e3 (e per fC)
93  ileakParam = cms.PSet(refToPSet_ = cms.string("HGCAL_ileakParam_toUse")),
94  cceParams = cms.PSet(refToPSet_ = cms.string("HGCAL_cceParams_toUse")),
95  chargeCollectionEfficiencies = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
96  noise_fC = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_fC")),
97  doTimeSamples = cms.bool(False),
98  thresholdFollowsMIP = cms.bool(thresholdTracksMIP),
99  feCfg = hgcROCSettings.clone()
100  )
101  )
102 
103 # HCAL front
104 hgchefrontDigitizer = cms.PSet(
105  accumulatorType = cms.string("HGCDigiProducer"),
106  digitizer = cms.string("HGCHEfrontDigitizer"),
107  hitCollection = cms.string("HGCHitsHEfront"),
108  digiCollection = cms.string("HGCDigisHEfront"),
109  NoiseGeneration_Method = cms.bool(True),
110  maxSimHitsAccTime = cms.uint32(100),
111  bxTime = cms.double(25),
112  tofDelay = cms.double(5),
113  digitizationType = cms.uint32(0),
114  makeDigiSimLinks = cms.bool(False),
115  premixStage1 = cms.bool(False),
116  premixStage1MinCharge = cms.double(0),
117  premixStage1MaxCharge = cms.double(1e6),
118  useAllChannels = cms.bool(True),
119  verbosity = cms.untracked.uint32(0),
120  digiCfg = cms.PSet(
121  keV2fC = cms.double(0.044259), #1000 eV / 3.62 (eV per e) / 6.24150934e3 (e per fC)
122  ileakParam = cms.PSet(refToPSet_ = cms.string("HGCAL_ileakParam_toUse")),
123  cceParams = cms.PSet(refToPSet_ = cms.string("HGCAL_cceParams_toUse")),
124  chargeCollectionEfficiencies = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
125  noise_fC = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_fC")),
126  doTimeSamples = cms.bool(False),
127  thresholdFollowsMIP = cms.bool(thresholdTracksMIP),
128  feCfg = hgcROCSettings.clone()
129  )
130 )
131 
132 # HCAL back
133 hgchebackDigitizer = cms.PSet(
134  accumulatorType = cms.string("HGCDigiProducer"),
135  digitizer = cms.string("HGCHEbackDigitizer"),
136  hitCollection = cms.string("HGCHitsHEback"),
137  digiCollection = cms.string("HGCDigisHEback"),
138  NoiseGeneration_Method = cms.bool(True),
139  maxSimHitsAccTime = cms.uint32(100),
140  bxTime = cms.double(25),
141  tofDelay = cms.double(1),
142  digitizationType = cms.uint32(1),
143  makeDigiSimLinks = cms.bool(False),
144  premixStage1 = cms.bool(False),
145  premixStage1MinCharge = cms.double(0),
146  premixStage1MaxCharge = cms.double(1e6),
147  useAllChannels = cms.bool(True),
148  verbosity = cms.untracked.uint32(0),
149  digiCfg = cms.PSet(
150  #0 empty digitizer, 1 calice digitizer, 2 realistic digitizer
151  algo = cms.uint32(2),
152  scaleByTileArea= cms.bool(False),
153  scaleBySipmArea= cms.bool(False),
154  sipmMap = cms.string("SimCalorimetry/HGCalSimProducers/data/sipmParams_geom-10.txt"),
155  noise = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_heback")), #scales both for scint raddam and sipm dark current
156  keV2MIP = cms.double(1./675.0),
157  doTimeSamples = cms.bool(False),
158  nPEperMIP = cms.double(21.0),
159  nTotalPE = cms.double(7500),
160  xTalk = cms.double(0.01),
161  sdPixels = cms.double(1e-6), # this is additional photostatistics noise (as implemented), not sure why it's here...
162  thresholdFollowsMIP = cms.bool(thresholdTracksMIP),
163  feCfg = hgcROCSettings.clone(
164  adcNbits = 10, # standard ROC operations (was 2 bits more up to 11_0_0_pre12)
165  adcSaturation_fC = 68.75, # keep the adc LSB the same (i.e. set saturation one quarter value of pre12)
166  tdcSaturation_fC = 1000, # allow up to 1000 MIPs as a max range, including ToA mode
167  targetMIPvalue_ADC = 15, # to be used for HGCROC gain proposal
168  adcThreshold_fC = 0.5, # unchanged with respect to pre12
169  tdcOnset_fC = 55, # turn on TDC when 80% of the ADC range is reached (one quarter of pre12
170  # indicative at this point)
171  tdcForToAOnset_fC = cms.vdouble(12.,12.,12.), #turn ToA for 20% of the TDC threshold (indicative at this point)
172  )
173  )
174 )
175 
176 # HFNose
177 hfnoseDigitizer = cms.PSet(
178  accumulatorType = cms.string("HGCDigiProducer"),
179  digitizer = cms.string("HFNoseDigitizer"),
180  hitCollection = cms.string("HFNoseHits"),
181  digiCollection = cms.string("HFNoseDigis"),
182  NoiseGeneration_Method = cms.bool(True),
183  maxSimHitsAccTime = cms.uint32(100),
184  bxTime = cms.double(25),
185  eVPerEleHolePair = cms.double(eV_per_eh_pair),
186  tofDelay = cms.double(5),
187  digitizationType = cms.uint32(0),
188  makeDigiSimLinks = cms.bool(False),
189  premixStage1 = cms.bool(False),
190  premixStage1MinCharge = cms.double(0),
191  premixStage1MaxCharge = cms.double(1e6),
192  useAllChannels = cms.bool(True),
193  verbosity = cms.untracked.uint32(0),
194  digiCfg = cms.PSet(
195  keV2fC = cms.double(0.044259), #1000 eV/3.62 (eV per e) / 6.24150934e3 (e per fC)
196  ileakParam = cms.PSet(refToPSet_ = cms.string("HGCAL_ileakParam_toUse")),
197  cceParams = cms.PSet(refToPSet_ = cms.string("HGCAL_cceParams_toUse")),
198  chargeCollectionEfficiencies = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
199  noise_fC = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_fC")),
200  doTimeSamples = cms.bool(False),
201  thresholdFollowsMIP = cms.bool(thresholdTracksMIP),
202  feCfg = hgcROCSettings.clone()
203  )
204  )
205 
206 # this bypasses the noise simulation
207 from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1
208 for _m in [hgceeDigitizer, hgchefrontDigitizer, hgchebackDigitizer, hfnoseDigitizer]:
209  premix_stage1.toModify(_m, premixStage1 = True)
210 
211 #function to set noise to aged HGCal
212 endOfLifeCCEs = [0.5, 0.5, 0.7]
213 endOfLifeNoises = [2400.0,2250.0,1750.0]
214 def HGCal_setEndOfLifeNoise(process,byDose=True,byDoseAlgo=0,byDoseFactor=1):
215  """includes all effects from radiation and gain choice"""
216  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
217  process=HGCal_setRealisticNoiseSi(process,byDose=byDose,byDoseAlgo=byDoseAlgo,byDoseFactor=byDoseFactor)
218  process=HGCal_setRealisticNoiseSci(process,byDose=byDose,byDoseAlgo=byDoseAlgo,byDoseFactor=byDoseFactor)
219  return process
220 
222  process.HGCAL_cceParams_toUse = cms.PSet(
223  cceParamFine = cms.vdouble(cceParamFine_epi800),
224  cceParamThin = cms.vdouble(cceParamThin_tdr800),
225  cceParamThick = cms.vdouble(cceParamThick_tdr800)
226  )
227  process.HGCAL_ileakParam_toUse = cms.PSet(
228  ileakParam = cms.vdouble(ileakParam_800V)
229  )
230  return HGCal_setEndOfLifeNoise(process,byDoseFactor=1.333)
231 
233  process.HGCAL_cceParams_toUse = cms.PSet(
234  cceParamFine = cms.vdouble(cceParamFine_epi600),
235  cceParamThin = cms.vdouble(cceParamThin_tdr600),
236  cceParamThick = cms.vdouble(cceParamThick_tdr600)
237  )
238  process.HGCAL_ileakParam_toUse = cms.PSet(
239  ileakParam = cms.vdouble(ileakParam_600V)
240  )
241  return HGCal_setEndOfLifeNoise(process,byDoseFactor=0.5)
242 
243 def HGCal_ignoreFluence(process):
244  """include all effects except fluence impact on leakage current and CCE"""
245  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
246  # for instance turning on the 0th bit turns off the impact of fluence
247  process=HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=1)
248  process=HGCal_setRealisticNoiseSci(process,byDose=True,byDoseAlgo=1)
249  return process
250 
252  """include all effects except fluence impact on leakage current and CCE"""
253  #note: realistic electronics with Sci is not yet switched on
254  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
255  # for instance turning on the 0th bit turns off the impact of fluence
256  process=HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=1)
257  return process
258 
259 def HGCal_ignoreNoise(process):
260  """include all effects except noise impact on leakage current and CCE, and scint"""
261  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
262  # for instance turning on the 2nd bit activates ignoring the cache
263  process=HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=4)
264  process=HGCal_setRealisticNoiseSci(process,byDose=True,byDoseAlgo=4)
265  return process
266 
268  """include all effects except the per-gain pulse emulation"""
269  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
270  # for instance turning on the 3rd bit activates ignoring the cache
271  process=HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=8)
272  process=HGCal_setRealisticNoiseSci(process,byDose=True,byDoseAlgo=8)
273  return process
274 
275 def HGCal_useCaching(process):
276  """include all effects except cachine of siop parameters (gain cpu time)"""
277  #note: realistic electronics with Sci is not yet switched on
278  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
279  # for instance turning on the 4th bit activates using the cache
280  process=HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=16)
281  process=HGCal_setRealisticNoiseSci(process,byDose=True,byDoseAlgo=16)
282  return process
283 
284 doseMap = cms.string("SimCalorimetry/HGCalSimProducers/data/doseParams_3000fb_fluka-3.7.20.txt")
285 
286 def HGCal_setRealisticNoiseSi(process,byDose=True,byDoseAlgo=0,byDoseMap=doseMap,byDoseFactor=1):
287  process.HGCAL_noise_fC = cms.PSet(
288  scaleByDose = cms.bool(byDose),
289  scaleByDoseAlgo = cms.uint32(byDoseAlgo),
290  scaleByDoseFactor = cms.double(byDoseFactor),
291  doseMap = byDoseMap,
292  values = cms.vdouble( [x*fC_per_ele for x in endOfLifeNoises] ), #100,200,300 um
293  )
294  process.HGCAL_chargeCollectionEfficiencies = cms.PSet(
295  values = cms.vdouble(endOfLifeCCEs)
296  )
297  process.HGCAL_noises = cms.PSet(
298  values = cms.vdouble([x for x in endOfLifeNoises])
299  )
300  return process
301 
302 def HGCal_setRealisticNoiseSci(process,byDose=True,byDoseAlgo=0,byDoseMap=doseMap,byDoseFactor=1):
303  process.HGCAL_noise_heback = cms.PSet(
304  scaleByDose = cms.bool(byDose),
305  scaleByDoseAlgo = cms.uint32(byDoseAlgo),
306  scaleByDoseFactor = cms.double(byDoseFactor),
307  doseMap = byDoseMap,
308  noise_MIP = cms.double(1./5.) #uses noise map
309  )
310  return process
311 
312 def HGCal_disableNoise(process):
313  process.HGCAL_noise_fC = cms.PSet(
314  scaleByDose = cms.bool(False),
315  scaleByDoseAlgo = cms.uint32(0),
316  scaleByDoseFactor = cms.double(1),
317  doseMap = cms.string(""),
318  values = cms.vdouble(0,0,0), #100,200,300 um
319  )
320  process.HGCAL_noise_heback = cms.PSet(
321  scaleByDose = cms.bool(False),
322  scaleByDoseAlgo = cms.uint32(0),
323  scaleByDoseFactor = cms.double(1),
324  doseMap = cms.string(""),
325  noise_MIP = cms.double(0.) #zero noise
326  )
327  process.HGCAL_noises = cms.PSet(
328  values = cms.vdouble(0,0,0)
329  )
330  return process
331 
332 from Configuration.Eras.Modifier_phase2_hgcalV10_cff import phase2_hgcalV10
333 
334 phase2_hgcalV10.toModify(HGCAL_noise_fC, values = [x*fC_per_ele for x in nonAgedNoises_v9])
335 phase2_hgcalV10.toModify(HGCAL_noises, values = [x for x in nonAgedNoises_v9])
336 
337 def HFNose_setEndOfLifeNoise(process,byDose=True,byDoseAlgo=0,byDoseFactor=1):
338  """includes all effects from radiation and gain choice"""
339  # byDoseAlgo is used as a collection of bits to toggle: FLUENCE, CCE, NOISE, PULSEPERGAIN, CACHEDOP (from lsb to Msb)
340  process=HGCal_setRealisticNoiseSi(process,byDose=byDose,byDoseAlgo=byDoseAlgo,byDoseMap=doseMapNose,byDoseFactor=byDoseFactor)
341  return process
342 
343 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:221
hgcalDigitizer_cfi.HFNose_setEndOfLifeNoise
def HFNose_setEndOfLifeNoise(process, byDose=True, byDoseAlgo=0, byDoseFactor=1)
Definition: hgcalDigitizer_cfi.py:337
hgcalDigitizer_cfi.HGCal_ignoreFluence
def HGCal_ignoreFluence(process)
Definition: hgcalDigitizer_cfi.py:243
hgcalDigitizer_cfi.HGCal_disableNoise
def HGCal_disableNoise(process)
Definition: hgcalDigitizer_cfi.py:312
hgcalDigitizer_cfi.HGCal_ignoreNoise
def HGCal_ignoreNoise(process)
Definition: hgcalDigitizer_cfi.py:259
hgcalDigitizer_cfi.HGCal_setEndOfLifeNoise
def HGCal_setEndOfLifeNoise(process, byDose=True, byDoseAlgo=0, byDoseFactor=1)
Definition: hgcalDigitizer_cfi.py:214
hgcalDigitizer_cfi.HGCal_setEndOfLifeNoise_1500
def HGCal_setEndOfLifeNoise_1500(process)
Definition: hgcalDigitizer_cfi.py:232
hgcalDigitizer_cfi.HGCal_useCaching
def HGCal_useCaching(process)
Definition: hgcalDigitizer_cfi.py:275
hgcalDigitizer_cfi.HGCal_setRealisticNoiseSi
def HGCal_setRealisticNoiseSi(process, byDose=True, byDoseAlgo=0, byDoseMap=doseMap, byDoseFactor=1)
Definition: hgcalDigitizer_cfi.py:286
hgcalDigitizer_cfi.HGCal_setRealisticNoiseSci
def HGCal_setRealisticNoiseSci(process, byDose=True, byDoseAlgo=0, byDoseMap=doseMap, byDoseFactor=1)
Definition: hgcalDigitizer_cfi.py:302
hgcalDigitizer_cfi.HGCal_ignorePulsePerGain
def HGCal_ignorePulsePerGain(process)
Definition: hgcalDigitizer_cfi.py:267
hgcalDigitizer_cfi.HGCal_setRealisticStartupNoise
def HGCal_setRealisticStartupNoise(process)
Definition: hgcalDigitizer_cfi.py:251