File indexing completed on 2024-04-06 12:20:40
0001 import FWCore.ParameterSet.Config as cms
0002 from L1Trigger.L1THGCal.l1tHGCalTowerMapProducer_cfi import L1TTriggerTowerConfig_energySplit
0003 import math
0004
0005 def custom_towers_unclustered_tc(process):
0006 process.l1tHGCalTowerProducer.InputTriggerCells = cms.InputTag('l1tHGCalBackEndLayer2Producer:HGCalBackendLayer2Processor3DClusteringUnclustered')
0007 process.l1tHGCalTowerProducerHFNose.InputTriggerCells = cms.InputTag('l1tHGCalBackEndLayer2ProducerHFNose:HGCalBackendLayer2Processor3DClusteringUnclustered')
0008 return process
0009
0010
0011 def custom_towers_all_tc(process):
0012 process.l1tHGCalTowerProducer.InputTriggerCells = cms.InputTag('l1tHGCalBackEndLayer1Producer:HGCalBackendLayer1Processor2DClustering')
0013 process.l1tHGCalTowerProducerHFNose.InputTriggerCells = cms.InputTag('l1tHGCalBackEndLayer1ProducerHFNose:HGCalBackendLayer1Processor2DClustering')
0014 return process
0015
0016
0017 def custom_towers_etaphi(process,
0018 minEta=1.479,
0019 maxEta=3.0,
0020 minPhi=-math.pi,
0021 maxPhi=math.pi,
0022 nBinsEta=18,
0023 nBinsPhi=72,
0024 binsEta=[],
0025 binsPhi=[]
0026 ):
0027 parameters_towers_2d = process.l1tHGCalTowerMapProducer.ProcessorParameters.towermap_parameters
0028 parameters_towers_2d.L1TTriggerTowerConfig.readMappingFile = cms.bool(False)
0029 parameters_towers_2d.L1TTriggerTowerConfig.minEta = cms.double(minEta)
0030 parameters_towers_2d.L1TTriggerTowerConfig.maxEta = cms.double(maxEta)
0031 parameters_towers_2d.L1TTriggerTowerConfig.minPhi = cms.double(minPhi)
0032 parameters_towers_2d.L1TTriggerTowerConfig.maxPhi = cms.double(maxPhi)
0033 parameters_towers_2d.L1TTriggerTowerConfig.nBinsEta = cms.int32(nBinsEta)
0034 parameters_towers_2d.L1TTriggerTowerConfig.nBinsPhi = cms.int32(nBinsPhi)
0035 parameters_towers_2d.L1TTriggerTowerConfig.binsEta = cms.vdouble(binsEta)
0036 parameters_towers_2d.L1TTriggerTowerConfig.binsPhi = cms.vdouble(binsPhi)
0037 return process
0038
0039 def custom_towers_energySplit(process):
0040 parameters_towers_2d = L1TTriggerTowerConfig_energySplit.clone()
0041 process.l1tHGCalTowerMapProducer.ProcessorParameters.towermap_parameters.L1TTriggerTowerConfig = parameters_towers_2d
0042 return process
0043
0044 def custom_towers_map(process,
0045 towermapping='L1Trigger/L1THGCal/data/tower_mapping_hgcroc_eta-phi_v3.txt',
0046 minEta=1.479,
0047 maxEta=3.0,
0048 minPhi=-math.pi,
0049 maxPhi=math.pi,
0050 nBinsEta=18,
0051 nBinsPhi=72
0052 ):
0053 parameters_towers_2d = process.l1tHGCalTowerMapProducer.ProcessorParameters.towermap_parameters
0054 parameters_towers_2d.L1TTriggerTowerConfig.readMappingFile = cms.bool(True)
0055 parameters_towers_2d.L1TTriggerTowerConfig.L1TTriggerTowerMapping = cms.FileInPath(towermapping)
0056 parameters_towers_2d.L1TTriggerTowerConfig.minEta = cms.double(minEta)
0057 parameters_towers_2d.L1TTriggerTowerConfig.maxEta = cms.double(maxEta)
0058 parameters_towers_2d.L1TTriggerTowerConfig.minPhi = cms.double(minPhi)
0059 parameters_towers_2d.L1TTriggerTowerConfig.maxPhi = cms.double(maxPhi)
0060 parameters_towers_2d.L1TTriggerTowerConfig.nBinsEta = cms.int32(nBinsEta)
0061 parameters_towers_2d.L1TTriggerTowerConfig.nBinsPhi = cms.int32(nBinsPhi)
0062 return process
0063
0064
0065 def custom_tower_map_hgcroc(process,
0066 towermapping='L1Trigger/L1THGCal/data/tower_mapping_hgcroc_eta-phi_v3.txt',
0067 minEta=1.479,
0068 maxEta=3.0,
0069 minPhi=-math.pi,
0070 maxPhi=math.pi,
0071 nBinsEta=18,
0072 nBinsPhi=72
0073 ):
0074 return custom_towers_map(process,
0075 towermapping,
0076 minEta,
0077 maxEta,
0078 minPhi,
0079 maxPhi,
0080 nBinsEta,
0081 nBinsPhi
0082 )
0083
0084
0085 def custom_tower_map_wafer(process,
0086 towermapping='L1Trigger/L1THGCal/data/tower_mapping_wafer_eta-phi_v3.txt',
0087 minEta=1.479,
0088 maxEta=3.0,
0089 minPhi=-math.pi,
0090 maxPhi=math.pi,
0091 nBinsEta=18,
0092 nBinsPhi=72
0093 ):
0094 return custom_towers_map(process,
0095 towermapping,
0096 minEta,
0097 maxEta,
0098 minPhi,
0099 maxPhi,
0100 nBinsEta,
0101 nBinsPhi
0102 )