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

Add Mother Indices to LHEPart #47075

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pianonick411
Copy link

PR description:

The indices of a particle's mother are not currently stored in the LHEPart collection.
This PR would add two lists of indices to the LHEPart collection:

  • LHEPart_firstMotherIdx: The index of an LHE particle's first mother in the LHEPart collection.
  • LHEPart_lastMotherIdx: The index of an LHE particle's last mother in the LHEPart collection.

The ability to track an LHE particle's ancestry is necessary for performing matrix-element calculations as done in HIG-19-009 and HIG-21-013 for the purposes of reweighting. Future Higgs property measurements in H -> 4l and other channels will require this additional information.

I have discussed the code of this PR with the following members of the HZZ group: Nicola Amapane (@namapane), and Jeffrey Davis (@jdavis36).

PR validation:

The code was tested on a sample of ZH, (H -->ZZ-->4l) events from /ZHto2Zto4L_M125_TuneCP5_13p6TeV_powheg2-minlo-HZJ-JHUGenV752-pythia8/Run3Summer22MiniAODv4-130X_mcRun3_2022_realistic_v5-v2/MINIAODSIM in CMSSW_13_3_3.

A ZH sample was chosen so that the LHE history was sufficiently complex.

It was verified that the indices stored in the output nanoAOD file correspond to the same particle in the input miniAOD.

According to the size report, each of the 2 new variables adds 0.1 b/item; in this sample there are in average 14 items/evt, so the total size increase is be 2.8  b/evt, which is a very small addition.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 9, 2025

cms-bot internal usage

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 9, 2025

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47075/43246

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

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 9, 2025

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

It involves the following packages:

  • PhysicsTools/NanoAOD (xpog)

@cmsbuild, @ftorrresd, @hqucms can you please review it and eventually sign? Thanks.
@AnnikaStein, @gpetruc this is something you requested to watch as well.
@antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@hqucms
Copy link
Contributor

hqucms commented Jan 10, 2025

enable nano

@@ -66,11 +66,21 @@ class LHETablesProducer : public edm::global::EDProducer<> {
std::vector<int> vals_pid;
std::vector<int> vals_status;
std::vector<int> vals_spin;
std::vector<Short_t> vals_firstMotherIdx;
std::vector<Short_t> vals_lastMotherIdx;
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to use int16_t instead of Short_t to be more explicit about the type.

Copy link
Contributor

@namapane namapane Jan 10, 2025

Choose a reason for hiding this comment

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

Hi @hqucms, I agree that int16_t is more explicit; actually Short_t comes from the fact that all *Idx varabiles are reported as Short_t in the autoDoc.
But I suppose that autoDoc reports variables as Short_t even if they are defined as int16_t in the code.

outPart->addColumn<Short_t>(
"firstMotherIdx", vals_firstMotherIdx, "Index of this particle's first mother in the LHEPart collection");
outPart->addColumn<Short_t>(
"lastMotherIdx", vals_lastMotherIdx, "Index of this particle's last mother in the LHEPart collection");
Copy link
Contributor

Choose a reason for hiding this comment

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

Also here -- better to use int16_t instead of Short_t.

@hqucms
Copy link
Contributor

hqucms commented Jan 10, 2025

please test

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 40KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-3543fc/43716/summary.html
COMMIT: 4059332
CMSSW: CMSSW_15_0_X_2025-01-09-2300/el8_amd64_gcc12
Additional Tests: NANO
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/47075/43716/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 10 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3818780
  • DQMHistoTests: Total failures: 20
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3818740
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 214 log files, 184 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

NANO Comparison Summary

Summary:

  • You potentially removed 611 lines from the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 21
  • DQMHistoTests: Total histograms compared: 74951
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 74951
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 20 files compared)
  • Checked 105 log files, 60 edm output root files, 21 DQM output files
  • TriggerResults: no differences found

Nano size comparison Summary:

