diff --git a/L1Trigger/L1THGCal/interface/backend/HGCalHistoSeedingImpl.h b/L1Trigger/L1THGCal/interface/backend/HGCalHistoSeedingImpl.h index 03519dc76dad6..b39795420ad64 100644 --- a/L1Trigger/L1THGCal/interface/backend/HGCalHistoSeedingImpl.h +++ b/L1Trigger/L1THGCal/interface/backend/HGCalHistoSeedingImpl.h @@ -156,6 +156,9 @@ class HGCalHistoSeedingImpl { std::vector neighbour_weights_; std::vector smoothing_ecal_; std::vector smoothing_hcal_; + bool seeds_norm_by_area_; + + float area_10pct_; HGCalTriggerTools triggerTools_; Navigator navigator_; diff --git a/L1Trigger/L1THGCal/python/customHistoSeeding.py b/L1Trigger/L1THGCal/python/customHistoSeeding.py index 04f3b1924c3ad..90583a5c6caae 100644 --- a/L1Trigger/L1THGCal/python/customHistoSeeding.py +++ b/L1Trigger/L1THGCal/python/customHistoSeeding.py @@ -102,3 +102,9 @@ def custom_3dclustering_XYHistoMax(process, process.hgcalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = parameters_c3d return process +def custom_3dclustering_seedNoArea(process, + seed_threshold=cms.double(20)): + parameters_c3d = histoMax_C3d_seeding_params.clone(seeds_norm_by_area = False, + threshold_histo_multicluster = seed_threshold) + process.hgcalBackEndLayer2Producer.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = parameters_c3d + return process diff --git a/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py b/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py index b940dd36920c3..82e3a9f24ce3c 100644 --- a/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py @@ -87,6 +87,7 @@ seeding_space=cms.string("RPhi"),# RPhi, XY seed_smoothing_ecal=seed_smoothing_ecal, seed_smoothing_hcal=seed_smoothing_hcal, + seeds_norm_by_area=cms.bool(True) ) histoMax_C3d_clustering_params = cms.PSet(dR_multicluster=cms.double(0.03), diff --git a/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc b/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc index 2353c592070be..558ec2ee58dc7 100644 --- a/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc +++ b/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc @@ -13,6 +13,7 @@ HGCalHistoSeedingImpl::HGCalHistoSeedingImpl(const edm::ParameterSet& conf) neighbour_weights_(conf.getParameter>("neighbour_weights")), smoothing_ecal_(conf.getParameter>("seed_smoothing_ecal")), smoothing_hcal_(conf.getParameter>("seed_smoothing_hcal")), + seeds_norm_by_area_(conf.getParameter("seeds_norm_by_area")), kROverZMin_(conf.getParameter("kROverZMin")), kROverZMax_(conf.getParameter("kROverZMax")) { if (seedingAlgoType_ == "HistoMaxC3d") { @@ -64,6 +65,13 @@ HGCalHistoSeedingImpl::HGCalHistoSeedingImpl(const edm::ParameterSet& conf) << "Inconsistent size of neighbour weights vector in HGCalMulticlustering ( " << neighbour_weights_.size() << " ). Should be " << neighbour_weights_size_ << "\n"; } + + // compute quantities for non-normalised-by-area histoMax + // 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( @@ -166,16 +174,21 @@ HGCalHistoSeedingImpl::Histogram HGCalHistoSeedingImpl::fillSmoothPhiHistoCluste for (int z_side : {-1, 1}) { for (unsigned bin1 = 0; bin1 < nBins1_; bin1++) { int nBinsSide = (binSums[bin1] - 1) / 2; - float R1 = kROverZMin_ + bin1 * (kROverZMax_ - kROverZMin_) / nBins1_; - float R2 = R1 + ((kROverZMax_ - kROverZMin_) / nBins1_); double area = - ((M_PI * (pow(R2, 2) - pow(R1, 2))) / nBins2_) * (1 + 2.0 * (1 - pow(0.5, nBinsSide))); // Takes into account different area of bins in different R-rings + sum of quadratic weights used + if (seeds_norm_by_area_) { + float R1 = kROverZMin_ + bin1 * (kROverZMax_ - kROverZMin_) / nBins1_; + float R2 = R1 + ((kROverZMax_ - kROverZMin_) / nBins1_); + area = area * ((M_PI * (pow(R2, 2) - pow(R1, 2))) / nBins2_); + } else { + area = area * area_10pct_; + } + for (unsigned bin2 = 0; bin2 < nBins2_; bin2++) { const auto& bin_orig = histoClusters.at(z_side, bin1, bin2); float content = bin_orig.values[Bin::Content::Sum];