Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:55:14

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 from L1Trigger.L1THGCal.l1tHGCalBackEndLayer2Producer_cfi import distance_C3d_params, \
0007                                                               dbscan_C3d_params, \
0008                                                               histoMax_C3d_clustering_params, \
0009                                                               histoMaxVariableDR_C3d_params, \
0010                                                               histoMaxXYVariableDR_C3d_params, \
0011                                                               histoSecondaryMax_C3d_params, \
0012                                                               histoInterpolatedMax_C3d_params, \
0013                                                               histoThreshold_C3d_params, \
0014                                                               dr_layerbylayer, \
0015                                                               dr_layerbylayer_Bcoefficient, \
0016                                                               neighbour_weights_1stOrder, \
0017                                                               neighbour_weights_2ndOrder, \
0018                                                               MAX_LAYERS
0019 
0020 
0021 def set_threshold_params(pset, seed_threshold, cluster_threshold):
0022     pset.seeding_threshold_silicon = seed_threshold
0023     pset.seeding_threshold_scintillator = seed_threshold
0024     pset.clustering_threshold_silicon = cluster_threshold
0025     pset.clustering_threshold_scintillator = cluster_threshold
0026 
0027 
0028 def custom_2dclustering_distance(process,
0029                                  distance=distance_C2d_params.dR_cluster,  # cm
0030                                  seed_threshold=distance_C2d_params.seeding_threshold_silicon,  # MipT
0031                                  cluster_threshold=distance_C2d_params.clustering_threshold_silicon  # MipT
0032                                  ):
0033     parameters_c2d = distance_C2d_params.clone(dR_cluster = distance)
0034     set_threshold_params(parameters_c2d, seed_threshold, cluster_threshold)
0035     process.l1tHGCalBackEndLayer1Producer.ProcessorParameters.C2d_parameters = parameters_c2d
0036     return process
0037 
0038 
0039 def custom_2dclustering_topological(process,
0040                                     seed_threshold=topological_C2d_params.seeding_threshold_silicon,  # MipT
0041                                     cluster_threshold=topological_C2d_params.clustering_threshold_silicon  # MipT
0042                                     ):
0043     parameters_c2d = topological_C2d_params.clone()
0044     set_threshold_params(parameters_c2d, seed_threshold, cluster_threshold)
0045     process.l1tHGCalBackEndLayer1Producer.ProcessorParameters.C2d_parameters = parameters_c2d
0046     return process
0047 
0048 
0049 def custom_2dclustering_constrainedtopological(process,
0050                                                distance=constrTopological_C2d_params.dR_cluster,  # cm
0051                                                seed_threshold=constrTopological_C2d_params.seeding_threshold_silicon,  # MipT
0052                                                cluster_threshold=constrTopological_C2d_params.clustering_threshold_silicon  # MipT
0053                                                ):
0054     parameters_c2d = constrTopological_C2d_params.clone(dR_cluster = distance)
0055     set_threshold_params(parameters_c2d, seed_threshold, cluster_threshold)
0056     process.l1tHGCalBackEndLayer1Producer.ProcessorParameters.C2d_parameters = parameters_c2d
0057     return process
0058 
0059 
0060 def custom_2dclustering_dummy(process):
0061     process.l1tHGCalBackEndLayer1Producer.ProcessorParameters.C2d_parameters = dummy_C2d_params.clone()
0062     return process
0063 
0064 
0065 def custom_3dclustering_distance(process,
0066                                  distance=distance_C3d_params.dR_multicluster
0067                                  ):
0068     parameters_c3d = distance_C3d_params.clone(dR_multicluster = distance)
0069     process.l1tHGCalBackEndLayer2Producer.ProcessorParameters.C3d_parameters = parameters_c3d
0070     return process
0071 
0072 
0073 def custom_3dclustering_dbscan(process,
0074                                distance=dbscan_C3d_params.dist_dbscan_multicluster,
0075                                min_points=dbscan_C3d_params.minN_dbscan_multicluster
0076                                ):
0077     parameters_c3d = dbscan_C3d_params.clone(
0078             dist_dbscan_multicluster = distance,
0079             minN_dbscan_multicluster = min_points
0080             )
0081     process.l1tHGCalBackEndLayer2Producer.ProcessorParameters.C3d_parameters = parameters_c3d
0082     return process
0083 
0084 
0085 def set_histomax_clustering_params(parameters_c3d,
0086                         distance,
0087                         shape_threshold,
0088                         shape_distance
0089                         ):
0090     parameters_c3d.dR_multicluster = distance
0091     parameters_c3d.shape_threshold = shape_threshold
0092     parameters_c3d.shape_distance = shape_distance
0093 
0094 
0095 def custom_3dclustering_fixedRadius(process,
0096                                 distance=histoMax_C3d_clustering_params.dR_multicluster,
0097                                 shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
0098                                 shape_distance=histoMax_C3d_clustering_params.shape_distance
0099                                 ):
0100     parameters_c3d = histoMax_C3d_clustering_params.clone()
0101     set_histomax_clustering_params(parameters_c3d, distance, shape_threshold, shape_distance)
0102     process.l1tHGCalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = parameters_c3d
0103     return process
0104 
0105 
0106 def custom_3dclustering_variableDr(process, distances=histoMaxVariableDR_C3d_params.dR_multicluster_byLayer_coefficientA,
0107                                             shape_threshold=histoMaxVariableDR_C3d_params.shape_threshold,
0108                                             shape_distance=histoMaxVariableDR_C3d_params.shape_distance
0109                                             ):
0110     parameters_c3d = histoMaxVariableDR_C3d_params.clone(
0111             dR_multicluster_byLayer_coefficientA = cms.vdouble(distances)
0112             )
0113     set_histomax_clustering_params(parameters_c3d, 0, shape_threshold, shape_distance)
0114     process.l1tHGCalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = parameters_c3d
0115     return process
0116 
0117 
0118 def custom_3dclustering_clusteringRadiusLayerbyLayerVariableEta(process,
0119                                                                 distance_coefficientA=dr_layerbylayer,
0120                                                                 distance_coefficientB=dr_layerbylayer_Bcoefficient):
0121     parameters_c3d = process.l1tHGCalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters
0122     parameters_c3d.dR_multicluster_byLayer_coefficientA = distance_coefficientA
0123     parameters_c3d.dR_multicluster_byLayer_coefficientB = distance_coefficientB
0124     return process
0125 
0126 
0127 def custom_3dclustering_clusteringRadiusLayerbyLayerFixedEta(process,
0128                                                              distance_coefficientA=dr_layerbylayer):
0129     parameters_c3d = process.l1tHGCalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters
0130     parameters_c3d.dR_multicluster_byLayer_coefficientA = distance_coefficientA
0131     parameters_c3d.dR_multicluster_byLayer_coefficientB = cms.vdouble( [0]*(MAX_LAYERS+1) )
0132     return process
0133 
0134 def custom_3dclustering_clusteringRadiusNoLayerDependenceFixedEta(process,
0135                                                                   distance_coefficientA=0.03):
0136     parameters_c3d = process.l1tHGCalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters
0137     parameters_c3d.dR_multicluster_byLayer_coefficientA = cms.vdouble( [distance_coefficientA]*(MAX_LAYERS+1) )
0138     parameters_c3d.dR_multicluster_byLayer_coefficientB = cms.vdouble( [0]*(MAX_LAYERS+1) )
0139     return process
0140 
0141 def custom_3dclustering_clusteringRadiusNoLayerDependenceVariableEta(process,
0142                                                                      distance_coefficientA=0.03,
0143                                                                      distance_coefficientB=0.02):
0144     parameters_c3d = process.l1tHGCalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters
0145     parameters_c3d.dR_multicluster_byLayer_coefficientA = cms.vdouble( [distance_coefficientA]*(MAX_LAYERS+1) )
0146     parameters_c3d.dR_multicluster_byLayer_coefficientB = cms.vdouble( [distance_coefficientB]*(MAX_LAYERS+1) )
0147     return process
0148 
0149 
0150 def custom_3dclustering_nearestNeighbourAssociation(process):
0151     parameters_c3d = process.l1tHGCalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters
0152     parameters_c3d.cluster_association = cms.string('NearestNeighbour')
0153 
0154     return process
0155 
0156 def custom_3dclustering_EnergySplitAssociation(process):
0157 
0158     parameters_c3d = process.l1tHGCalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters
0159     parameters_c3d.cluster_association = cms.string('EnergySplit')
0160     return process