Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HGCAL trigger] Fix percentile out of bound #28570

Merged
merged 1 commit into from
Dec 10, 2019

Conversation

jbsauvan
Copy link
Contributor

@jbsauvan jbsauvan commented Dec 6, 2019

PR description:

Fix out of bound in layer percentile interpolation. See issue #28566.

PR validation:

Ran on HGCAL V9 sample.
Tested extreme case where no trigger cell are selected in the computation, which gives 0 energy in all the layers.

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 6, 2019

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 6, 2019

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28570/13062

  • This PR adds an extra 16KB to repository

  • There are other open Pull requests which might conflict with changes you have proposed:

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 6, 2019

A new Pull Request was created by @jbsauvan (Jean-Baptiste Sauvan) for master.

It involves the following packages:

L1Trigger/L1THGCal

@cmsbuild, @rekovic, @benkrikler, @kpedro88 can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @amarini, @lgray this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@kpedro88
Copy link
Contributor

kpedro88 commented Dec 6, 2019

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 6, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/3849/console Started: 2019/12/06 16:51

@@ -133,7 +133,7 @@ float HGCalShowerShape::percentileLayer(const l1t::HGCalMulticluster& c3d,
}
// Linear interpolation of percentile value
double pt0 = (percentile > 0 ? layers[percentile - 1] : 0.);
double pt1 = layers[percentile];
double pt1 = (percentile < layers.size() ? layers[percentile] : layers.back());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can layers.size() == 0? If so then calling layers.back() in that case reads off the end (and may cause a segmentation fault since it is likely to be reading memory location 0).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The size of layers is given by the number of HGCAL layers :

unsigned nlayers = triggerTools_.layers(ForwardSubdetector::ForwardEmpty);
std::vector<double> layers(nlayers, 0);

where the trigger tools returns this:
case ForwardSubdetector::ForwardEmpty:
layers = totalLayers_;

Which is computed from the HGCAL geometry:
eeLayers_ = geom_->eeTopology().dddConstants().layers(true);
fhLayers_ = geom_->fhTopology().dddConstants().layers(true);
if (geom_->isV9Geometry()) {
bhLayers_ = geom_->hscTopology().dddConstants().layers(true);
totalLayers_ = eeLayers_ + fhLayers_;
} else {
bhLayers_ = geom_->bhTopology().dddConstants()->getMaxDepth(1);
totalLayers_ = eeLayers_ + fhLayers_ + bhLayers_;
}
}

So unless something really bad happens it shouldn't be 0

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 6, 2019

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 6, 2019

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 6, 2019

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1650e4/3849/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 34
  • DQMHistoTests: Total histograms compared: 2800084
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2799742
  • DQMHistoTests: Total skipped: 341
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 33 files compared)
  • Checked 147 log files, 16 edm output root files, 34 DQM output files

@fabiocos
Copy link
Contributor

fabiocos commented Dec 9, 2019

@kpedro88 @rekovic please have a look, this looks a technical fix which should be ok (unless there is a serious inconsistency in the geometry definition).

@kpedro88
Copy link
Contributor

kpedro88 commented Dec 9, 2019

+upgrade

@fabiocos
Copy link
Contributor

+1

@rekovic please have a look

@fabiocos
Copy link
Contributor

merge

@cmsbuild cmsbuild merged commit 120d83e into cms-sw:master Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants