CMS 3D CMS Logo

l1tHGCalConcentratorProducer_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 
4 # Digitization parameters
5 adcSaturationBH_MIP = digiparam.hgchebackDigitizer.digiCfg.feCfg.adcSaturation_fC
6 adcNbitsBH = digiparam.hgchebackDigitizer.digiCfg.feCfg.adcNbits
7 
8 EE_DR_GROUP = 7
9 FH_DR_GROUP = 6
10 BH_DR_GROUP = 12
11 MAX_LAYERS = 52
12 
13 STC_SIZE_CUSTOM_PERLAYER_100 = ([4] + # no layer 0
14  [4]*EE_DR_GROUP + [4]*EE_DR_GROUP + [4]*EE_DR_GROUP + [4]*EE_DR_GROUP + # EM
15  [4]*FH_DR_GROUP + [4]*FH_DR_GROUP + # FH
16  [4]*BH_DR_GROUP) # BH
17 STC_SIZE_CUSTOM_PERLAYER_200 = ([16] + # no layer 0
18  [16]*EE_DR_GROUP + [16]*EE_DR_GROUP + [16]*EE_DR_GROUP + [16]*EE_DR_GROUP + # EM
19  [16]*FH_DR_GROUP + [16]*FH_DR_GROUP + # FH
20  [16]*BH_DR_GROUP) # BH
21 STC_SIZE_CUSTOM_PERLAYER_300 = STC_SIZE_CUSTOM_PERLAYER_200
22 STC_SIZE_CUSTOM_PERLAYER_SCIN = STC_SIZE_CUSTOM_PERLAYER_200
23 
24 
25 CTC_SIZE = ( [2]*(MAX_LAYERS+1)*4)
26 STC_SIZE = ( [4]*(MAX_LAYERS+1)+ [16]*(MAX_LAYERS+1)*3 )
27 
28 
29 threshold_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
30  Method = cms.vstring(['thresholdSelect']*3),
31  threshold_silicon = cms.double(2.), # MipT
32  threshold_scintillator = cms.double(2.), # MipT
33  coarsenTriggerCells = cms.vuint32(0,0,0),
34  fixedDataSizePerHGCROC = cms.bool(False),
35  allTrigCellsInTrigSums = cms.bool(True),
36  ctcSize = cms.vuint32(CTC_SIZE),
37  )
38 
39 # Column is Nlinks, Row is NWafers
40 # Requested size = 8(links)x8(wafers)
41 # Values taken from https://indico.cern.ch/event/747610/contributions/3155360/, slide 13
42 # For motherboards larger than 3, it is split in two
43 bestchoice_ndata_centralized = [
44  13, 42, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
45  13, 40, 74, 80, 114, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
46  12, 39, 72, 82, 116, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
47  12, 26, 53, 80, 114, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
48  12, 25, 52, 79, 112, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
49  0, 24, 51, 78, 111, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
50  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
51  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
52  ]
53 
54 
55 # Values taken from ECON-T working document v9 (March 2022)
56 # https://edms.cern.ch/file/2206779/1/ECON-T_specification_working_doc_v9_2mar2022.pdf
57 bestchoice_ndata_decentralized = [
58  1, 4, 6, 9, 14, 18, 23, 28, 32, 37, 41, 46, 48, 0, 0, 0,
59  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
60  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
61  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
62  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
63  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
64  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
65  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
66  ]
67 
68 
69 superTCCompression_proc = cms.PSet(exponentBits = cms.uint32(4),
70  mantissaBits = cms.uint32(5),
71  truncationBits = cms.uint32(0),
72  rounding = cms.bool(True),
73 )
74 
75 coarseTCCompression_proc = cms.PSet(exponentBits = cms.uint32(4),
76  mantissaBits = cms.uint32(3),
77  truncationBits = cms.uint32(0),
78  rounding = cms.bool(True),
79 )
80 
82 best_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
83  Method = cms.vstring(['bestChoiceSelect']*3),
84  NData = cms.vuint32(bestchoice_ndata_decentralized),
85  coarsenTriggerCells = cms.vuint32(0,0,0),
86  fixedDataSizePerHGCROC = cms.bool(False),
87  allTrigCellsInTrigSums = cms.bool(False),
88  coarseTCCompression = coarseTCCompression_proc.clone(),
89  superTCCalibration_ee = vfe_proc.calibrationCfg_ee.clone(),
90  superTCCalibration_hesi = vfe_proc.calibrationCfg_hesi.clone(),
91  superTCCalibration_hesc = vfe_proc.calibrationCfg_hesc.clone(),
92  superTCCalibration_nose = vfe_proc.calibrationCfg_nose.clone(),
93  ctcSize = cms.vuint32(CTC_SIZE),
94  )
95 
96 supertc_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
97  Method = cms.vstring(['superTriggerCellSelect']*3),
98  type_energy_division = cms.string('superTriggerCell'),# superTriggerCell,oneBitFraction,equalShare
99  stcSize = cms.vuint32(STC_SIZE),
100  ctcSize = cms.vuint32(CTC_SIZE),
101  fixedDataSizePerHGCROC = cms.bool(False),
102  allTrigCellsInTrigSums = cms.bool(False),
103  coarsenTriggerCells = cms.vuint32(0,0,0),
104  superTCCompression = superTCCompression_proc.clone(),
105  coarseTCCompression = coarseTCCompression_proc.clone(),
106  superTCCalibration_ee = vfe_proc.calibrationCfg_ee.clone(),
107  superTCCalibration_hesi = vfe_proc.calibrationCfg_hesi.clone(),
108  superTCCalibration_hesc = vfe_proc.calibrationCfg_hesc.clone(),
109  superTCCalibration_nose = vfe_proc.calibrationCfg_nose.clone(),
110  )
111 
112 custom_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
113  Method = cms.vstring('bestChoiceSelect','superTriggerCellSelect','superTriggerCellSelect'),
114  NData = cms.vuint32(bestchoice_ndata_decentralized),
115  threshold_silicon = cms.double(2.), # MipT
116  threshold_scintillator = cms.double(2.), # MipT
117  coarsenTriggerCells = cms.vuint32(0,0,0),
118  fixedDataSizePerHGCROC = cms.bool(False),
119  allTrigCellsInTrigSums = cms.bool(False),
120  type_energy_division = cms.string('superTriggerCell'),# superTriggerCell,oneBitFraction,equalShare
121  stcSize = cms.vuint32(STC_SIZE),
122  ctcSize = cms.vuint32(CTC_SIZE),
123  superTCCompression = superTCCompression_proc.clone(),
124  coarseTCCompression = coarseTCCompression_proc.clone(),
125  superTCCalibration_ee = vfe_proc.calibrationCfg_ee.clone(),
126  superTCCalibration_hesi = vfe_proc.calibrationCfg_hesi.clone(),
127  superTCCalibration_hesc = vfe_proc.calibrationCfg_hesc.clone(),
128  superTCCalibration_nose = vfe_proc.calibrationCfg_nose.clone(),
129  )
130 
131 
132 coarsetc_onebitfraction_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
133  Method = cms.vstring(['superTriggerCellSelect']*3),
134  type_energy_division = cms.string('oneBitFraction'),
135  stcSize = cms.vuint32([4]*(MAX_LAYERS+1)+ [8]*(MAX_LAYERS+1)*3),
136  ctcSize = cms.vuint32(CTC_SIZE),
137  fixedDataSizePerHGCROC = cms.bool(True),
138  allTrigCellsInTrigSums = cms.bool(False),
139  coarsenTriggerCells = cms.vuint32(0,0,0),
140  oneBitFractionThreshold = cms.double(0.125),
141  oneBitFractionLowValue = cms.double(0.0625),
142  oneBitFractionHighValue = cms.double(0.25),
143  superTCCompression = superTCCompression_proc.clone(),
144  coarseTCCompression = coarseTCCompression_proc.clone(),
145  superTCCalibration_ee = vfe_proc.calibrationCfg_ee.clone(),
146  superTCCalibration_hesi = vfe_proc.calibrationCfg_hesi.clone(),
147  superTCCalibration_hesc = vfe_proc.calibrationCfg_hesc.clone(),
148  superTCCalibration_nose = vfe_proc.calibrationCfg_nose.clone(),
149  )
150 
151 
152 coarsetc_equalshare_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
153  Method = cms.vstring(['superTriggerCellSelect']*3),
154  type_energy_division = cms.string('equalShare'),
155  stcSize = cms.vuint32([4]*(MAX_LAYERS+1)+ [8]*(MAX_LAYERS+1)*3),
156  ctcSize = cms.vuint32(CTC_SIZE),
157  fixedDataSizePerHGCROC = cms.bool(True),
158  allTrigCellsInTrigSums = cms.bool(False),
159  coarsenTriggerCells = cms.vuint32(0,0,0),
160  superTCCompression = superTCCompression_proc.clone(),
161  coarseTCCompression = coarseTCCompression_proc.clone(),
162  superTCCalibration_ee = vfe_proc.calibrationCfg_ee.clone(),
163  superTCCalibration_hesi = vfe_proc.calibrationCfg_hesi.clone(),
164  superTCCalibration_hesc = vfe_proc.calibrationCfg_hesc.clone(),
165  superTCCalibration_nose = vfe_proc.calibrationCfg_nose.clone(),
166 )
167 
168 
169 autoencoder_triggerCellRemap = [0,16, 32,
170  1,17, 33,
171  2,18, 34,
172  3,19, 35,
173  4,20, 36,
174  5,21, 37,
175  6,22, 38,
176  7,23, 39,
177  8,24, 40,
178  9,25, 41,
179  10,26, 42,
180  11,27, 43,
181  12,28, 44,
182  13,29, 45,
183  14,30, 46,
184  15,31, 47]
185 
186 autoEncoder_bitsPerOutputLink = cms.vint32([0, 1, 3, 5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9])
187 
188 autoEncoder_training_2eLinks = cms.PSet(encoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/encoder_2eLinks_PUdriven_constantgraph.pb'),
189  decoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/decoder_2eLinks_PUdriven_constantgraph.pb'))
190 
191 autoEncoder_training_3eLinks = cms.PSet(encoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/encoder_3eLinks_PUdriven_constantgraph.pb'),
192  decoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/decoder_3eLinks_PUdriven_constantgraph.pb'))
193 
194 autoEncoder_training_4eLinks = cms.PSet(encoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/encoder_4eLinks_PUdriven_constantgraph.pb'),
195  decoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/decoder_4eLinks_PUdriven_constantgraph.pb'))
196 
197 autoEncoder_training_5eLinks = cms.PSet(encoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/encoder_5eLinks_PUdriven_constantgraph.pb'),
198  decoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/decoder_5eLinks_PUdriven_constantgraph.pb'))
199 
200 linkToGraphMapping = [0,0,0,1,2,3,3,3,3,3,3,3,3,3,3]
201 
202 autoEncoder_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
203  Method = cms.vstring(['autoEncoder','autoEncoder','thresholdSelect']),
204  cellRemap = cms.vint32(autoencoder_triggerCellRemap),
205  cellRemapNoDuplicates = cms.vint32(autoencoder_triggerCellRemap),
206  encoderShape = cms.vuint32(1,4,4,3),
207  decoderShape = cms.vuint32(1,16),
208  nBitsPerInput = cms.int32(8),
209  maxBitsPerOutput = cms.int32(9),
210  bitsPerLink = autoEncoder_bitsPerOutputLink,
211  modelFiles = cms.VPSet([autoEncoder_training_2eLinks, autoEncoder_training_3eLinks, autoEncoder_training_4eLinks, autoEncoder_training_5eLinks]),
212  linkToGraphMap = cms.vuint32(linkToGraphMapping),
213  zeroSuppresionThreshold = cms.double(0.1),
214  bitShiftNormalization = cms.bool(True),
215  saveEncodedValues = cms.bool(False),
216  preserveModuleSum = cms.bool(True),
217  threshold_silicon = cms.double(2.), # MipT
218  threshold_scintillator = cms.double(2.), # MipT
219  type_energy_division = supertc_conc_proc.type_energy_division,
220  stcSize = supertc_conc_proc.stcSize,
221  ctcSize = supertc_conc_proc.ctcSize,
222  fixedDataSizePerHGCROC = supertc_conc_proc.fixedDataSizePerHGCROC,
223  allTrigCellsInTrigSums = supertc_conc_proc.allTrigCellsInTrigSums,
224  coarsenTriggerCells = supertc_conc_proc.coarsenTriggerCells,
225  superTCCompression = superTCCompression_proc.clone(),
226  coarseTCCompression = coarseTCCompression_proc.clone(),
227  superTCCalibration = vfe_proc.clone(),
228 )
229 
230 
231 
232 
233 from Configuration.Eras.Modifier_phase2_hgcalV10_cff import phase2_hgcalV10
234 # >= V9 samples have a different definition of the dEdx calibrations. To account for it
235 # we rescale the thresholds of the FE selection
236 # (see https://indico.cern.ch/event/806845/contributions/3359859/attachments/1815187/2966402/19-03-20_EGPerf_HGCBE.pdf
237 # for more details)
238 phase2_hgcalV10.toModify(threshold_conc_proc,
239  threshold_silicon=1.35, # MipT
240  threshold_scintillator=1.35, # MipT
241  )
242 
243 
244 l1tHGCalConcentratorProducer = cms.EDProducer(
245  "HGCalConcentratorProducer",
246  InputTriggerCells = cms.InputTag('l1tHGCalVFEProducer:HGCalVFEProcessorSums'),
247  InputTriggerSums = cms.InputTag('l1tHGCalVFEProducer:HGCalVFEProcessorSums'),
248  ProcessorParameters = threshold_conc_proc.clone()
249  )
250 
251 
252 l1tHGCalConcentratorProducerHFNose = l1tHGCalConcentratorProducer.clone(
253  InputTriggerCells = cms.InputTag('l1tHFnoseVFEProducer:HGCalVFEProcessorSums'),
254  InputTriggerSums = cms.InputTag('l1tHFnoseVFEProducer:HGCalVFEProcessorSums')
255 )
256