CMS 3D CMS Logo

hgcalDigitizer_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # Base configurations for HGCal digitizers
4 eV_per_eh_pair = 3.62
5 fC_per_ele = 1.6020506e-4
6 nonAgedCCEs = [1.0, 1.0, 1.0]
7 nonAgedNoises = [2100.0,2100.0,1600.0] #100,200,300 um (in electrons)
8 nonAgedNoises_v9 = [2000.0,2400.0,2000.0] # 120,200,300 um (in electrons)
9 thresholdTracksMIP = False
10 
11 HGCAL_noise_fC = cms.PSet(
12  values = cms.vdouble( [x*fC_per_ele for x in nonAgedNoises] ), #100,200,300 um
13  )
14 
15 HGCAL_noise_MIP = cms.PSet(
16  value = cms.double(1.0/7.0)
17  )
18 
19 HGCAL_chargeCollectionEfficiencies = cms.PSet(
20  values = cms.vdouble( nonAgedCCEs )
21  )
22 
23 HGCAL_noises = cms.PSet(
24  values = cms.vdouble([x for x in nonAgedNoises])
25  )
26 
27 # ECAL
28 hgceeDigitizer = cms.PSet(
29  accumulatorType = cms.string("HGCDigiProducer"),
30  hitCollection = cms.string("HGCHitsEE"),
31  digiCollection = cms.string("HGCDigisEE"),
32  maxSimHitsAccTime = cms.uint32(100),
33  bxTime = cms.double(25),
34  eVPerEleHolePair = cms.double(eV_per_eh_pair),
35  tofDelay = cms.double(5),
36  geometryType = cms.uint32(0),
37  digitizationType = cms.uint32(0),
38  makeDigiSimLinks = cms.bool(False),
39  premixStage1 = cms.bool(False),
40  premixStage1MinCharge = cms.double(0),
41  premixStage1MaxCharge = cms.double(1e6),
42  useAllChannels = cms.bool(True),
43  verbosity = cms.untracked.uint32(0),
44  digiCfg = cms.PSet(
45  keV2fC = cms.double(0.044259), #1000 eV/3.62 (eV per e) / 6.24150934e3 (e per fC)
46 
47  chargeCollectionEfficiencies = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
48  noise_fC = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_fC")),
49  doTimeSamples = cms.bool(False),
50  feCfg = cms.PSet(
51  # 0 only ADC, 1 ADC with pulse shape, 2 ADC+TDC with pulse shape
52  fwVersion = cms.uint32(2),
53  # leakage to bunches -2, -1, in-time, +1, +2, +3 (from J. Kaplon)
54  #NOTE: this is a fixed-size array inside the simulation (for speed) change accordingly!
55  adcPulse = cms.vdouble(0.00, 0.017, 0.817, 0.163, 0.003, 0.000),
56  pulseAvgT = cms.vdouble(0.00, 23.42298,13.16733,6.41062,5.03946,4.5320),
57  # n bits for the ADC
58  adcNbits = cms.uint32(10),
59  # ADC saturation
60  adcSaturation_fC = cms.double(100),
61  # the tdc resolution smearing (in picoseconds)
62  tdcResolutionInPs = cms.double( 0.001 ),
63  # jitter for timing noise term ns
64  jitterNoise_ns = cms.vdouble(25., 25., 25.),
65  # jitter for timing noise term ns
66  jitterConstant_ns = cms.vdouble(0.0004, 0.0004, 0.0004),
67  # LSB for TDC, assuming 12 bit dynamic range to 10 pC
68  tdcNbits = cms.uint32(12),
69  # TDC saturation
70  tdcSaturation_fC = cms.double(10000),
71  # raise threshold flag (~MIP/2) this is scaled
72  # for different thickness
73  adcThreshold_fC = cms.double(0.672),
74  thresholdFollowsMIP = cms.bool(thresholdTracksMIP),
75  # raise usage of TDC and mode flag (from J. Kaplon)
76  tdcOnset_fC = cms.double(60),
77  # raise usage of TDC for TOA only
78  tdcForToAOnset_fC = cms.vdouble(12., 12., 12.),
79  # LSB for time of arrival estimate from TDC in ns
80  toaLSB_ns = cms.double(0.0244),
81  #toa computation mode (0=by weighted energy, 1=simple threshold)
82  toaMode = cms.uint32(1),
83  # TDC charge drain parameterisation (from J. Kaplon)
84  tdcChargeDrainParameterisation = cms.vdouble(
85  -919.13, 365.36, -14.10, 0.2,
86  -21.85, 49.39, 22.21, 0.8,
87  -0.28, 27.14, 43.95,
88  3.89048 )
89  )
90  )
91  )
92 
93 # HCAL front
94 hgchefrontDigitizer = cms.PSet(
95  accumulatorType = cms.string("HGCDigiProducer"),
96  hitCollection = cms.string("HGCHitsHEfront"),
97  digiCollection = cms.string("HGCDigisHEfront"),
98  maxSimHitsAccTime = cms.uint32(100),
99  bxTime = cms.double(25),
100  tofDelay = cms.double(5),
101  geometryType = cms.uint32(0),
102  digitizationType = cms.uint32(0),
103  makeDigiSimLinks = cms.bool(False),
104  premixStage1 = cms.bool(False),
105  premixStage1MinCharge = cms.double(0),
106  premixStage1MaxCharge = cms.double(1e6),
107  useAllChannels = cms.bool(True),
108  verbosity = cms.untracked.uint32(0),
109  digiCfg = cms.PSet(
110  keV2fC = cms.double(0.044259), #1000 eV / 3.62 (eV per e) / 6.24150934e3 (e per fC)
111  chargeCollectionEfficiencies = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
112  noise_fC = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_fC")),
113  doTimeSamples = cms.bool(False),
114  feCfg = cms.PSet(
115  # 0 only ADC, 1 ADC with pulse shape, 2 ADC+TDC with pulse shape
116  fwVersion = cms.uint32(2),
117  # leakage to bunches -2, -1, in-time, +1, +2, +3 (from J. Kaplon)
118  adcPulse = cms.vdouble(0.00, 0.017, 0.817, 0.163, 0.003, 0.000),
119  pulseAvgT = cms.vdouble(0.00, 23.42298,13.16733,6.41062,5.03946,4.5320),
120  # n bits for the ADC
121  adcNbits = cms.uint32(10),
122  # ADC saturation
123  adcSaturation_fC = cms.double(100),
124  # the tdc resolution smearing (in picoseconds)
125  tdcResolutionInPs = cms.double( 0.001 ),
126  # jitter for timing noise term ns
127  jitterNoise_ns = cms.vdouble(25., 25., 25.),
128  # jitter for timing noise term ns
129  jitterConstant_ns = cms.vdouble(0.0004, 0.0004, 0.0004),
130  # LSB for TDC, assuming 12 bit dynamic range to 10 pC
131  tdcNbits = cms.uint32(12),
132  # TDC saturation
133  tdcSaturation_fC = cms.double(10000),
134  # raise threshold flag (~MIP/2) this is scaled
135  # for different thickness
136  adcThreshold_fC = cms.double(0.672),
137  thresholdFollowsMIP = cms.bool(thresholdTracksMIP),
138  # raise usage of TDC and mode flag (from J. Kaplon)
139  tdcOnset_fC = cms.double(60),
140  # raise usage of TDC for TOA only
141  tdcForToAOnset_fC = cms.vdouble(12., 12., 12.),
142  # LSB for time of arrival estimate from TDC in ns
143  toaLSB_ns = cms.double(0.0244),
144  #toa computation mode (0=by weighted energy, 1=simple threshold)
145  toaMode = cms.uint32(1),
146  # TDC charge drain parameterisation (from J. Kaplon)
147  tdcChargeDrainParameterisation = cms.vdouble(
148  -919.13, 365.36, -14.10, 0.2,
149  -21.85, 49.39, 22.21, 0.8,
150  -0.28, 27.14, 43.95,
151  3.89048)
152  )
153  )
154  )
155 
156 
157 # HCAL back (CALICE-like version, no pulse shape)
158 hgchebackDigitizer = cms.PSet(
159  accumulatorType = cms.string("HGCDigiProducer"),
160  hitCollection = cms.string("HcalHits"),
161  digiCollection = cms.string("HGCDigisHEback"),
162  maxSimHitsAccTime = cms.uint32(100),
163  bxTime = cms.double(25),
164  tofDelay = cms.double(1),
165  geometryType = cms.uint32(0),
166  digitizationType = cms.uint32(1),
167  makeDigiSimLinks = cms.bool(False),
168  premixStage1 = cms.bool(False),
169  premixStage1MinCharge = cms.double(0),
170  premixStage1MaxCharge = cms.double(1e6),
171  useAllChannels = cms.bool(True),
172  verbosity = cms.untracked.uint32(0),
173  digiCfg = cms.PSet(
174  keV2MIP = cms.double(1./616.0),
175  noise_MIP = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_MIP")),
176  doTimeSamples = cms.bool(False),
177  nPEperMIP = cms.double(11.0),
178  nTotalPE = cms.double(1156), #1156 pixels => saturation ~600MIP
179  xTalk = cms.double(0.25),
180  sdPixels = cms.double(1e-6), # this is additional photostatistics noise (as implemented), not sure why it's here...
181  feCfg = cms.PSet(
182  # 0 only ADC, 1 ADC with pulse shape, 2 ADC+TDC with pulse shape
183  fwVersion = cms.uint32(0),
184  # n bits for the ADC
185  adcNbits = cms.uint32(12),
186  # ADC saturation : in this case we use the same variable but fC=MIP
187  adcSaturation_fC = cms.double(1024.0),
188  # threshold for digi production : in this case we use the same variable but fC=MIP
189  adcThreshold_fC = cms.double(0.50),
190  thresholdFollowsMIP = cms.bool(False)
191  )
192  )
193  )
194 
195 # HFNose
196 hfnoseDigitizer = cms.PSet(
197  accumulatorType = cms.string("HGCDigiProducer"),
198  hitCollection = cms.string("HFNoseHits"),
199  digiCollection = cms.string("HFNoseDigis"),
200  maxSimHitsAccTime = cms.uint32(100),
201  bxTime = cms.double(25),
202  eVPerEleHolePair = cms.double(eV_per_eh_pair),
203  tofDelay = cms.double(5),
204  geometryType = cms.uint32(0),
205  digitizationType = cms.uint32(0),
206  makeDigiSimLinks = cms.bool(False),
207  premixStage1 = cms.bool(False),
208  premixStage1MinCharge = cms.double(0),
209  premixStage1MaxCharge = cms.double(1e6),
210  useAllChannels = cms.bool(True),
211  verbosity = cms.untracked.uint32(0),
212  digiCfg = cms.PSet(
213  keV2fC = cms.double(0.044259), #1000 eV/3.62 (eV per e) / 6.24150934e3 (e per fC)
214 
215  chargeCollectionEfficiencies = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
216  noise_fC = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_fC")),
217  doTimeSamples = cms.bool(False),
218  feCfg = cms.PSet(
219  # 0 only ADC, 1 ADC with pulse shape, 2 ADC+TDC with pulse shape
220  fwVersion = cms.uint32(2),
221  # leakage to bunches -2, -1, in-time, +1, +2, +3 (from J. Kaplon)
222  #NOTE: this is a fixed-size array inside the simulation (for speed) change accordingly!
223  adcPulse = cms.vdouble(0.00, 0.017, 0.817, 0.163, 0.003, 0.000),
224  pulseAvgT = cms.vdouble(0.00, 23.42298,13.16733,6.41062,5.03946,4.5320),
225  # n bits for the ADC
226  adcNbits = cms.uint32(10),
227  # ADC saturation
228  adcSaturation_fC = cms.double(100),
229  # the tdc resolution smearing (in picoseconds)
230  tdcResolutionInPs = cms.double( 0.001 ),
231  # jitter for timing noise term ns
232  jitterNoise_ns = cms.vdouble(25., 25., 25.),
233  # jitter for timing noise term ns
234  jitterConstant_ns = cms.vdouble(0.0004, 0.0004, 0.0004),
235  # LSB for TDC, assuming 12 bit dynamic range to 10 pC
236  tdcNbits = cms.uint32(12),
237  # TDC saturation
238  tdcSaturation_fC = cms.double(10000),
239  # raise threshold flag (~MIP/2) this is scaled
240  # for different thickness
241  adcThreshold_fC = cms.double(0.672),
242  thresholdFollowsMIP = cms.bool(thresholdTracksMIP),
243  # raise usage of TDC and mode flag (from J. Kaplon)
244  tdcOnset_fC = cms.double(60),
245  # raise usage of TDC for TOA only
246  tdcForToAOnset_fC = cms.vdouble(12., 12., 12.),
247  # LSB for time of arrival estimate from TDC in ns
248  toaLSB_ns = cms.double(0.0244),
249  #toa computation mode (0=by weighted energy, 1=simple threshold)
250  toaMode = cms.uint32(1),
251  # TDC charge drain parameterisation (from J. Kaplon)
252  tdcChargeDrainParameterisation = cms.vdouble(
253  -919.13, 365.36, -14.10, 0.2,
254  -21.85, 49.39, 22.21, 0.8,
255  -0.28, 27.14, 43.95,
256  3.89048 )
257  )
258  )
259  )
260 
261 # this bypasses the noise simulation
262 from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1
263 for _m in [hgceeDigitizer, hgchefrontDigitizer, hgchebackDigitizer, hfnoseDigitizer]:
264  premix_stage1.toModify(_m, premixStage1 = True)
265 
266 #function to set noise to aged HGCal
267 endOfLifeCCEs = [0.5, 0.5, 0.7]
268 endOfLifeNoises = [2400.0,2250.0,1750.0]
270  process.HGCAL_noise_fC = cms.PSet(
271  values = cms.vdouble( [x*fC_per_ele for x in endOfLifeNoises] ), #100,200,300 um
272  )
273  process.HGCAL_chargeCollectionEfficiencies = cms.PSet(
274  values = cms.vdouble(endOfLifeCCEs)
275  )
276  process.HGCAL_noise_MIP = cms.PSet(
277  value = cms.double( 1.0/5.0 )
278  )
279  process.HGCAL_noises = cms.PSet(
280  values = cms.vdouble([x for x in endOfLifeNoises])
281  )
282  return process
283 
284 def HGCal_disableNoise(process):
285  process.HGCAL_noise_fC = cms.PSet(
286  values = cms.vdouble(0,0,0), #100,200,300 um
287  )
288  process.HGCAL_noise_MIP = cms.PSet(
289  value = cms.double(0)
290  )
291  process.HGCAL_noises = cms.PSet(
292  values = cms.vdouble(0,0,0)
293  )
294  return process
295 
296 from Configuration.Eras.Modifier_phase2_hgcalV9_cff import phase2_hgcalV9
297 
298 phase2_hgcalV9.toModify( hgceeDigitizer,
299  geometryType = cms.uint32(1),
300 )
301 phase2_hgcalV9.toModify( hgchefrontDigitizer,
302  geometryType = cms.uint32(1),
303 )
304 phase2_hgcalV9.toModify( hgchebackDigitizer,
305  geometryType = cms.uint32(1),
306  hitCollection = cms.string("HGCHitsHEback"),
307 )
308 phase2_hgcalV9.toModify(HGCAL_noise_fC, values = [x*fC_per_ele for x in nonAgedNoises_v9])
309 phase2_hgcalV9.toModify(HGCAL_noises, values = [x for x in nonAgedNoises_v9])
def HGCal_disableNoise(process)
def HGCal_setEndOfLifeNoise(process)