From 1bf04322b726a02cd55cbea8a247c428d3ea6f56 Mon Sep 17 00:00:00 2001 From: Emilien Chapon Date: Mon, 19 Jul 2021 16:22:47 +0200 Subject: [PATCH] JB's comments to the PR --- .../interface/backend/HGCalHistoSeedingImpl.h | 3 -- .../L1THGCal/python/customHistoSeeding.py | 46 ++++++++----------- .../python/hgcalBackEndLayer2Producer_cfi.py | 2 +- .../src/backend/HGCalHistoSeedingImpl.cc | 9 ++-- 4 files changed, 26 insertions(+), 34 deletions(-) diff --git a/L1Trigger/L1THGCal/interface/backend/HGCalHistoSeedingImpl.h b/L1Trigger/L1THGCal/interface/backend/HGCalHistoSeedingImpl.h index 91d06cbcc1c7a..b39795420ad64 100644 --- a/L1Trigger/L1THGCal/interface/backend/HGCalHistoSeedingImpl.h +++ b/L1Trigger/L1THGCal/interface/backend/HGCalHistoSeedingImpl.h @@ -158,9 +158,6 @@ class HGCalHistoSeedingImpl { std::vector smoothing_hcal_; bool seeds_norm_by_area_; - int bin1_10pct_; - float R1_10pct_; - float R2_10pct_; float area_10pct_; HGCalTriggerTools triggerTools_; diff --git a/L1Trigger/L1THGCal/python/customHistoSeeding.py b/L1Trigger/L1THGCal/python/customHistoSeeding.py index fd762c4431a30..fc3515a5c88e6 100644 --- a/L1Trigger/L1THGCal/python/customHistoSeeding.py +++ b/L1Trigger/L1THGCal/python/customHistoSeeding.py @@ -13,14 +13,12 @@ def set_histomax_seeding_params(parameters_seeding_c3d, nBins_X1, nBins_X2, binSumsHisto, - seed_threshold, - seeds_norm_by_area + seed_threshold ): parameters_seeding_c3d.nBins_X1_histo_multicluster = nBins_X1 parameters_seeding_c3d.nBins_X2_histo_multicluster = nBins_X2 parameters_seeding_c3d.binSumsHisto = binSumsHisto parameters_seeding_c3d.threshold_histo_multicluster = seed_threshold - parameters_seeding_c3d.seeds_norm_by_area = seeds_norm_by_area def custom_3dclustering_histoMax(process, @@ -28,12 +26,10 @@ def custom_3dclustering_histoMax(process, 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, - seed_position=histoMax_C3d_seeding_params.seed_position, - norm_by_area=histoMax_C3d_seeding_params.seeds_norm_by_area + seed_position=histoMax_C3d_seeding_params.seed_position ): parameters_c3d = histoMax_C3d_seeding_params.clone() - set_histomax_seeding_params(parameters_c3d, nBins_X1, nBins_X2, binSumsHisto, - seed_threshold, norm_by_area) + set_histomax_seeding_params(parameters_c3d, nBins_X1, nBins_X2, binSumsHisto, seed_threshold) process.hgcalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = parameters_c3d return process @@ -41,12 +37,10 @@ def custom_3dclustering_histoSecondaryMax(process, threshold=histoSecondaryMax_C3d_params.threshold_histo_multicluster, nBins_X1=histoSecondaryMax_C3d_params.nBins_X1_histo_multicluster, nBins_X2=histoSecondaryMax_C3d_params.nBins_X2_histo_multicluster, - binSumsHisto=histoSecondaryMax_C3d_params.binSumsHisto, - norm_by_area=histoSecondaryMax_C3d_params.seeds_norm_by_area + binSumsHisto=histoSecondaryMax_C3d_params.binSumsHisto ): parameters_c3d = histoSecondaryMax_C3d_params.clone() - set_histomax_seeding_params(parameters_c3d, nBins_X1, nBins_X2, binSumsHisto, - threshold, norm_by_area) + set_histomax_seeding_params(parameters_c3d, nBins_X1, nBins_X2, binSumsHisto, threshold) process.hgcalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = parameters_c3d return process @@ -55,14 +49,13 @@ def custom_3dclustering_histoInterpolatedMax1stOrder(process, 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, - norm_by_area=histoInterpolatedMax_C3d_params.seeds_norm_by_area + seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster ): parameters_c3d = histoInterpolatedMax_C3d_params.clone( neighbour_weights = neighbour_weights_1stOrder ) set_histomax_seeding_params(parameters_c3d, nBins_X1, nBins_X2, binSumsHisto, - seed_threshold, norm_by_area) + seed_threshold) process.hgcalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = parameters_c3d return process @@ -71,14 +64,12 @@ def custom_3dclustering_histoInterpolatedMax2ndOrder(process, 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, - norm_by_area=histoInterpolatedMax_C3d_params.seeds_norm_by_area + seed_threshold=histoInterpolatedMax_C3d_params.threshold_histo_multicluster ): parameters_c3d = histoInterpolatedMax_C3d_params.clone( neighbour_weights = neighbour_weights_2ndOrder ) - set_histomax_seeding_params(parameters_c3d, nBins_X1, nBins_X2, binSumsHisto, - seed_threshold, norm_by_area) + set_histomax_seeding_params(parameters_c3d, nBins_X1, nBins_X2, binSumsHisto, seed_threshold) process.hgcalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = parameters_c3d return process @@ -87,12 +78,9 @@ def custom_3dclustering_histoThreshold(process, nBins_X1=histoThreshold_C3d_params.nBins_X1_histo_multicluster, nBins_X2=histoThreshold_C3d_params.nBins_X2_histo_multicluster, binSumsHisto=histoThreshold_C3d_params.binSumsHisto, - seed_threshold=histoThreshold_C3d_params.threshold_histo_multicluster, - norm_by_area=histoThreshold_C3d_params.seeds_norm_by_area - ): + seed_threshold=histoThreshold_C3d_params.threshold_histo_multicluster): parameters_c3d = histoThreshold_C3d_params.clone() - set_histomax_seeding_params(parameters_c3d, nBins_X1, nBins_X2, binSumsHisto, - seed_threshold, norm_by_area) + set_histomax_seeding_params(parameters_c3d, nBins_X1, nBins_X2, binSumsHisto, seed_threshold) process.hgcalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = parameters_c3d return process @@ -101,12 +89,18 @@ def custom_3dclustering_XYHistoMax(process, 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, - seed_position=histoMaxXYVariableDR_C3d_params.seed_position, - norm_by_area=histoThreshold_C3d_params.seeds_norm_by_area + seed_position=histoMaxXYVariableDR_C3d_params.seed_position ): parameters_c3d = histoMaxXYVariableDR_C3d_params.clone() set_histomax_seeding_params(parameters_c3d, nBins_X1, nBins_X2, - histoMaxXYVariableDR_C3d_params.binSumsHisto,seed_threshold, norm_by_area) + histoMaxXYVariableDR_C3d_params.binSumsHisto,seed_threshold) process.hgcalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = parameters_c3d return process +def custom_3dclustering_seedNoArea(process, + seeds_norm_by_area=cms.bool(False), + seed_threshold=cms.double(20)): + parameters_c3d = histoMax_C3d_seeding_params.clone() + parameters_c3d.seeds_norm_by_area = seeds_norm_by_area + parameters_c3d.threshold_histo_multicluster = seed_threshold + process.hgcalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = parameters_c3d diff --git a/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py b/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py index b97cdf18fa655..82e3a9f24ce3c 100644 --- a/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py @@ -106,7 +106,7 @@ # (see https://indico.cern.ch/event/806845/contributions/3359859/attachments/1815187/2966402/19-03-20_EGPerf_HGCBE.pdf # for more details) phase2_hgcalV10.toModify(histoMax_C3d_seeding_params, - threshold_histo_multicluster=20, # arb. units (for seeds_norm_by_area=False) + threshold_histo_multicluster=8.5, # MipT ) diff --git a/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc b/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc index 4b1b9fa77b5a2..65d5257e9c403 100644 --- a/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc +++ b/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc @@ -67,10 +67,11 @@ HGCalHistoSeedingImpl::HGCalHistoSeedingImpl(const edm::ParameterSet& conf) } // compute quantities for non-normalised-by-area histoMax - bin1_10pct_ = (int) 0.1*nBins1_; - R1_10pct_ = kROverZMin_ + bin1_10pct_ * (kROverZMax_ - kROverZMin_) / nBins1_; - R2_10pct_ = R1_10pct_ + ((kROverZMax_ - kROverZMin_) / nBins1_); - area_10pct_ = ((M_PI * (pow(R2_10pct_, 2) - pow(R1_10pct_, 2))) / nBins2_); + // The 0.1 factor in bin1_10pct is an attempt to keep the same rough scale for seeds. The exact value is arbitrary. + int bin1_10pct = (int) 0.1*nBins1_; + float R1_10pct = kROverZMin_ + bin1_10pct * (kROverZMax_ - kROverZMin_) / nBins1_; + float R2_10pct = R1_10pct + ((kROverZMax_ - kROverZMin_) / nBins1_); + area_10pct_ = ((M_PI * (pow(R2_10pct, 2) - pow(R1_10pct, 2))) / nBins2_); } HGCalHistoSeedingImpl::Histogram HGCalHistoSeedingImpl::fillHistoClusters(