Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:12:26

0001 import FWCore.ParameterSet.Config as cms
0002 from L1Trigger.L1THGCal.l1tHGCalBackEndLayer2Producer_cfi import distance_C3d_params, \
0003                                                               dbscan_C3d_params, \
0004                                                               histoMax_C3d_clustering_params, \
0005                                                               histoMax_C3d_seeding_params, \
0006                                                               histoMaxVariableDR_C3d_params, \
0007                                                               histoMaxXYVariableDR_C3d_params, \
0008                                                               histoSecondaryMax_C3d_params, \
0009                                                               histoInterpolatedMax_C3d_params, \
0010                                                               histoThreshold_C3d_params, \
0011                                                               neighbour_weights_1stOrder, \
0012                                                               neighbour_weights_2ndOrder
0013 
0014 from L1Trigger.L1THGCal.customClustering import set_histomax_clustering_params
0015 from L1Trigger.L1THGCal.customHistoSeeding import set_histomax_seeding_params
0016 
0017 
0018 def create_distance(process, inputs,
0019                     distance=distance_C3d_params.dR_multicluster
0020                     ):
0021     producer = process.l1tHGCalBackEndLayer2Producer.clone(
0022             InputCluster = cms.InputTag(inputs)
0023             )
0024     producer.ProcessorParameters.C3d_parameters = distance_C3d_params.clone(
0025             dR_multicluster = distance
0026             )
0027     return producer
0028 
0029 
0030 def create_dbscan(process, inputs,
0031                   distance=dbscan_C3d_params.dist_dbscan_multicluster,
0032                   min_points=dbscan_C3d_params.minN_dbscan_multicluster
0033                   ):
0034     producer = process.l1tHGCalBackEndLayer2Producer.clone(
0035             InputCluster = cms.InputTag(inputs)
0036             )
0037     producer.ProcessorParameters.C3d_parameters = dbscan_C3d_params.clone(
0038             dist_dbscan_multicluster = distance,
0039             minN_dbscan_multicluster = min_points
0040             )
0041     return producer
0042 
0043 
0044 class CreateHistoMax(object):
0045     def __init__(self,
0046             distance=histoMax_C3d_clustering_params.dR_multicluster,
0047             nBins_X1=histoMax_C3d_seeding_params.nBins_X1_histo_multicluster,
0048             nBins_X2=histoMax_C3d_seeding_params.nBins_X2_histo_multicluster,
0049             binSumsHisto=histoMax_C3d_seeding_params.binSumsHisto,
0050             seed_threshold=histoMax_C3d_seeding_params.threshold_histo_multicluster,
0051             shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
0052             shape_distance=histoMax_C3d_clustering_params.shape_distance,
0053             ):
0054         self.clustering_parameters = histoMax_C3d_clustering_params.clone()
0055         self.seeding_parameters = histoMax_C3d_seeding_params.clone()
0056         set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
0057         set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
0058 
0059     def __call__(self, process, inputs):
0060         producer = process.l1tHGCalBackEndLayer2Producer.clone(
0061                 InputCluster = cms.InputTag(inputs)
0062                 )
0063         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
0064         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
0065         return producer
0066 
0067 
0068 class CreateHistoMaxVariableDr(object):
0069     def __init__(self,
0070             distances=histoMaxVariableDR_C3d_params.dR_multicluster_byLayer_coefficientA,
0071             nBins_X1=histoMax_C3d_seeding_params.nBins_X1_histo_multicluster,
0072             nBins_X2=histoMax_C3d_seeding_params.nBins_X2_histo_multicluster,
0073             binSumsHisto=histoMax_C3d_seeding_params.binSumsHisto,
0074             seed_threshold=histoMax_C3d_seeding_params.threshold_histo_multicluster,
0075             shape_threshold=histoMaxVariableDR_C3d_params.shape_threshold,
0076             shape_distance=histoMaxVariableDR_C3d_params.shape_distance,
0077             ):
0078         self.clustering_parameters= histoMax_C3d_clustering_params.clone(
0079                 dR_multicluster_byLayer_coefficientA = distances
0080                 )
0081         self.seeding_parameters = histoMax_C3d_seeding_params.clone()
0082         set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
0083         set_histomax_clustering_params(self.clustering_parameters, 0, shape_threshold, shape_distance)
0084 
0085     def __call__(self, process, inputs):
0086         producer = process.l1tHGCalBackEndLayer2Producer.clone(
0087                 InputCluster = cms.InputTag(inputs)
0088                 )
0089         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
0090         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
0091         return producer
0092 
0093 
0094 class CreateHistoMaxXYVariableDr(object):
0095     def __init__(self,
0096             distances=histoMaxVariableDR_C3d_params.dR_multicluster_byLayer_coefficientA,
0097             nBins_X1=histoMaxXYVariableDR_C3d_params.nBins_X1_histo_multicluster,
0098             nBins_X2=histoMaxXYVariableDR_C3d_params.nBins_X2_histo_multicluster,
0099             seed_threshold=histoMaxXYVariableDR_C3d_params.threshold_histo_multicluster,
0100             shape_threshold=histoMaxVariableDR_C3d_params.shape_threshold,
0101             shape_distance=histoMaxVariableDR_C3d_params.shape_distance,
0102             ):
0103         self.clustering_parameters = histoMax_C3d_clustering_params.clone(
0104                 dR_multicluster_byLayer_coefficientA = distances
0105                 )
0106         self.seeding_parameters = histoMaxXYVariableDR_C3d_params.clone()
0107         set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, histoMaxXYVariableDR_C3d_params.binSumsHisto, seed_threshold)
0108         set_histomax_clustering_params(self.clustering_parameters, 0, shape_threshold, shape_distance)
0109 
0110     def __call__(self, process, inputs):
0111         producer = process.l1tHGCalBackEndLayer2Producer.clone(
0112                 InputCluster = cms.InputTag(inputs)
0113                 )
0114         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
0115         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
0116         return producer
0117 
0118 
0119 class CreateHistoInterpolatedMax1stOrder(object):
0120     def __init__(self,
0121             distance=histoMax_C3d_clustering_params.dR_multicluster,
0122             nBins_X1=histoInterpolatedMax_C3d_params.nBins_X1_histo_multicluster,
0123             nBins_X2=histoInterpolatedMax_C3d_params.nBins_X2_histo_multicluster,
0124             binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto,
0125             seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster,
0126             shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
0127             shape_distance=histoMax_C3d_clustering_params.shape_distance,
0128             ):
0129         self.seeding_parameters = histoInterpolatedMax_C3d_params.clone(
0130                 neighbour_weights = neighbour_weights_1stOrder
0131                 )
0132         self.clustering_parameters = histoMax_C3d_clustering_params.clone()
0133         set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
0134         set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
0135 
0136     def __call__(self, process, inputs):
0137         producer = process.l1tHGCalBackEndLayer2Producer.clone(
0138                 InputCluster = cms.InputTag(inputs)
0139                 )
0140         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
0141         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
0142         return producer
0143 
0144 
0145 class CreateHistoInterpolatedMax2ndOrder(object):
0146     def __init__(self,
0147             distance=histoMax_C3d_clustering_params.dR_multicluster,
0148             nBins_X1=histoInterpolatedMax_C3d_params.nBins_X1_histo_multicluster,
0149             nBins_X2=histoInterpolatedMax_C3d_params.nBins_X2_histo_multicluster,
0150             binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto,
0151             seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster,
0152             shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
0153             shape_distance=histoMax_C3d_clustering_params.shape_distance,
0154             ):
0155         self.seeding_parameters = histoInterpolatedMax_C3d_params.clone(
0156                 neighbour_weights = neighbour_weights_2ndOrder
0157                 )
0158         self.clustering_parameters = histoMax_C3d_clustering_params.clone()
0159         set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
0160         set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
0161 
0162     def __call__(self, process, inputs):
0163         producer = process.l1tHGCalBackEndLayer2Producer.clone(
0164                 InputCluster = cms.InputTag(inputs)
0165                 )
0166         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
0167         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
0168         return producer
0169 
0170 
0171 class CreateHistoThreshold(object):
0172     def __init__(self,
0173             seed_threshold=histoThreshold_C3d_params.threshold_histo_multicluster,
0174             distance=histoMax_C3d_clustering_params.dR_multicluster,
0175             nBins_X1=histoThreshold_C3d_params.nBins_X1_histo_multicluster,
0176             nBins_X2=histoThreshold_C3d_params.nBins_X2_histo_multicluster,
0177             binSumsHisto=histoThreshold_C3d_params.binSumsHisto,
0178             shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
0179             shape_distance=histoMax_C3d_clustering_params.shape_distance,
0180             ):
0181         self.seeding_parameters = histoThreshold_C3d_params.clone()
0182         self.clustering_parameters = histoMax_C3d_clustering_params.clone()
0183         set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
0184         set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
0185 
0186     def __call__(self, process, inputs):
0187         producer = process.l1tHGCalBackEndLayer2Producer.clone(
0188                 InputCluster = cms.InputTag(inputs)
0189                 )
0190         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
0191         producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
0192         return producer