CMS 3D CMS Logo

clustering3d.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from L1Trigger.L1THGCal.hgcalBackEndLayer2Producer_cfi import distance_C3d_params, \
3  dbscan_C3d_params, \
4  histoMax_C3d_params, \
5  histoMaxVariableDR_C3d_params, \
6  histoSecondaryMax_C3d_params, \
7  histoInterpolatedMax_C3d_params, \
8  histoThreshold_C3d_params, \
9  neighbour_weights_1stOrder, \
10  neighbour_weights_2ndOrder
11 
12 from L1Trigger.L1THGCal.customClustering import set_histomax_params
13 
14 
15 def create_distance(process, inputs,
16  distance=distance_C3d_params.dR_multicluster
17  ):
18  producer = process.hgcalBackEndLayer2Producer.clone(
19  InputCluster = cms.InputTag('{}:HGCalBackendLayer1Processor2DClustering'.format(inputs))
20  )
21  producer.ProcessorParameters.C3d_parameters = distance_C3d_params.clone(
22  dR_multicluster = distance
23  )
24  return producer
25 
26 
27 def create_dbscan(process, inputs,
28  distance=dbscan_C3d_params.dist_dbscan_multicluster,
29  min_points=dbscan_C3d_params.minN_dbscan_multicluster
30  ):
31  producer = process.hgcalBackEndLayer2Producer.clone(
32  InputCluster = cms.InputTag('{}:HGCalBackendLayer1Processor2DClustering'.format(inputs))
33  )
34  producer.ProcessorParameters.C3d_parameters = dbscan_C3d_params.clone(
35  dist_dbscan_multicluster = distance,
36  minN_dbscan_multicluster = min_points
37  )
38  return producer
39 
40 
41 def create_histoMax(process, inputs,
42  distance=histoMax_C3d_params.dR_multicluster,
43  nBins_R=histoMax_C3d_params.nBins_R_histo_multicluster,
44  nBins_Phi=histoMax_C3d_params.nBins_Phi_histo_multicluster,
45  binSumsHisto=histoMax_C3d_params.binSumsHisto,
46  seed_threshold=histoMax_C3d_params.threshold_histo_multicluster,
47  ):
48  producer = process.hgcalBackEndLayer2Producer.clone(
49  InputCluster = cms.InputTag('{}:HGCalBackendLayer1Processor2DClustering'.format(inputs))
50  )
51  producer.ProcessorParameters.C3d_parameters = histoMax_C3d_params.clone()
52  set_histomax_params(producer.ProcessorParameters.C3d_parameters, distance, nBins_R, nBins_Phi, binSumsHisto, seed_threshold)
53  return producer
54 
55 
56 def create_histoMax_variableDr(process, inputs,
57  distances=histoMaxVariableDR_C3d_params.dR_multicluster_byLayer_coefficientA,
58  nBins_R=histoMaxVariableDR_C3d_params.nBins_R_histo_multicluster,
59  nBins_Phi=histoMaxVariableDR_C3d_params.nBins_Phi_histo_multicluster,
60  binSumsHisto=histoMaxVariableDR_C3d_params.binSumsHisto,
61  seed_threshold=histoMaxVariableDR_C3d_params.threshold_histo_multicluster,
62  ):
63  producer = process.hgcalBackEndLayer2Producer.clone(
64  InputCluster = cms.InputTag('{}:HGCalBackendLayer1Processor2DClustering'.format(inputs))
65  )
66  producer.ProcessorParameters.C3d_parameters = histoMax_C3d_params.clone(
67  dR_multicluster_byLayer_coefficientA = distances
68  )
69  set_histomax_params(producer.ProcessorParameters.C3d_parameters, 0, nBins_R, nBins_Phi, binSumsHisto, seed_threshold)
70  return producer
71 
72 
73 def create_histoInterpolatedMax1stOrder(process, inputs,
74  distance=histoInterpolatedMax_C3d_params.dR_multicluster,
75  nBins_R=histoInterpolatedMax_C3d_params.nBins_R_histo_multicluster,
76  nBins_Phi=histoInterpolatedMax_C3d_params.nBins_Phi_histo_multicluster,
77  binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto,
78  seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster,
79  ):
80  producer = process.hgcalBackEndLayer2Producer.clone(
81  InputCluster = cms.InputTag('{}:HGCalBackendLayer1Processor2DClustering'.format(inputs))
82  )
83  producer.ProcessorParameters.C3d_parameters = histoInterpolatedMax_C3d_params.clone(
84  neighbour_weights = neighbour_weights_1stOrder
85  )
86  set_histomax_params(producer.ProcessorParameters.C3d_parameters, distance, nBins_R, nBins_Phi, binSumsHisto, seed_threshold)
87  return producer
88 
89 
90 def create_histoInterpolatedMax2ndOrder(process, inputs,
91  distance=histoInterpolatedMax_C3d_params.dR_multicluster,
92  nBins_R=histoInterpolatedMax_C3d_params.nBins_R_histo_multicluster,
93  nBins_Phi=histoInterpolatedMax_C3d_params.nBins_Phi_histo_multicluster,
94  binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto,
95  seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster,
96  ):
97  producer = process.hgcalBackEndLayer2Producer.clone(
98  InputCluster = cms.InputTag('{}:HGCalBackendLayer1Processor2DClustering'.format(inputs))
99  )
100  producer.ProcessorParameters.C3d_parameters = histoInterpolatedMax_C3d_params.clone(
101  neighbour_weights = neighbour_weights_2ndOrder
102  )
103  set_histomax_params(producer.ProcessorParameters.C3d_parameters, distance, nBins_R, nBins_Phi, binSumsHisto, seed_threshold)
104  return producer
105 
106 
107 def create_histoThreshold(process, inputs,
108  threshold=histoThreshold_C3d_params.threshold_histo_multicluster,
109  distance=histoThreshold_C3d_params.dR_multicluster,
110  nBins_R=histoThreshold_C3d_params.nBins_R_histo_multicluster,
111  nBins_Phi=histoThreshold_C3d_params.nBins_Phi_histo_multicluster,
112  binSumsHisto=histoThreshold_C3d_params.binSumsHisto
113  ):
114  producer = process.hgcalBackEndLayer2Producer.clone(
115  InputCluster = cms.InputTag('{}:HGCalBackendLayer1Processor2DClustering'.format(inputs))
116  )
117  producer.ProcessorParameters.C3d_parameters = histoThreshold_C3d_params.clone()
118  set_histomax_params(producer.ProcessorParameters.C3d_parameters, distance, nBins_R, nBins_Phi, binSumsHisto, threshold)
119  return producer
def create_histoMax(process, inputs, distance=histoMax_C3d_params.dR_multicluster, nBins_R=histoMax_C3d_params.nBins_R_histo_multicluster, nBins_Phi=histoMax_C3d_params.nBins_Phi_histo_multicluster, binSumsHisto=histoMax_C3d_params.binSumsHisto, seed_threshold=histoMax_C3d_params.threshold_histo_multicluster)
Definition: clustering3d.py:47
def create_dbscan(process, inputs, distance=dbscan_C3d_params.dist_dbscan_multicluster, min_points=dbscan_C3d_params.minN_dbscan_multicluster)
Definition: clustering3d.py:30
def create_histoInterpolatedMax1stOrder(process, inputs, distance=histoInterpolatedMax_C3d_params.dR_multicluster, nBins_R=histoInterpolatedMax_C3d_params.nBins_R_histo_multicluster, nBins_Phi=histoInterpolatedMax_C3d_params.nBins_Phi_histo_multicluster, binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto, seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster)
Definition: clustering3d.py:79
def set_histomax_params(parameters_c3d, distance, nBins_R, nBins_Phi, binSumsHisto, seed_threshold)
def create_histoMax_variableDr(process, inputs, distances=histoMaxVariableDR_C3d_params.dR_multicluster_byLayer_coefficientA, nBins_R=histoMaxVariableDR_C3d_params.nBins_R_histo_multicluster, nBins_Phi=histoMaxVariableDR_C3d_params.nBins_Phi_histo_multicluster, binSumsHisto=histoMaxVariableDR_C3d_params.binSumsHisto, seed_threshold=histoMaxVariableDR_C3d_params.threshold_histo_multicluster)
Definition: clustering3d.py:62
def create_histoThreshold(process, inputs, threshold=histoThreshold_C3d_params.threshold_histo_multicluster, distance=histoThreshold_C3d_params.dR_multicluster, nBins_R=histoThreshold_C3d_params.nBins_R_histo_multicluster, nBins_Phi=histoThreshold_C3d_params.nBins_Phi_histo_multicluster, binSumsHisto=histoThreshold_C3d_params.binSumsHisto)
def create_distance(process, inputs, distance=distance_C3d_params.dR_multicluster)
Definition: clustering3d.py:17
def create_histoInterpolatedMax2ndOrder(process, inputs, distance=histoInterpolatedMax_C3d_params.dR_multicluster, nBins_R=histoInterpolatedMax_C3d_params.nBins_R_histo_multicluster, nBins_Phi=histoInterpolatedMax_C3d_params.nBins_Phi_histo_multicluster, binSumsHisto=histoInterpolatedMax_C3d_params.binSumsHisto, seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster)
Definition: clustering3d.py:96