cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.09k stars 4.32k forks source link

Add support for adding variable-size attributes (std::vector) within objects for NanoAOD #46702

Open patinkaew opened 1 week ago

patinkaew commented 1 week ago

PR description:

Add support for adding variable-size attributes (std::vector) within objects for NanoAOD. Presented at XPOG meeting on 13.11.2024. In addition, after the presentation, lazy evaluation functionality has been added.

Tested mainly in context of ScoutingNano, but this functionality is generic and can be useful for any custom NanoAOD. Hence, we decided to make this PR with only variable-size attributes support in NanoAOD. For usage in ScoutingNano, we will prepare another PR later after discussion with scouting group.

PR validation:

Tested with ScoutingNano (for ScoutingMuon and ScoutingElectron) with workflow 2500.227(RelValTTbar/2024/MINIAODSIM) and 2500.237 (ScoutingPFRun3/2024D/HLTSCOUT) as presented in the slide.

For lazy evaluation, test with workflow 2500.237 by setting ScoutingMuon's hitPattern variable with lazyEval=True. The output step2.root looks the same as output step2.root when setting lazyEval=False.

Pass all tests when running: scram b runtests use-ibeos

Pass    0s ... CommonTools/Utils/ExprEvalPopen_t
Pass   12s ... CommonTools/Utils/ExpressionEvaluatorUnitTest
Pass    7s ... CommonTools/Utils/testCommonToolsUtil
Pass    3s ... CommonTools/Utils/testCommonToolsUtilThreaded
Pass    0s ... CommonTools/Utils/testDynArray
Pass   17s ... CommonTools/Utils/testExpressionEvaluator
Pass   15s ... PhysicsTools/NanoAOD/testPhysicsToolsNanoAODTP
>> Test sequence completed for CMSSW CMSSW_14_2_0_pre3

When running runTheMatrix.py -l limited -i all --ibeos, some workflows failed due to file open errors. Tested 3 times and got the similar file open errors.

45 41 39 35 17 1 1 1 1 1 1 tests passed, 1 3 0 0 0 0 0 0 0 0 0 failed

Failed workflows are:

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

This is not a backport and there is no plan for a backport.

cmsbuild commented 1 week ago

cms-bot internal usage

cmsbuild commented 1 week ago

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46702/42652

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

cmsbuild commented 1 week ago

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46702/42655

cmsbuild commented 1 week ago

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

It involves the following packages:

@cmsbuild, @ftorrresd, @hqucms, @jfernan2, @mandrenguyen can you please review it and eventually sign? Thanks. @AnnikaStein, @gpetruc, @missirol 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

jfernan2 commented 6 days ago

please test

cmsbuild commented 6 days ago

+1

Size: This PR adds an extra 12KB to repository Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-2cde3c/42887/summary.html COMMIT: a71d8ca10d39c1ddbbdeb47414e1637d47ce4646 CMSSW: CMSSW_14_2_X_2024-11-15-1100/el8_amd64_gcc12 User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/46702/42887/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

jfernan2 commented 4 days ago

enable nano

jfernan2 commented 4 days ago

please test

cmsbuild commented 4 days ago

-1

Failed Tests: RelVals-INPUT Size: This PR adds an extra 12KB to repository Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-2cde3c/42918/summary.html COMMIT: a71d8ca10d39c1ddbbdeb47414e1637d47ce4646 CMSSW: CMSSW_14_2_X_2024-11-17-2300/el8_amd64_gcc12 Additional Tests: NANO User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/46702/42918/install.sh to create a dev area with all the needed externals and cmssw changes.

RelVals-INPUT

Comparison Summary

Summary:

NANO Comparison Summary

