Skip to content

Commit

Permalink
JB's comments to the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
echapon committed Jul 20, 2021
1 parent 7b75999 commit 1bf0432
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 34 deletions.
3 changes: 0 additions & 3 deletions L1Trigger/L1THGCal/interface/backend/HGCalHistoSeedingImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ class HGCalHistoSeedingImpl {
std::vector<double> smoothing_hcal_;
bool seeds_norm_by_area_;

int bin1_10pct_;
float R1_10pct_;
float R2_10pct_;
float area_10pct_;

HGCalTriggerTools triggerTools_;
Expand Down
46 changes: 20 additions & 26 deletions L1Trigger/L1THGCal/python/customHistoSeeding.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,34 @@ 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,
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,
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

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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
)


Expand Down
9 changes: 5 additions & 4 deletions L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1bf0432

Please sign in to comment.