CMS 3D CMS Logo

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