Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 from L1Trigger.L1THGCal.l1tHGCalBackEndLayer1Producer_cfi import dummy_C2d_params, \
0003                                                               distance_C2d_params, \
0004                                                               topological_C2d_params, \
0005                                                               constrTopological_C2d_params, \
0006                                                               layer1truncation_proc, \
0007                                                               truncation_params
0008 from L1Trigger.L1THGCal.customClustering import set_threshold_params
0009 
0010 
0011 def create_distance(process, inputs,
0012                     distance=distance_C2d_params.dR_cluster,  # cm
0013                     seed_threshold=distance_C2d_params.seeding_threshold_silicon,  # MipT
0014                     cluster_threshold=distance_C2d_params.clustering_threshold_silicon  # MipT
0015                     ):
0016     producer = process.l1tHGCalBackEndLayer1Producer.clone(
0017             InputTriggerCells = cms.InputTag(inputs)
0018             )
0019     producer.ProcessorParameters.C2d_parameters = distance_C2d_params.clone(
0020             dR_cluster = distance
0021             )
0022     set_threshold_params(producer.ProcessorParameters.C2d_parameters, seed_threshold, cluster_threshold)
0023     return producer
0024 
0025 
0026 def create_topological(process, inputs,
0027                        seed_threshold=topological_C2d_params.seeding_threshold_silicon,  # MipT
0028                        cluster_threshold=topological_C2d_params.clustering_threshold_silicon  # MipT
0029                        ):
0030     producer = process.l1tHGCalBackEndLayer1Producer.clone(
0031             InputTriggerCells = cms.InputTag(inputs)
0032             )
0033     producer.ProcessorParameters.C2d_parameters = topological_C2d_params.clone()
0034     set_threshold_params(producer.ProcessorParameters.C2d_parameters, seed_threshold, cluster_threshold)
0035     return producer
0036 
0037 
0038 def create_constrainedtopological(process, inputs,
0039                                   distance=constrTopological_C2d_params.dR_cluster,  # cm
0040                                   seed_threshold=constrTopological_C2d_params.seeding_threshold_silicon,  # MipT
0041                                   cluster_threshold=constrTopological_C2d_params.clustering_threshold_silicon  # MipT
0042                                   ):
0043     producer = process.l1tHGCalBackEndLayer1Producer.clone(
0044             InputTriggerCells = cms.InputTag(inputs)
0045             )
0046     producer.ProcessorParameters.C2d_parameters = constrTopological_C2d_params.clone(
0047             dR_cluster = distance
0048             )
0049     set_threshold_params(producer.ProcessorParameters.C2d_parameters, seed_threshold, cluster_threshold)
0050     return producer
0051 
0052 
0053 
0054 class CreateDummy(object):
0055     def __call__(self, process, inputs):
0056         producer = process.l1tHGCalBackEndLayer1Producer.clone(
0057                 InputTriggerCells = cms.InputTag(inputs)
0058                 )
0059         producer.ProcessorParameters.C2d_parameters = dummy_C2d_params.clone()
0060         return producer
0061 
0062 class CreateTruthDummy(object):
0063     def __call__(self, process, inputs):
0064         producer = process.l1tHGCalBackEndLayer1Producer.clone(
0065                 InputTriggerCells = cms.InputTag(inputs)
0066                 )
0067         producer.ProcessorParameters.C2d_parameters = dummy_C2d_params.clone()
0068         return producer
0069 
0070 
0071 class RozBinTruncation(object):
0072     def __init__(self,
0073             maxTcsPerBin=truncation_params.maxTcsPerBin):
0074         self.processor = layer1truncation_proc.clone(
0075                 truncation_parameters=truncation_params.clone(
0076                     maxTcsPerBin=maxTcsPerBin
0077                     )
0078                 )
0079 
0080     def __call__(self, process, inputs):
0081         producer = process.l1tHGCalBackEndLayer1Producer.clone(
0082                 InputTriggerCells = cms.InputTag(inputs),
0083                 ProcessorParameters = self.processor
0084                 )
0085         return producer