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