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 from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1
194 for _m in [hgceeDigitizer, hgchefrontDigitizer, hgchebackDigitizer]:
195  premix_stage1.toModify(_m, premixStage1 = True)
196 
197 #function to set noise to aged HGCal
198 endOfLifeCCEs = [0.5, 0.5, 0.7]
199 endOfLifeNoises = [2400.0,2250.0,1750.0]
200 def HGCal_setEndOfLifeNoise(digitizer,process):
201  process.HGCAL_noise_fC = cms.PSet(
202  values = cms.vdouble( [x*fC_per_ele for x in endOfLifeNoises] ), #100,200,300 um
203  )
204  process.HGCAL_chargeCollectionEfficiencies = cms.PSet(
205  values = cms.vdouble(endOfLifeCCEs)
206  )
207  process.HGCAL_noise_MIP = cms.PSet(
208  value = cms.double( 1.0/5.0 )
209  )
210  process.HGCAL_noises = cms.PSet(
211  values = cms.vdouble([x for x in endOfLifeNoises])
212  )
213 
214 from Configuration.Eras.Modifier_phase2_hgcalV9_cff import phase2_hgcalV9
215 
216 phase2_hgcalV9.toModify( hgceeDigitizer,
217  geometryType = cms.uint32(1),
218 )
219 phase2_hgcalV9.toModify( hgchefrontDigitizer,
220  geometryType = cms.uint32(1),
221 )
222 phase2_hgcalV9.toModify( hgchebackDigitizer,
223  geometryType = cms.uint32(1),
224  hitCollection = cms.string("HGCHitsHEback"),
225 )
def HGCal_setEndOfLifeNoise(digitizer, process)