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