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  shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
52  shape_distance=histoMax_C3d_clustering_params.shape_distance,
53  ):
54  self.clustering_parameters = histoMax_C3d_clustering_params.clone()
55  self.seeding_parameters = histoMax_C3d_seeding_params.clone()
56  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
57  set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
58 
59  def __call__(self, process, inputs):
60  producer = process.l1tHGCalBackEndLayer2Producer.clone(
61  InputCluster = cms.InputTag(inputs)
62  )
63  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
64  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
65  return producer
66 
67 
69  def __init__(self,
70  distances=histoMaxVariableDR_C3d_params.dR_multicluster_byLayer_coefficientA,
71  nBins_X1=histoMax_C3d_seeding_params.nBins_X1_histo_multicluster,
72  nBins_X2=histoMax_C3d_seeding_params.nBins_X2_histo_multicluster,
73  binSumsHisto=histoMax_C3d_seeding_params.binSumsHisto,
74  seed_threshold=histoMax_C3d_seeding_params.threshold_histo_multicluster,
75  shape_threshold=histoMaxVariableDR_C3d_params.shape_threshold,
76  shape_distance=histoMaxVariableDR_C3d_params.shape_distance,
77  ):
78  self.clustering_parameters= histoMax_C3d_clustering_params.clone(
79  dR_multicluster_byLayer_coefficientA = distances
80  )
81  self.seeding_parameters = histoMax_C3d_seeding_params.clone()
82  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
83  set_histomax_clustering_params(self.clustering_parameters, 0, shape_threshold, shape_distance)
84 
85  def __call__(self, process, inputs):
86  producer = process.l1tHGCalBackEndLayer2Producer.clone(
87  InputCluster = cms.InputTag(inputs)
88  )
89  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
90  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
91  return producer
92 
93 
95  def __init__(self,
96  distances=histoMaxVariableDR_C3d_params.dR_multicluster_byLayer_coefficientA,
97  nBins_X1=histoMaxXYVariableDR_C3d_params.nBins_X1_histo_multicluster,
98  nBins_X2=histoMaxXYVariableDR_C3d_params.nBins_X2_histo_multicluster,
99  seed_threshold=histoMaxXYVariableDR_C3d_params.threshold_histo_multicluster,
100  shape_threshold=histoMaxVariableDR_C3d_params.shape_threshold,
101  shape_distance=histoMaxVariableDR_C3d_params.shape_distance,
102  ):
103  self.clustering_parameters = histoMax_C3d_clustering_params.clone(
104  dR_multicluster_byLayer_coefficientA = distances
105  )
106  self.seeding_parameters = histoMaxXYVariableDR_C3d_params.clone()
107  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, histoMaxXYVariableDR_C3d_params.binSumsHisto, seed_threshold)
108  set_histomax_clustering_params(self.clustering_parameters, 0, shape_threshold, shape_distance)
109 
110  def __call__(self, process, inputs):
111  producer = process.l1tHGCalBackEndLayer2Producer.clone(
112  InputCluster = cms.InputTag(inputs)
113  )
114  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
115  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
116  return producer
117 
118 
120  def __init__(self,
121  distance=histoMax_C3d_clustering_params.dR_multicluster,
122  nBins_X1=histoInterpolatedMax_C3d_params.nBins_X1_histo_multicluster,
123  nBins_X2=histoInterpolatedMax_C3d_params.nBins_X2_histo_multicluster,
124  binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto,
125  seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster,
126  shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
127  shape_distance=histoMax_C3d_clustering_params.shape_distance,
128  ):
129  self.seeding_parameters = histoInterpolatedMax_C3d_params.clone(
130  neighbour_weights = neighbour_weights_1stOrder
131  )
132  self.clustering_parameters = histoMax_C3d_clustering_params.clone()
133  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
134  set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
135 
136  def __call__(self, process, inputs):
137  producer = process.l1tHGCalBackEndLayer2Producer.clone(
138  InputCluster = cms.InputTag(inputs)
139  )
140  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
141  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
142  return producer
143 
144 
146  def __init__(self,
147  distance=histoMax_C3d_clustering_params.dR_multicluster,
148  nBins_X1=histoInterpolatedMax_C3d_params.nBins_X1_histo_multicluster,
149  nBins_X2=histoInterpolatedMax_C3d_params.nBins_X2_histo_multicluster,
150  binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto,
151  seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster,
152  shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
153  shape_distance=histoMax_C3d_clustering_params.shape_distance,
154  ):
155  self.seeding_parameters = histoInterpolatedMax_C3d_params.clone(
156  neighbour_weights = neighbour_weights_2ndOrder
157  )
158  self.clustering_parameters = histoMax_C3d_clustering_params.clone()
159  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
160  set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
161 
162  def __call__(self, process, inputs):
163  producer = process.l1tHGCalBackEndLayer2Producer.clone(
164  InputCluster = cms.InputTag(inputs)
165  )
166  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
167  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
168  return producer
169 
170 
172  def __init__(self,
173  seed_threshold=histoThreshold_C3d_params.threshold_histo_multicluster,
174  distance=histoMax_C3d_clustering_params.dR_multicluster,
175  nBins_X1=histoThreshold_C3d_params.nBins_X1_histo_multicluster,
176  nBins_X2=histoThreshold_C3d_params.nBins_X2_histo_multicluster,
177  binSumsHisto=histoThreshold_C3d_params.binSumsHisto,
178  shape_threshold=histoMax_C3d_clustering_params.shape_threshold,
179  shape_distance=histoMax_C3d_clustering_params.shape_distance,
180  ):
181  self.seeding_parameters = histoThreshold_C3d_params.clone()
182  self.clustering_parameters = histoMax_C3d_clustering_params.clone()
183  set_histomax_seeding_params(self.seeding_parameters, nBins_X1, nBins_X2, binSumsHisto, seed_threshold)
184  set_histomax_clustering_params(self.clustering_parameters, distance, shape_threshold, shape_distance)
185 
186  def __call__(self, process, inputs):
187  producer = process.l1tHGCalBackEndLayer2Producer.clone(
188  InputCluster = cms.InputTag(inputs)
189  )
190  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = self.seeding_parameters
191  producer.ProcessorParameters.C3d_parameters.histoMax_C3d_clustering_parameters = self.clustering_parameters
192  return producer
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, shape_threshold=histoMaxVariableDR_C3d_params.shape_threshold, shape_distance=histoMaxVariableDR_C3d_params.shape_distance)
Definition: clustering3d.py:77
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:85
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, shape_threshold=histoMax_C3d_clustering_params.shape_threshold, shape_distance=histoMax_C3d_clustering_params.shape_distance)
Definition: clustering3d.py:53
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 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:59