Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-12-05 03:12:11

0001 import FWCore.ParameterSet.Config as cms
0002 import SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi as digiparam
0003 
0004 # Digitization parameters
0005 adcSaturationBH_MIP = digiparam.hgchebackDigitizer.digiCfg.feCfg.adcSaturation_fC
0006 adcNbitsBH = digiparam.hgchebackDigitizer.digiCfg.feCfg.adcNbits
0007 
0008 EE_DR_GROUP = 7
0009 FH_DR_GROUP = 6
0010 BH_DR_GROUP = 12
0011 MAX_LAYERS = 52
0012 
0013 STC_SIZE_CUSTOM_PERLAYER_100 = ([4] + # no layer 0
0014                      [4]*EE_DR_GROUP + [4]*EE_DR_GROUP + [4]*EE_DR_GROUP + [4]*EE_DR_GROUP + # EM
0015                      [4]*FH_DR_GROUP + [4]*FH_DR_GROUP + # FH
0016                      [4]*BH_DR_GROUP) # BH
0017 STC_SIZE_CUSTOM_PERLAYER_200 = ([16] + # no layer 0
0018                      [16]*EE_DR_GROUP + [16]*EE_DR_GROUP + [16]*EE_DR_GROUP + [16]*EE_DR_GROUP + # EM
0019                      [16]*FH_DR_GROUP + [16]*FH_DR_GROUP + # FH
0020                      [16]*BH_DR_GROUP) # BH
0021 STC_SIZE_CUSTOM_PERLAYER_300 = STC_SIZE_CUSTOM_PERLAYER_200
0022 STC_SIZE_CUSTOM_PERLAYER_SCIN = STC_SIZE_CUSTOM_PERLAYER_200
0023 
0024 
0025 CTC_SIZE =  ( [2]*(MAX_LAYERS+1)*4)
0026 STC_SIZE =  ( [4]*(MAX_LAYERS+1)+ [16]*(MAX_LAYERS+1)*3 )
0027 
0028 
0029 threshold_conc_proc = cms.PSet(ProcessorName  = cms.string('HGCalConcentratorProcessorSelection'),
0030                                Method = cms.vstring(['thresholdSelect']*3),
0031                                threshold_silicon = cms.double(2.), # MipT
0032                                threshold_scintillator = cms.double(2.), # MipT
0033                                coarsenTriggerCells = cms.vuint32(0,0,0),
0034                                fixedDataSizePerHGCROC = cms.bool(False),
0035                                allTrigCellsInTrigSums = cms.bool(True),
0036                                ctcSize = cms.vuint32(CTC_SIZE),
0037                                )
0038 
0039 # Column is Nlinks, Row is NWafers
0040 # Requested size = 8(links)x8(wafers)
0041 # Values taken from https://indico.cern.ch/event/747610/contributions/3155360/, slide 13
0042 # For motherboards larger than 3, it is split in two
0043 bestchoice_ndata_centralized = [
0044         13, 42, 75,  0,   0,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0045         13, 40, 74, 80, 114, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0046         12, 39, 72, 82, 116, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0047         12, 26, 53, 80, 114, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0048         12, 25, 52, 79, 112, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0049         0, 24, 51, 78, 111, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0050         0,  0,  0,  0,   0,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0051         0,  0,  0,  0,   0,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0052         ]
0053 
0054 
0055 # Values taken from ECON-T working document v9 (March 2022)
0056 # https://edms.cern.ch/file/2206779/1/ECON-T_specification_working_doc_v9_2mar2022.pdf
0057 bestchoice_ndata_decentralized = [
0058         1, 4, 6, 9, 14, 18, 23, 28, 32, 37, 41, 46, 48, 0, 0, 0,
0059         0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0, 0, 0, 0, 0,
0060         0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0, 0, 0, 0, 0,
0061         0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0, 0, 0, 0, 0,
0062         0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0, 0, 0, 0, 0,
0063         0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0, 0, 0, 0, 0,
0064         0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0, 0, 0, 0, 0,
0065         0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0, 0, 0, 0, 0,
0066         ]
0067 
0068 
0069 superTCCompression_proc = cms.PSet(exponentBits = cms.uint32(4),
0070                                    mantissaBits = cms.uint32(5),
0071                                    truncationBits = cms.uint32(0),
0072                                    rounding = cms.bool(True),
0073 )
0074 
0075 coarseTCCompression_proc = cms.PSet(exponentBits = cms.uint32(4),
0076                                     mantissaBits = cms.uint32(3),
0077                                     truncationBits = cms.uint32(0),
0078                                     rounding = cms.bool(True),
0079 )
0080 
0081 from L1Trigger.L1THGCal.l1tHGCalVFEProducer_cfi import vfe_proc
0082 best_conc_proc = cms.PSet(ProcessorName  = cms.string('HGCalConcentratorProcessorSelection'),
0083                           Method = cms.vstring(['bestChoiceSelect']*3),
0084                           NData = cms.vuint32(bestchoice_ndata_decentralized),
0085                           coarsenTriggerCells = cms.vuint32(0,0,0),
0086                           fixedDataSizePerHGCROC = cms.bool(False),
0087                           allTrigCellsInTrigSums = cms.bool(False),
0088                           coarseTCCompression = coarseTCCompression_proc.clone(),
0089                           superTCCalibration_ee = vfe_proc.calibrationCfg_ee.clone(),
0090                           superTCCalibration_hesi = vfe_proc.calibrationCfg_hesi.clone(),
0091                           superTCCalibration_hesc = vfe_proc.calibrationCfg_hesc.clone(),
0092                           superTCCalibration_nose = vfe_proc.calibrationCfg_nose.clone(),
0093                           ctcSize = cms.vuint32(CTC_SIZE),
0094                           )
0095 
0096 supertc_conc_proc = cms.PSet(ProcessorName  = cms.string('HGCalConcentratorProcessorSelection'),
0097                              Method = cms.vstring(['superTriggerCellSelect']*3),
0098                              type_energy_division = cms.string('superTriggerCell'),# superTriggerCell,oneBitFraction,equalShare
0099                              stcSize = cms.vuint32(STC_SIZE),
0100                              ctcSize = cms.vuint32(CTC_SIZE),
0101                              fixedDataSizePerHGCROC = cms.bool(False),
0102                              allTrigCellsInTrigSums = cms.bool(False),
0103                              coarsenTriggerCells = cms.vuint32(0,0,0),
0104                              superTCCompression = superTCCompression_proc.clone(),
0105                              coarseTCCompression = coarseTCCompression_proc.clone(),
0106                              superTCCalibration_ee = vfe_proc.calibrationCfg_ee.clone(),
0107                              superTCCalibration_hesi = vfe_proc.calibrationCfg_hesi.clone(),
0108                              superTCCalibration_hesc = vfe_proc.calibrationCfg_hesc.clone(),
0109                              superTCCalibration_nose = vfe_proc.calibrationCfg_nose.clone(),
0110                              )
0111 
0112 custom_conc_proc = cms.PSet(ProcessorName  = cms.string('HGCalConcentratorProcessorSelection'),
0113                           Method = cms.vstring('bestChoiceSelect','superTriggerCellSelect','superTriggerCellSelect'),
0114                           NData = cms.vuint32(bestchoice_ndata_decentralized),
0115                           threshold_silicon = cms.double(2.), # MipT
0116                           threshold_scintillator = cms.double(2.), # MipT
0117                           coarsenTriggerCells = cms.vuint32(0,0,0),
0118                           fixedDataSizePerHGCROC = cms.bool(False),
0119                           allTrigCellsInTrigSums = cms.bool(False),
0120                           type_energy_division = cms.string('superTriggerCell'),# superTriggerCell,oneBitFraction,equalShare
0121                           stcSize = cms.vuint32(STC_SIZE),
0122                           ctcSize = cms.vuint32(CTC_SIZE),
0123                           superTCCompression = superTCCompression_proc.clone(),
0124                           coarseTCCompression = coarseTCCompression_proc.clone(),
0125                           superTCCalibration_ee = vfe_proc.calibrationCfg_ee.clone(),
0126                           superTCCalibration_hesi = vfe_proc.calibrationCfg_hesi.clone(),
0127                           superTCCalibration_hesc = vfe_proc.calibrationCfg_hesc.clone(),
0128                           superTCCalibration_nose = vfe_proc.calibrationCfg_nose.clone(),
0129                           )
0130 
0131 
0132 coarsetc_onebitfraction_proc = cms.PSet(ProcessorName  = cms.string('HGCalConcentratorProcessorSelection'),
0133                              Method = cms.vstring(['superTriggerCellSelect']*3),
0134                              type_energy_division = cms.string('oneBitFraction'),
0135                              stcSize = cms.vuint32([4]*(MAX_LAYERS+1)+ [8]*(MAX_LAYERS+1)*3),
0136                              ctcSize = cms.vuint32(CTC_SIZE),
0137                              fixedDataSizePerHGCROC = cms.bool(True),
0138                              allTrigCellsInTrigSums = cms.bool(False),
0139                              coarsenTriggerCells = cms.vuint32(0,0,0),
0140                              oneBitFractionThreshold = cms.double(0.125),
0141                              oneBitFractionLowValue = cms.double(0.0625),
0142                              oneBitFractionHighValue = cms.double(0.25),
0143                              superTCCompression = superTCCompression_proc.clone(),
0144                              coarseTCCompression = coarseTCCompression_proc.clone(),
0145                              superTCCalibration_ee = vfe_proc.calibrationCfg_ee.clone(),
0146                              superTCCalibration_hesi = vfe_proc.calibrationCfg_hesi.clone(),
0147                              superTCCalibration_hesc = vfe_proc.calibrationCfg_hesc.clone(),
0148                              superTCCalibration_nose = vfe_proc.calibrationCfg_nose.clone(),
0149                              )
0150 
0151 
0152 coarsetc_equalshare_proc = cms.PSet(ProcessorName  = cms.string('HGCalConcentratorProcessorSelection'),
0153                              Method = cms.vstring(['superTriggerCellSelect']*3),
0154                              type_energy_division = cms.string('equalShare'),
0155                              stcSize = cms.vuint32([4]*(MAX_LAYERS+1)+ [8]*(MAX_LAYERS+1)*3),
0156                              ctcSize = cms.vuint32(CTC_SIZE),
0157                              fixedDataSizePerHGCROC = cms.bool(True),
0158                              allTrigCellsInTrigSums = cms.bool(False),
0159                              coarsenTriggerCells = cms.vuint32(0,0,0),
0160                              superTCCompression = superTCCompression_proc.clone(),
0161                              coarseTCCompression = coarseTCCompression_proc.clone(),
0162                              superTCCalibration_ee = vfe_proc.calibrationCfg_ee.clone(),
0163                              superTCCalibration_hesi = vfe_proc.calibrationCfg_hesi.clone(),
0164                              superTCCalibration_hesc = vfe_proc.calibrationCfg_hesc.clone(),
0165                              superTCCalibration_nose = vfe_proc.calibrationCfg_nose.clone(),
0166 )
0167 
0168 
0169 autoencoder_triggerCellRemap = [0,16, 32,
0170                                 1,17, 33,
0171                                 2,18, 34,
0172                                 3,19, 35,
0173                                 4,20, 36,
0174                                 5,21, 37,
0175                                 6,22, 38,
0176                                 7,23, 39,
0177                                 8,24, 40,
0178                                 9,25, 41,
0179                                 10,26, 42,
0180                                 11,27, 43,
0181                                 12,28, 44,
0182                                 13,29, 45,
0183                                 14,30, 46,
0184                                 15,31, 47]
0185 
0186 autoEncoder_bitsPerOutputLink = cms.vint32([0, 1, 3, 5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9])
0187 
0188 autoEncoder_training_2eLinks = cms.PSet(encoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/encoder_2eLinks_PUdriven_constantgraph.pb'),
0189                                         decoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/decoder_2eLinks_PUdriven_constantgraph.pb'))
0190 
0191 autoEncoder_training_3eLinks = cms.PSet(encoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/encoder_3eLinks_PUdriven_constantgraph.pb'),
0192                                         decoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/decoder_3eLinks_PUdriven_constantgraph.pb'))
0193 
0194 autoEncoder_training_4eLinks = cms.PSet(encoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/encoder_4eLinks_PUdriven_constantgraph.pb'),
0195                                         decoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/decoder_4eLinks_PUdriven_constantgraph.pb'))
0196 
0197 autoEncoder_training_5eLinks = cms.PSet(encoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/encoder_5eLinks_PUdriven_constantgraph.pb'),
0198                                         decoderModelFile = cms.FileInPath('L1Trigger/L1THGCal/data/decoder_5eLinks_PUdriven_constantgraph.pb'))
0199 
0200 linkToGraphMapping = [0,0,0,1,2,3,3,3,3,3,3,3,3,3,3]
0201 
0202 autoEncoder_conc_proc = cms.PSet(ProcessorName  = cms.string('HGCalConcentratorProcessorSelection'),
0203                                  Method = cms.vstring(['autoEncoder','autoEncoder','thresholdSelect']),
0204                                  cellRemap = cms.vint32(autoencoder_triggerCellRemap),
0205                                  cellRemapNoDuplicates = cms.vint32(autoencoder_triggerCellRemap),
0206                                  encoderShape = cms.vuint32(1,4,4,3),
0207                                  decoderShape = cms.vuint32(1,16),
0208                                  nBitsPerInput = cms.int32(8),
0209                                  maxBitsPerOutput = cms.int32(9),
0210                                  bitsPerLink = autoEncoder_bitsPerOutputLink,
0211                                  modelFiles = cms.VPSet([autoEncoder_training_2eLinks, autoEncoder_training_3eLinks, autoEncoder_training_4eLinks, autoEncoder_training_5eLinks]),
0212                                  linkToGraphMap = cms.vuint32(linkToGraphMapping),
0213                                  zeroSuppresionThreshold = cms.double(0.1),
0214                                  bitShiftNormalization = cms.bool(True),
0215                                  saveEncodedValues = cms.bool(False),
0216                                  preserveModuleSum = cms.bool(True),
0217                                  threshold_silicon = cms.double(2.), # MipT
0218                                  threshold_scintillator = cms.double(2.), # MipT
0219                                  type_energy_division = supertc_conc_proc.type_energy_division,
0220                                  stcSize = supertc_conc_proc.stcSize,
0221                                  ctcSize = supertc_conc_proc.ctcSize,
0222                                  fixedDataSizePerHGCROC = supertc_conc_proc.fixedDataSizePerHGCROC,
0223                                  allTrigCellsInTrigSums = supertc_conc_proc.allTrigCellsInTrigSums,
0224                                  coarsenTriggerCells = supertc_conc_proc.coarsenTriggerCells,
0225                                  superTCCompression = superTCCompression_proc.clone(),
0226                                  coarseTCCompression = coarseTCCompression_proc.clone(),
0227                                  superTCCalibration = vfe_proc.clone(),
0228 )
0229 
0230 
0231 
0232 
0233 from Configuration.Eras.Modifier_phase2_hgcalV10_cff import phase2_hgcalV10
0234 # >= V9 samples have a different definition of the dEdx calibrations. To account for it
0235 # we rescale the thresholds of the FE selection
0236 # (see https://indico.cern.ch/event/806845/contributions/3359859/attachments/1815187/2966402/19-03-20_EGPerf_HGCBE.pdf
0237 # for more details)
0238 phase2_hgcalV10.toModify(threshold_conc_proc,
0239                         threshold_silicon=1.35,  # MipT
0240                         threshold_scintillator=1.35,  # MipT
0241                         )
0242 
0243 
0244 l1tHGCalConcentratorProducer = cms.EDProducer(
0245     "HGCalConcentratorProducer",
0246     InputTriggerCells = cms.InputTag('l1tHGCalVFEProducer:HGCalVFEProcessorSums'),
0247     InputTriggerSums = cms.InputTag('l1tHGCalVFEProducer:HGCalVFEProcessorSums'),
0248     ProcessorParameters = threshold_conc_proc.clone()
0249     )
0250 
0251 
0252 l1tHGCalConcentratorProducerHFNose = l1tHGCalConcentratorProducer.clone(
0253     InputTriggerCells = cms.InputTag('l1tHFnoseVFEProducer:HGCalVFEProcessorSums'),
0254     InputTriggerSums = cms.InputTag('l1tHFnoseVFEProducer:HGCalVFEProcessorSums')
0255 )
0256