Skip to content

HGCal validation histograms refactor - #51565

Open
fdoljanin wants to merge 2 commits into
cms-sw:masterfrom
fdoljanin:2D_hgcal_histograms
Open

HGCal validation histograms refactor#51565
fdoljanin wants to merge 2 commits into
cms-sw:masterfrom
fdoljanin:2D_hgcal_histograms

Conversation

@fdoljanin

@fdoljanin fdoljanin commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This PR simplifies the HGCal trackster validation code. Histogram booking and filling are now defined in one place using HistogramBuilder instead of using many separate vectors and repeated blocks of code.

It keeps the existing 1D plots.

PR validation:

  • Successfully compiled with scram b in CMSSW_20_1_0_pre1.
  • Successfully generated workflow 34554.0 with ExtendedRun4D121.

Backport:

Not a backport; no backport is currently planned.

@cmsbuild

cmsbuild commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@cmsbuild

Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51565/50324

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@felicepantaleo

felicepantaleo commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

can you point me to a link to a generated plot folder?

@fdoljanin

Copy link
Copy Markdown
Contributor Author

can you point me to a link to a generated plot folder?

https://fdoljani.web.cern.ch/2D/offline/offline_ticlTrackstersCLUE3DHigh/Efficiencies_byLCs/ here are some examples

@cmsbuild

Copy link
Copy Markdown
Contributor

Pull request #51565 was updated.

name=cms.untracked.string(f"purity_{variable}_{association_suffix}"),
title=cms.untracked.string(f"Trackster Purity vs {variable_title}"),
numerator=cms.untracked.string(f"Num_{association}_{histogram_variable}"),
denominator=cms.untracked.string(f"Denom_{association}_{histogram_variable}"),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I kept this "complicated" way of resolving ratio histograms to keep backwards compatibility, just rewrote it a bit but contract with step3 is the same as before.

@fdoljanin
fdoljanin marked this pull request as ready for review July 27, 2026 11:06
@cmsbuild

Copy link
Copy Markdown
Contributor

A new Pull Request was created by @fdoljanin for master.

It involves the following packages:

  • Validation/HGCalValidation (dqm)

@cmsbuild, @ctarricone, @gabrielmscampos, @rseidita can you please review it and eventually sign? Thanks.
@apsallid, @bsunanda, @cseez, @denizsun, @hatakeyamak, @lecriste, @lgray, @pfs, @rovere, @salimcerci, @sethzenz, @vandreev11 this is something you requested to watch as well.
@ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@felicepantaleo

Copy link
Copy Markdown
Contributor

assign hgcal-dpg

@cmsbuild

Copy link
Copy Markdown
Contributor

New categories assigned: hgcal-dpg

@cseez,@felicepantaleo,@pfs,@rovere you have been requested to review this Pull request/Issue and eventually sign? Thanks

@fdoljanin

Copy link
Copy Markdown
Contributor Author

type ngt

@cmsbuild cmsbuild added the ngt label Jul 27, 2026
@felicepantaleo

Copy link
Copy Markdown
Contributor

aren't you mixing in the same PR, 2D histograms and architectural changes?

@fdoljanin

Copy link
Copy Markdown
Contributor Author

aren't you mixing in the same PR, 2D histograms and architectural changes?

I had to make architectural changes in order to have efficient 2D handling - otherwise number of HGVHistoProducerAlgo would scale as number_of_metrics * number_of_variable_combos.

If you want, I can split them in 2 PRs - keep architecture here and move 2D plots to another!

@felicepantaleo

Copy link
Copy Markdown
Contributor

if it is not too much trouble, split it in two, because I fear the architectural change is introducing some thread-safety issue.

@cmsbuild

cmsbuild commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Pull request #51565 was updated. @cmsbuild, @cseez, @ctarricone, @felicepantaleo, @gabrielmscampos, @pfs, @rovere, @rseidita can you please check and sign again.

@mmusich

mmusich commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Can the amount of commits be squashed to a minimum, to remove the various "fix" and "format" ?

@fdoljanin

Copy link
Copy Markdown
Contributor Author

Can the amount of commits be squashed to a minimum, to remove the various "fix" and "format" ?

Done. Just out of curiosity, is there a reason we rewrite the branch history instead of using GitHub’s “Squash and merge” option when merging the PR?

@cmsbuild

cmsbuild commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@cmsbuild

cmsbuild commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Pull request #51565 was updated. @cmsbuild, @cseez, @ctarricone, @felicepantaleo, @gabrielmscampos, @pfs, @rovere, @rseidita can you please check and sign again.

@mmusich

mmusich commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@cmsbuild, please test

@cmsbuild

cmsbuild commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 56KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-9eda24/55141/summary.html
COMMIT: e1e4f52
CMSSW: CMSSW_20_1_X_2026-08-06-1200/el9_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51565/55141/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 1 lines from the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 1 differences found in the comparisons
  • DQMHistoTests: Total files compared: 45
  • DQMHistoTests: Total histograms compared: 3589140
  • DQMHistoTests: Total failures: 648
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3588474
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 44 files compared)
  • Checked 195 log files, 163 edm output root files, 45 DQM output files
  • TriggerResults: found differences in 1 / 44 workflows

@gabrielmscampos

Copy link
Copy Markdown
Member

+dqm

@cmsbuild

cmsbuild commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51565/50872

ERROR: Build errors found during clang-tidy run.

 2989 |     const SimClusterToCaloParticleMap& scToCpMap) const {
      |           ^
Suppressed 1227 warnings (1223 in non-user code, 4 NOLINT).
--
src/Validation/HGCalValidation/interface/HGVHistoProducerAlgo.h:220:7: error: no template named 'AssociationMap' in namespace 'ticl'; did you mean 'edm::AssociationMap'? [clang-diagnostic-error]
  220 |       ticl::AssociationMap<ticl::oneToOneMapWithFraction, std::vector<SimCluster>, std::vector<CaloParticle>>;
      |       ^~~~~~~~~~~~~~~~~~~~
      |       edm::AssociationMap
--
src/Validation/HGCalValidation/interface/HGVHistoProducerAlgo.h:220:13: error: too many template arguments for class template 'AssociationMap' [clang-diagnostic-error]
  220 |       ticl::AssociationMap<ticl::oneToOneMapWithFraction, std::vector<SimCluster>, std::vector<CaloParticle>>;
      |             ^                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02958/el9_amd64_gcc14/cms/cmssw-patch/CMSSW_20_1_X_2026-09-08-2300/src/DataFormats/Common/interface/AssociationMap.h:48:9: note: template is declared here
--
src/Validation/HGCalValidation/interface/HGVHistoProducerAlgo.h:293:45: error: unknown type name 'SimClusterToCaloParticleMap' [clang-diagnostic-error]
  293 |                                       const SimClusterToCaloParticleMap& scToCpMap,
      |                                             ^
src/Validation/HGCalValidation/interface/HGVHistoProducerAlgo.h:365:36: error: unknown type name 'SimClusterToCaloParticleMap' [clang-diagnostic-error]
  365 |                              const SimClusterToCaloParticleMap& scToCpMap) const;
      |                                    ^
Suppressed 1582 warnings (1578 in non-user code, 4 NOLINT).
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

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.

5 participants