diff --git a/L1Trigger/L1THGCal/python/customCalibration.py b/L1Trigger/L1THGCal/python/customCalibration.py new file mode 100644 index 0000000000000..5a80d330e5851 --- /dev/null +++ b/L1Trigger/L1THGCal/python/customCalibration.py @@ -0,0 +1,20 @@ +import FWCore.ParameterSet.Config as cms +import hgcalLayersCalibrationCoefficients_cfi as layercalibparam + + +def custom_cluster_calibration_global(process, + factor=1.084 + ): + parameters_c2d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C2d_parameters + parameters_c2d.calibSF_cluster = cms.double(factor) + parameters_c2d.applyLayerCalibration = cms.bool(False) + return process + + +def custom_cluster_calibration_layers(process, + weights=layercalibparam.TrgLayer_weights + ): + parameters_c2d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C2d_parameters + parameters_c2d.layerWeights = weights + parameters_c2d.applyLayerCalibration = cms.bool(True) + return process diff --git a/L1Trigger/L1THGCal/python/customClustering.py b/L1Trigger/L1THGCal/python/customClustering.py new file mode 100644 index 0000000000000..1536cbc285581 --- /dev/null +++ b/L1Trigger/L1THGCal/python/customClustering.py @@ -0,0 +1,61 @@ +import FWCore.ParameterSet.Config as cms + + +def custom_2dclustering_distance(process, + distance=6.,# cm + seed_threshold=5.,# MipT + cluster_threshold=2.# MipT + ): + parameters_c2d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C2d_parameters + parameters_c2d.seeding_threshold_silicon = cms.double(seed_threshold) + parameters_c2d.seeding_threshold_scintillator = cms.double(seed_threshold) + parameters_c2d.clustering_threshold_silicon = cms.double(cluster_threshold) + parameters_c2d.clustering_threshold_scintillator = cms.double(cluster_threshold) + parameters_c2d.dR_cluster = cms.double(distance) + parameters_c2d.clusterType = cms.string('dRC2d') + return process + +def custom_2dclustering_topological(process, + seed_threshold=5.,# MipT + cluster_threshold=2.# MipT + ): + parameters_c2d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C2d_parameters + parameters_c2d.seeding_threshold_silicon = cms.double(seed_threshold) # MipT + parameters_c2d.seeding_threshold_scintillator = cms.double(seed_threshold) # MipT + parameters_c2d.clustering_threshold_silicon = cms.double(cluster_threshold) # MipT + parameters_c2d.clustering_threshold_scintillator = cms.double(cluster_threshold) # MipT + parameters_c2d.clusterType = cms.string('NNC2d') + return process + +def custom_2dclustering_constrainedtopological(process, + distance=6.,# cm + seed_threshold=5.,# MipT + cluster_threshold=2.# MipT + ): + parameters_c2d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C2d_parameters + parameters_c2d.seeding_threshold_silicon = cms.double(seed_threshold) # MipT + parameters_c2d.seeding_threshold_scintillator = cms.double(seed_threshold) # MipT + parameters_c2d.clustering_threshold_silicon = cms.double(cluster_threshold) # MipT + parameters_c2d.clustering_threshold_scintillator = cms.double(cluster_threshold) # MipT + parameters_c2d.dR_cluster = cms.double(distance) # cm + parameters_c2d.clusterType = cms.string('dRNNC2d') + return process + +def custom_3dclustering_distance(process, + distance=0.01 + ): + parameters_c3d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C3d_parameters + parameters_c3d.dR_multicluster = cms.double(distance) + parameters_c3d.type_multicluster = cms.string('dRC3d') + return process + + +def custom_3dclustering_dbscan(process, + distance=0.005, + min_points=3 + ): + parameters_c3d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C3d_parameters + parameters_c3d.dist_dbscan_multicluster = cms.double(distance) + parameters_c3d.minN_dbscan_multicluster = cms.uint32(min_points) + parameters_c3d.type_multicluster = cms.string('DBSCAN3d') + return process diff --git a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py index 54ac93a5a9ed0..603feb4bb513e 100644 --- a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py @@ -61,21 +61,22 @@ seeding_threshold_scintillator = cms.double(5), # MipT clustering_threshold_silicon = cms.double(2), # MipT clustering_threshold_scintillator = cms.double(2), # MipT - dR_cluster = cms.double(6.), # in cm - clusterType = cms.string('NNC2d'), # clustering type: dRC2d--> Geometric-dR clustering; NNC2d-->Nearest Neighbors clustering; dRNNC2d-->Limited Nearest Neighbors clustering -# clusterType = cms.string('dRC2d') # clustering type: dRC2d--> Geometric-dR clustering; NNC2d-->Nearest Neighbors clustering; dRNNC2d-->Limited Nearest Neighbors clustering -# clusterType = cms.string('dRNNC2d') # clustering type: dRC2d--> Geometric-dR clustering; NNC2d-->Nearest Neighbors clustering; dRNNC2d-->Limited Nearest Neighbors clustering - calibSF_cluster = cms.double(1.084), + clusterType = cms.string('NNC2d'), applyLayerCalibration = cms.bool(True), - layerWeights = layercalibparam.TrgLayer_weights + layerWeights = layercalibparam.TrgLayer_weights, + # Parameters not used by this clustering + dR_cluster=cms.double(0.), + calibSF_cluster=cms.double(0.) ) C3d_parValues = cms.PSet( dR_multicluster = cms.double(0.01), # dR in normalized plane used to clusterize C2d minPt_multicluster = cms.double(0.5), # minimum pt of the multicluster (GeV) - type_multicluster = cms.string('dRC3d'), #'DBSCANC3d' for the DBSCAN algorithm - dist_dbscan_multicluster = cms.double(0.005), - minN_dbscan_multicluster = cms.uint32(3) - ) + type_multicluster = cms.string('dRC3d'), + # Parameters not used by this clustering + dist_dbscan_multicluster=cms.double(0.), + minN_dbscan_multicluster=cms.uint32(0) +) + cluster_algo = cms.PSet( AlgorithmName = cms.string('HGCClusterAlgoThreshold'), FECodec = fe_codec.clone(), calib_parameters = calib_parValues.clone(),