Sample kb/ev ref kb/ev diff kb/ev ev/s/thd ref ev/s/thd diff rate mem/thd ref mem/thd
2500.001 3.080 3.077 0.002 ( +0.1% ) 6.34 6.40 -0.9% 2.544 2.564
2500.002 3.196 3.193 0.003 ( +0.1% ) 5.59 5.74 -2.5% 2.970 2.980
2500.003 3.136 3.133 0.002 ( +0.1% ) 5.94 5.94 -0.1% 2.958 2.961
2500.011 1.644 1.644 0.000 ( +0.0% ) 10.00 10.26 -2.5% 2.633 2.628
2500.012 2.184 2.184 0.000 ( +0.0% ) 5.91 5.97 -1.0% 2.823 2.816
2500.013 2.000 2.000 0.000 ( +0.0% ) 8.24 8.38 -1.7% 2.725 2.726
2500.021 0.022 0.022 0.000 ( +0.0% ) 2.03 2.05 -1.1% 2.610 2.609
2500.022 0.022 0.022 0.000 ( +0.0% ) 1.95 1.99 -1.9% 2.604 2.607
2500.023 0.022 0.022 0.000 ( +0.0% ) 1.87 1.89 -1.2% 2.465 2.468
2500.024 0.022 0.022 0.000 ( +0.0% ) 1.54 1.57 -1.9% 2.704 2.694
2500.031 0.035 0.035 0.000 ( +0.0% ) 1.76 1.80 -1.9% 2.655 2.650
2500.032 0.036 0.036 0.000 ( +0.0% ) 1.79 1.82 -1.7% 2.629 2.619
2500.033 0.037 0.037 0.000 ( +0.0% ) 1.67 1.72 -2.9% 2.703 2.705
2500.034 0.036 0.036 0.000 ( +0.0% ) 1.70 1.71 -0.7% 2.685 2.686
2500.101 2.806 2.803 0.003 ( +0.1% ) 16.18 16.69 -3.1% 2.625 2.639
2500.111 1.463 1.463 0.000 ( +0.0% ) 30.71 32.34 -5.1% 2.327 2.334
2500.112 1.883 1.883 0.000 ( +0.0% ) 24.91 26.53 -6.1% 2.405 2.398
2500.131 0.750 0.750 0.000 ( +0.0% ) 36.88 37.93 -2.8% 1.502 1.510
2500.201 2.638 2.638 0.000 ( +0.0% ) 13.68 14.00 -2.3% 2.206 2.208
2500.211 1.806 1.806 0.000 ( +0.0% ) 26.61 27.57 -3.5% 2.401 2.403
2500.212 2.203 2.203 0.000 ( +0.0% ) 21.60 22.95 -5.9% 2.488 2.485
2500.221 2.038 2.038 0.000 ( +0.0% ) 14.06 14.70 -4.3% 2.119 2.121
2500.222 3.441 3.441 0.000 ( +0.0% ) 12.82 13.39 -4.3% 2.216 2.220
2500.223 9.407 9.407 0.000 ( +0.0% ) 4.14 4.27 -3.1% 2.291 2.293
2500.224 6.266 6.266 0.000 ( +0.0% ) 1.39 1.41 -1.6% 2.237 2.235
2500.225 6.313 6.313 0.000 ( +0.0% ) 1.29 1.31 -1.6% 2.439 2.446
2500.226 3.135 3.135 0.000 ( +0.0% ) 13.26 13.98 -5.2% 2.210 2.214
2500.227 1.442 1.442 0.000 ( +0.0% ) 23.68 24.29 -2.5% 1.456 1.452
2500.228 3.921 3.921 0.000 ( +0.0% ) 9.12 9.19 -0.8% 2.247 2.306
2500.231 1.456 1.456 0.000 ( +0.0% ) 22.28 23.58 -5.5% 2.286 2.289
2500.232 2.462 2.462 0.000 ( +0.0% ) 20.96 21.72 -3.5% 2.113 2.400
2500.233 4.954 4.954 0.000 ( +0.0% ) 6.12 6.29 -2.8% 2.191 2.472
2500.234 3.842 3.842 0.000 ( +0.0% ) 1.77 1.80 -1.5% 2.138 2.180
2500.235 3.873 3.873 0.000 ( +0.0% ) 1.67 1.70 -1.5% 2.375 2.371
2500.236 2.252 2.252 0.000 ( +0.0% ) 21.84 22.80 -4.2% 2.390 2.388
2500.237 1.018 1.018 0.000 ( +0.0% ) 35.03 35.10 -0.2% 1.433 1.455
2500.238 2.444 2.444 0.000 ( +0.0% ) 17.43 17.46 -0.2% 2.469 2.470
2500.241 9.404 9.404 0.000 ( +0.0% ) 7.49 7.48 +0.1% 1.933 1.936
2500.242 10.331 10.331 0.000 ( +0.0% ) 1.66 1.69 -2.0% 1.729 1.731
2500.243 2.712 2.712 0.000 ( +0.0% ) 16.06 16.10 -0.3% 1.065 1.062
2500.244 486.016 486.016 0.000 ( +0.0% ) 1.15 1.16 -0.8% 1.693 1.678
2500.245 826.413 826.413 0.000 ( +0.0% ) 1.55 1.54 +0.3% 1.462 1.673
2500.901 1.781 1.778 0.003 ( +0.2% ) 47.59 48.61 -2.1% 1.443 1.448
2500.902 1.628 1.628 0.000 ( +0.0% ) 47.67 48.56 -1.8% 1.339 1.338
2500.911 14.041 14.041 0.000 ( +0.0% ) 8.47 9.13 -7.3% 1.089 1.089
2500.912 0.310 0.199 0.111 ( +55.6% ) 3.04 2.62 +16.0% 0.851 0.849
2500.913 0.110 0.110 0.000 ( +0.0% ) 2.59 2.66 -2.9% 0.853 0.854

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47075/43266

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

@cmsbuild
Copy link
Contributor

Pull request #47075 was updated. @cmsbuild, @ftorrresd, @hqucms can you please check and sign again.

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.

4 participants