Summary:

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.074 3.074 0.000 ( +0.0% ) 2.78 2.77 +0.3% 2.479 2.518
2500.002 3.191 3.191 0.000 ( +0.0% ) 2.47 2.48 -0.3% 2.510 2.937
2500.003 3.132 3.132 0.000 ( +0.0% ) 2.61 2.59 +0.8% 2.519 2.926
2500.011 1.643 1.643 0.000 ( +0.0% ) 4.30 4.27 +0.6% 2.336 2.602
2500.012 2.183 2.183 0.000 ( +0.0% ) 2.58 2.58 +0.1% 2.379 2.786
2500.013 1.998 1.998 0.000 ( +0.0% ) 3.62 3.57 +1.2% 2.392 2.696
2500.021 0.022 0.022 0.000 ( +0.0% ) 0.93 0.94 -0.3% 2.076 2.553
2500.022 0.022 0.022 0.000 ( +0.0% ) 0.88 0.89 -1.4% 2.082 2.548
2500.023 0.022 0.022 0.000 ( +0.0% ) 0.84 0.86 -2.6% 2.359 2.401
2500.024 0.022 0.022 0.000 ( +0.0% ) 0.66 0.68 -2.8% 2.198 2.639
2500.031 0.035 0.035 0.000 ( +0.0% ) 0.80 0.80 +0.1% 2.591 2.622
2500.032 0.036 0.036 0.000 ( +0.0% ) 0.81 0.80 +0.7% 2.584 2.580
2500.033 0.037 0.037 0.000 ( +0.0% ) 0.76 0.77 -0.4% 2.583 2.659
2500.034 0.036 0.036 0.000 ( +0.0% ) 0.77 0.76 +0.6% 2.569 2.643
2500.101 2.807 2.807 0.000 ( +0.0% ) 7.02 6.90 +1.6% 2.099 2.617
2500.111 1.461 1.461 0.000 ( +0.0% ) 13.70 13.60 +0.7% 2.319 2.319
2500.112 1.881 1.881 0.000 ( +0.0% ) 11.57 11.45 +1.1% 2.390 2.392
2500.131 0.747 0.747 0.000 ( +0.0% ) 18.29 17.96 +1.8% 1.468 1.512
2500.201 2.636 2.636 0.000 ( +0.0% ) 5.79 5.73 +1.0% 2.173 2.181
2500.211 1.804 1.804 0.000 ( +0.0% ) 11.91 11.67 +2.0% 2.389 2.382
2500.212 2.200 2.200 0.000 ( +0.0% ) 10.30 10.17 +1.3% 2.473 2.464
2500.221 2.036 2.036 0.000 ( +0.0% ) 6.19 6.09 +1.7% 2.090 2.094
2500.222 3.437 3.437 0.000 ( +0.0% ) 5.76 5.72 +0.7% 2.184 2.190
2500.223 9.403 9.403 0.000 ( +0.0% ) 1.77 1.74 +1.9% 2.210 2.258
2500.224 6.259 6.259 0.000 ( +0.0% ) 0.59 0.58 +1.2% 1.911 2.201
2500.225 6.306 6.306 0.000 ( +0.0% ) 0.55 0.55 +0.5% 2.295 2.403
2500.226 3.131 3.131 0.000 ( +0.0% ) 6.03 5.72 +5.3% 2.181 2.183
2500.227 1.437 1.437 0.000 ( +0.0% ) 11.84 11.57 +2.4% 1.430 1.429
2500.231 1.454 1.454 0.000 ( +0.0% ) 10.05 9.93 +1.2% 2.019 2.276
2500.232 2.459 2.459 0.000 ( +0.0% ) 9.54 9.56 -0.2% 2.376 2.380
2500.233 4.951 4.951 0.000 ( +0.0% ) 2.62 2.60 +0.6% 2.450 2.175
2500.234 3.838 3.838 0.000 ( +0.0% ) 0.75 0.74 +1.4% 2.414 2.156
2500.235 3.869 3.869 0.000 ( +0.0% ) 0.71 0.71 -0.1% 2.612 2.219
2500.236 2.249 2.249 0.000 ( +0.0% ) 10.06 10.00 +0.7% 2.383 2.371
2500.237 1.016 1.016 0.000 ( +0.0% ) 17.30 16.91 +2.3% 1.459 1.403
2500.241 9.404 9.404 0.000 ( +0.0% ) 3.82 3.47 +10.0% 1.921 1.919
2500.242 10.331 10.331 0.000 ( +0.0% ) 0.91 0.89 +2.2% 1.712 1.709
2500.243 2.712 2.712 0.000 ( +0.0% ) 8.12 8.43 -3.7% 1.078 1.075
2500.244 485.976 485.976 0.000 ( +0.0% ) 0.57 0.56 +2.9% 1.679 1.677
2500.245 823.202 823.202 0.000 ( +0.0% ) 0.75 0.73 +2.8% 1.662 1.684
2500.901 1.777 1.777 0.000 ( +0.0% ) 21.17 20.27 +4.4% 1.416 1.413
2500.902 1.627 1.627 0.000 ( +0.0% ) 19.72 20.46 -3.6% 1.324 1.322
2500.911 14.041 14.041 0.000 ( +0.0% ) 3.19 3.63 -12.1% 1.090 1.088
2500.912 0.199 0.171 0.029 ( +16.9% ) 1.13 1.36 -16.4% 0.978 0.970
2500.913 0.110 0.110 0.000 ( +0.0% ) 1.14 1.18 -3.3% 0.978 0.977
patinkaew commented 4 days ago

Hi @jfernan2,

Thank you for helping with the tests. The workflow 2024.003001 failed at Step0-DAS_Error. From log here, the problem occurs at das-up-to-nevents.py#L153-L154 and the problem is that run_ranges is empty. I'm not entirely sure why. I checked DAS and the dataset seems to be on disk.

Another point I realised recently is we might need to add a dummy producer similar to when SimpleTypedExternalFlatTableProducer were added here, but we can also test this when we add this feature to ScoutingNano eventually. What do you prefer? This is probably for XPOG @ftorrresd, @hqucms.

Best, Patin

cmsbuild commented 2 hours ago

Milestone for this pull request has been moved to CMSSW_15_0_X. Please open a backport if it should also go in to CMSSW_14_2_X.