Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:40

0001 import FWCore.ParameterSet.Config as cms
0002 import SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi as digiparam
0003 from L1Trigger.L1THGCal.l1tHGCalConcentratorProducer_cfi import threshold_conc_proc, best_conc_proc, supertc_conc_proc, coarsetc_onebitfraction_proc, coarsetc_equalshare_proc, bestchoice_ndata_decentralized, custom_conc_proc, autoEncoder_conc_proc
0004 
0005 def custom_triggercellselect_supertriggercell(process,
0006                                               stcSize=supertc_conc_proc.stcSize,
0007                                               type_energy_division=supertc_conc_proc.type_energy_division,
0008                                               fixedDataSizePerHGCROC=supertc_conc_proc.fixedDataSizePerHGCROC
0009                                               ):
0010     parameters = supertc_conc_proc.clone(stcSize = stcSize,
0011                                          type_energy_division = type_energy_division,
0012                                          fixedDataSizePerHGCROC = fixedDataSizePerHGCROC  
0013                                          )
0014     process.l1tHGCalConcentratorProducer.ProcessorParameters = parameters
0015     return process
0016 
0017 
0018 def custom_triggercellselect_threshold(process,
0019                                        threshold_silicon=threshold_conc_proc.threshold_silicon,  # in mipT
0020                                        threshold_scintillator=threshold_conc_proc.threshold_scintillator,  # in mipT
0021                                        coarsenTriggerCells=threshold_conc_proc.coarsenTriggerCells  
0022                                        ):
0023     parameters = threshold_conc_proc.clone(
0024             threshold_silicon = threshold_silicon,
0025             threshold_scintillator = threshold_scintillator,
0026             coarsenTriggerCells = coarsenTriggerCells  
0027             )
0028     process.l1tHGCalConcentratorProducer.ProcessorParameters = parameters
0029     return process
0030 
0031 
0032 def custom_triggercellselect_bestchoice(process,
0033                                         triggercells=best_conc_proc.NData
0034                                         ):
0035     parameters = best_conc_proc.clone(NData = triggercells)
0036     process.l1tHGCalConcentratorProducer.ProcessorParameters = parameters
0037     return process
0038 
0039 
0040 def custom_triggercellselect_bestchoice_decentralized(process):
0041     return custom_triggercellselect_bestchoice(process, triggercells=bestchoice_ndata_decentralized)
0042 
0043 
0044 def custom_coarsetc_onebitfraction(process,
0045                                    stcSize=coarsetc_onebitfraction_proc.stcSize,
0046                                    fixedDataSizePerHGCROC=coarsetc_onebitfraction_proc.fixedDataSizePerHGCROC,
0047                                    oneBitFractionThreshold = coarsetc_onebitfraction_proc.oneBitFractionThreshold,
0048                                    oneBitFractionLowValue = coarsetc_onebitfraction_proc.oneBitFractionLowValue,
0049                                    oneBitFractionHighValue = coarsetc_onebitfraction_proc.oneBitFractionHighValue,
0050                                    ):
0051     parameters = coarsetc_onebitfraction_proc.clone(
0052         stcSize = stcSize,    
0053         fixedDataSizePerHGCROC = fixedDataSizePerHGCROC, 
0054         oneBitFractionThreshold = oneBitFractionThreshold,
0055         oneBitFractionLowValue = oneBitFractionLowValue,
0056         oneBitFractionHighValue = oneBitFractionHighValue,
0057     )
0058     process.l1tHGCalConcentratorProducer.ProcessorParameters = parameters
0059     return process
0060 
0061 
0062 
0063 
0064 def custom_coarsetc_equalshare(process,
0065                                stcSize=coarsetc_equalshare_proc.stcSize,
0066                                fixedDataSizePerHGCROC=coarsetc_equalshare_proc.fixedDataSizePerHGCROC,
0067                                ):
0068     parameters = coarsetc_equalshare_proc.clone(
0069         stcSize = stcSize,    
0070         fixedDataSizePerHGCROC = fixedDataSizePerHGCROC, 
0071     )
0072     process.l1tHGCalConcentratorProducer.ProcessorParameters = parameters
0073     return process
0074     
0075 def custom_triggercellselect_mixedBestChoiceSuperTriggerCell(process,
0076                                               stcSize=custom_conc_proc.stcSize,
0077                                               type_energy_division=custom_conc_proc.type_energy_division,
0078                                               fixedDataSizePerHGCROC=custom_conc_proc.fixedDataSizePerHGCROC,
0079                                               triggercells=custom_conc_proc.NData
0080                                               ):
0081     parameters = custom_conc_proc.clone(stcSize = stcSize,
0082                                         type_energy_division = type_energy_division,
0083                                         fixedDataSizePerHGCROC = fixedDataSizePerHGCROC,
0084                                         NData=triggercells,
0085                                         Method = cms.vstring('bestChoiceSelect','superTriggerCellSelect','superTriggerCellSelect'),        
0086     )
0087     process.l1tHGCalConcentratorProducer.ProcessorParameters = parameters
0088     return process
0089 
0090 def custom_triggercellselect_mixedBestChoiceSuperTriggerCell_decentralized(process):
0091     return custom_triggercellselect_mixedBestChoiceSuperTriggerCell(process, triggercells=bestchoice_ndata_decentralized)
0092 
0093 
0094 
0095 def custom_triggercellselect_autoencoder(process,
0096         cellRemap = autoEncoder_conc_proc.cellRemap,
0097         nBitsPerInput = autoEncoder_conc_proc.nBitsPerInput,
0098         maxBitsPerOutput = autoEncoder_conc_proc.maxBitsPerOutput,
0099         bitsPerLink = autoEncoder_conc_proc.bitsPerLink,
0100         modelFiles = autoEncoder_conc_proc.modelFiles,
0101         linkToGraphMap = autoEncoder_conc_proc.linkToGraphMap,
0102         zeroSuppresionThreshold = autoEncoder_conc_proc.zeroSuppresionThreshold,
0103         saveEncodedValues = autoEncoder_conc_proc.saveEncodedValues,
0104         preserveModuleSum = autoEncoder_conc_proc.preserveModuleSum,
0105         scintillatorMethod = 'thresholdSelect',
0106         ):
0107     parameters = autoEncoder_conc_proc.clone(
0108             cellRemap = cellRemap,
0109             nBitsPerInput = nBitsPerInput,
0110             maxBitsPerOutput = maxBitsPerOutput,
0111             bitsPerLink = bitsPerLink,
0112             modelFiles = modelFiles,
0113             linkToGraphMap = linkToGraphMap,
0114             zeroSuppresionThreshold = zeroSuppresionThreshold,
0115             saveEncodedValues = saveEncodedValues,
0116             preserveModuleSum = preserveModuleSum,
0117             Method = cms.vstring(['autoEncoder','autoEncoder', scintillatorMethod]),
0118             )
0119     process.l1tHGCalConcentratorProducer.ProcessorParameters = parameters
0120     return process