CMS 3D CMS Logo

clustering3d.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from L1Trigger.L1THGCal.l1tHGCalBackEndLayer2Producer_cfi import distance_C3d_params, \
3  dbscan_C3d_params, \
4  histoMax_C3d_clustering_params, \
5  histoMax_C3d_seeding_params, \
6  histoMaxVariableDR_C3d_params, \
7  histoMaxXYVariableDR_C3d_params, \
8  histoSecondaryMax_C3d_params, \
9  histoInterpolatedMax_C3d_params, \
10  histoThreshold_C3d_params, \
11  neighbour_weights_1stOrder, \
12  neighbour_weights_2ndOrder
13 
14 from L1Trigger.L1THGCal.customClustering import set_histomax_clustering_params
15 from L1Trigger.L1THGCal.customHistoSeeding import set_histomax_seeding_params
16 
17 
18 def create_distance(process, inputs,
19  distance=distance_C3d_params.dR_multicluster
20  ):
21  producer = process.l1tHGCalBackEndLayer2Producer.clone(
22  InputCluster = cms.InputTag(inputs)
23  )
24  producer.ProcessorParameters.C3d_parameters = distance_C3d_params.clone(
25  dR_multicluster = distance
26  )
27  return producer
28 
29 
30 def create_dbscan(process, inputs,
31  distance=dbscan_C3d_params.dist_dbscan_multicluster,
32  min_points=dbscan_C3d_params.minN_dbscan_multicluster
33  ):
34  producer = process.l1tHGCalBackEndLayer2Producer.clone(
35  InputCluster = cms.InputTag(inputs)
36  )
37  producer.ProcessorParameters.C3d_parameters = dbscan_C3d_params.clone(
38  dist_dbscan_multicluster = distance,
39  minN_dbscan_multicluster = min_points
40  )
41  return producer
42 
43 
45  def __init__(self,
46  distance=histoMax_C3d_clustering_params.dR_multicluster,
47  nBins_X1=histoMax_C3d_seeding_params.nBins_X1_histo_multicluster,
48  nBins_X2=histoMax_C3d_seeding_params.nBins_X2_histo_multicluster,
49  binSumsHisto=histoMax_C3d_seeding_params.binSumsHisto,
50  seed_threshold=histoMax_C3d_seeding_params.threshold_histo_multicluster,
51  seeds_norm_by_area=histoMax_C3d_seeding_params.seeds_norm_by_area,
52  shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
53  shape_distance=histoMax_C3d_clustering_params.shape_distance,
54  ):
55  self.clustering_parameters = histoMax_C3d_clustering_params.clone()
56  self.seeding_parameters = histoMax_C3d_seeding_params.clone(
57  seeds_norm_by_area=seeds_norm_by_area
58  )
59  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
60  set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
61 
62  def __call__(self, process, inputs):
63  producer = process.l1tHGCalBackEndLayer2Producer.clone(
64  InputCluster = cms.InputTag(inputs)
65  )
66  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
67  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
68  return producer
69 
70 
72  def __init__(self,
73  distances=histoMaxVariableDR_C3d_params.dR_multicluster_byLayer_coefficientA,
74  nBins_X1=histoMax_C3d_seeding_params.nBins_X1_histo_multicluster,
75  nBins_X2=histoMax_C3d_seeding_params.nBins_X2_histo_multicluster,
76  binSumsHisto=histoMax_C3d_seeding_params.binSumsHisto,
77  seed_threshold=histoMax_C3d_seeding_params.threshold_histo_multicluster,
78  seeds_norm_by_area=histoMax_C3d_seeding_params.seeds_norm_by_area,
79  shape_threshold=histoMaxVariableDR_C3d_params.shape_threshold,
80  shape_distance=histoMaxVariableDR_C3d_params.shape_distance,
81  ):
82  self.clustering_parameters= histoMax_C3d_clustering_params.clone(
83  dR_multicluster_byLayer_coefficientA = distances
84  )
85  self.seeding_parameters = histoMax_C3d_seeding_params.clone(
86  seeds_norm_by_area=seeds_norm_by_area
87  )
88  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
89  set_histomax_clustering_params(self.clustering_parameters, 0, shape_threshold, shape_distance)
90 
91  def __call__(self, process, inputs):
92  producer = process.l1tHGCalBackEndLayer2Producer.clone(
93  InputCluster = cms.InputTag(inputs)
94  )
95  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
96  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
97  return producer
98 
99 
101  def __init__(self,
102  distances=histoMaxVariableDR_C3d_params.dR_multicluster_byLayer_coefficientA,
103  nBins_X1=histoMaxXYVariableDR_C3d_params.nBins_X1_histo_multicluster,
104  nBins_X2=histoMaxXYVariableDR_C3d_params.nBins_X2_histo_multicluster,
105  seed_threshold=histoMaxXYVariableDR_C3d_params.threshold_histo_multicluster,
106  shape_threshold=histoMaxVariableDR_C3d_params.shape_threshold,
107  shape_distance=histoMaxVariableDR_C3d_params.shape_distance,
108  ):
109  self.clustering_parameters = histoMax_C3d_clustering_params.clone(
110  dR_multicluster_byLayer_coefficientA = distances
111  )
112  self.seeding_parameters = histoMaxXYVariableDR_C3d_params.clone()
113  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, histoMaxXYVariableDR_C3d_params.binSumsHisto, seed_threshold)
114  set_histomax_clustering_params(self.clustering_parameters, 0, shape_threshold, shape_distance)
115 
116  def __call__(self, process, inputs):
117  producer = process.l1tHGCalBackEndLayer2Producer.clone(
118  InputCluster = cms.InputTag(inputs)
119  )
120  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
121  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
122  return producer
123 
124 
126  def __init__(self,
127  distance=histoMax_C3d_clustering_params.dR_multicluster,
128  nBins_X1=histoInterpolatedMax_C3d_params.nBins_X1_histo_multicluster,
129  nBins_X2=histoInterpolatedMax_C3d_params.nBins_X2_histo_multicluster,
130  binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto,
131  seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster,
132  shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
133  shape_distance=histoMax_C3d_clustering_params.shape_distance,
134  ):
135  self.seeding_parameters = histoInterpolatedMax_C3d_params.clone(
136  neighbour_weights = neighbour_weights_1stOrder
137  )
138  self.clustering_parameters = histoMax_C3d_clustering_params.clone()
139  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
140  set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
141 
142  def __call__(self, process, inputs):
143  producer = process.l1tHGCalBackEndLayer2Producer.clone(
144  InputCluster = cms.InputTag(inputs)
145  )
146  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
147  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
148  return producer
149 
150 
152  def __init__(self,
153  distance=histoMax_C3d_clustering_params.dR_multicluster,
154  nBins_X1=histoInterpolatedMax_C3d_params.nBins_X1_histo_multicluster,
155  nBins_X2=histoInterpolatedMax_C3d_params.nBins_X2_histo_multicluster,
156  binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto,
157  seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster,
158  shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
159  shape_distance=histoMax_C3d_clustering_params.shape_distance,
160  ):
161  self.seeding_parameters = histoInterpolatedMax_C3d_params.clone(
162  neighbour_weights = neighbour_weights_2ndOrder
163  )
164  self.clustering_parameters = histoMax_C3d_clustering_params.clone()
165  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
166  set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
167 
168  def __call__(self, process, inputs):
169  producer = process.l1tHGCalBackEndLayer2Producer.clone(
170  InputCluster = cms.InputTag(inputs)
171  )
172  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
173  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
174  return producer
175 
176 
178  def __init__(self,
179  seed_threshold=histoThreshold_C3d_params.threshold_histo_multicluster,
180  distance=histoMax_C3d_clustering_params.dR_multicluster,
181  nBins_X1=histoThreshold_C3d_params.nBins_X1_histo_multicluster,
182  nBins_X2=histoThreshold_C3d_params.nBins_X2_histo_multicluster,
183  binSumsHisto=histoThreshold_C3d_params.binSumsHisto,
184  shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
185  shape_distance=histoMax_C3d_clustering_params.shape_distance,
186  ):
187  self.seeding_parameters = histoThreshold_C3d_params.clone()
188  self.clustering_parameters = histoMax_C3d_clustering_params.clone()
189  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
190  set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
191 
192  def __call__(self, process, inputs):
193  producer = process.l1tHGCalBackEndLayer2Producer.clone(
194  InputCluster = cms.InputTag(inputs)
195  )
196  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
197  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
198  return producer
def __init__(self, seed_threshold=histoThreshold_C3d_params.threshold_histo_multicluster, distance=histoMax_C3d_clustering_params.dR_multicluster, nBins_X1=histoThreshold_C3d_params.nBins_X1_histo_multicluster, nBins_X2=histoThreshold_C3d_params.nBins_X2_histo_multicluster, binSumsHisto=histoThreshold_C3d_params.binSumsHisto, shape_threshold=histoMax_C3d_clustering_params.shape_threshold, shape_distance=histoMax_C3d_clustering_params.shape_distance)
def create_dbscan(process, inputs, distance=dbscan_C3d_params.dist_dbscan_multicluster, min_points=dbscan_C3d_params.minN_dbscan_multicluster)
Definition: clustering3d.py:33
def __call__(self, process, inputs)
Definition: clustering3d.py:91
def __init__(self, distances=histoMaxVariableDR_C3d_params.dR_multicluster_byLayer_coefficientA, nBins_X1=histoMaxXYVariableDR_C3d_params.nBins_X1_histo_multicluster, nBins_X2=histoMaxXYVariableDR_C3d_params.nBins_X2_histo_multicluster, seed_threshold=histoMaxXYVariableDR_C3d_params.threshold_histo_multicluster, shape_threshold=histoMaxVariableDR_C3d_params.shape_threshold, shape_distance=histoMaxVariableDR_C3d_params.shape_distance)
def __init__(self, distance=histoMax_C3d_clustering_params.dR_multicluster, nBins_X1=histoInterpolatedMax_C3d_params.nBins_X1_histo_multicluster, nBins_X2=histoInterpolatedMax_C3d_params.nBins_X2_histo_multicluster, binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto, seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster, shape_threshold=histoMax_C3d_clustering_params.shape_threshold, shape_distance=histoMax_C3d_clustering_params.shape_distance)
def __init__(self, distance=histoMax_C3d_clustering_params.dR_multicluster, nBins_X1=histoInterpolatedMax_C3d_params.nBins_X1_histo_multicluster, nBins_X2=histoInterpolatedMax_C3d_params.nBins_X2_histo_multicluster, binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto, seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster, shape_threshold=histoMax_C3d_clustering_params.shape_threshold, shape_distance=histoMax_C3d_clustering_params.shape_distance)
def __init__(self, distance=histoMax_C3d_clustering_params.dR_multicluster, nBins_X1=histoMax_C3d_seeding_params.nBins_X1_histo_multicluster, nBins_X2=histoMax_C3d_seeding_params.nBins_X2_histo_multicluster, binSumsHisto=histoMax_C3d_seeding_params.binSumsHisto, seed_threshold=histoMax_C3d_seeding_params.threshold_histo_multicluster, seeds_norm_by_area=histoMax_C3d_seeding_params.seeds_norm_by_area, shape_threshold=histoMax_C3d_clustering_params.shape_threshold, shape_distance=histoMax_C3d_clustering_params.shape_distance)
Definition: clustering3d.py:54
def __init__(self, distances=histoMaxVariableDR_C3d_params.dR_multicluster_byLayer_coefficientA, nBins_X1=histoMax_C3d_seeding_params.nBins_X1_histo_multicluster, nBins_X2=histoMax_C3d_seeding_params.nBins_X2_histo_multicluster, binSumsHisto=histoMax_C3d_seeding_params.binSumsHisto, seed_threshold=histoMax_C3d_seeding_params.threshold_histo_multicluster, seeds_norm_by_area=histoMax_C3d_seeding_params.seeds_norm_by_area, shape_threshold=histoMaxVariableDR_C3d_params.shape_threshold, shape_distance=histoMaxVariableDR_C3d_params.shape_distance)
Definition: clustering3d.py:81
def set_histomax_seeding_params(parameters_seeding_c3d, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
def set_histomax_clustering_params(parameters_c3d, distance, shape_threshold, shape_distance)
def __call__(self, process, inputs)
def create_distance(process, inputs, distance=distance_C3d_params.dR_multicluster)
Definition: clustering3d.py:20
def __call__(self, process, inputs)
def __call__(self, process, inputs)
Definition: clustering3d.py:62