Skip to content

Plugin to obtain the best track index for Run3ScoutingElectron #47726

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

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

arsahasransu
Copy link
Contributor

PR description:

The new plugin returns the best track index and other associated variables as value maps for use in NanoAOD creation for HLTSCOUT dataset. Discussed extensively in Scouting meeting. Relevant slides are linked below.

Also includes a test functionality in the test directory to manually verify the sensibility of the code output.

PR validation:

scram b code-checks
scram b code-format
  • Cross-checked the output of code tests/run_Run3ScoutingElectronBestTrack_cfg.py. The values of the edmValueMaps in the root file are sensible.

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 28, 2025

cms-bot internal usage

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47726/44295

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • PhysicsTools/Scouting (xpog)

@cmsbuild, @ftorrresd, @hqucms can you please review it and eventually sign? Thanks.
@antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@arsahasransu
Copy link
Contributor Author

Note contributions by @patinkaew . @elfontan @donated The PR for the Run3ScoutingElectronBestTrackProducer is now created for NanoAOD. Tagging to follow.

@arsahasransu
Copy link
Contributor Author

I also believe Scouting needs to be added to monitor the code in the package PhysicsTools/Scouting.

@mmusich
Copy link
Contributor

mmusich commented Mar 31, 2025

I also believe Scouting needs to be added to monitor the code in the package PhysicsTools/Scouting.

what does this mean?

Also includes a test functionality in the test directory to manually verify the sensibility of the code output.

Is there a way to test it directly from the PR? Is this going to run in any central nano sequence only at a later time?
In case that's the case, can run_Run3ScoutingElectronBestTrack_cfg.py become a unit test of sorts?

@arsahasransu
Copy link
Contributor Author

I also believe Scouting needs to be added to monitor the code in the package PhysicsTools/Scouting.

what does this mean?

Basically, I meant that the scouting convenors should get a notice when the code in the repo PhysicsTools/Scouting changes so that they can review and are aware of the change. I also do not know the formalism. I was merely speculating.

Also includes a test functionality in the test directory to manually verify the sensibility of the code output.

Is there a way to test it directly from the PR? Is this going to run in any central nano sequence only at a later time? In case that's the case, can run_Run3ScoutingElectronBestTrack_cfg.py become a unit test of sorts?

So, a command cmsRun run_Run3ScoutingElectronBestTrack_cfg.py should work and produce a ROOT file with reasonable output right out of the box. The input file to this command can be any HLTSCOUT file and Scouting Monitoring file on or after Run2023. The python inputs and outputs CMSSW EDM ROOT File, which I think can be used to test the module but I need advice on whether it can be used for unit tests. It can be used for test certainly and to demonstrate utility of the associated plugin.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

@mmusich
Copy link
Contributor

mmusich commented Mar 31, 2025

Basically, I meant that the scouting convenors should get a notice when the code in the repo PhysicsTools/Scouting changes so that they can review and are aware of the change. I also do not know the formalism. I was merely speculating.

that's possible.
You can for example create a tsg-scouting category here:

https://github.com/cms-sw/cms-bot/blob/1774727cfa2c5040288ddb3bf2657d91fa6823e7/groups.yaml

and then add to that category the packages of interest as it's done for example for btv-pog here:

https://github.com/cms-sw/cms-bot/blob/1774727cfa2c5040288ddb3bf2657d91fa6823e7/repos/iarspider_cmssw/cmssw/watchers.yaml#L88

that way all the people in the tsg-scouting category will get a ping.

File, which I think can be used to test the module but I need advice on whether it can be used for unit tests. It can be used for test certainly and to demonstrate utility of the associated plugin.

if all it needs is to run a cmsRun job, that's certainly possible.
There are instructions on how to do that here.

@patinkaew
Copy link
Contributor

patinkaew commented Apr 1, 2025

Hi Marco,

Thank you for pointing out the instruction to create tsg-scouting category. I will take care of that.
@elfontan @silviodonato Any objections to add you two to monitor PhysicsTools/Scouting and also DataFormats/Scouting?

@patinkaew
Copy link
Contributor

patinkaew commented Apr 1, 2025

Hi @arsahasransu, all,

I was checking this with 2022-24 data and the plugin crashes for 2023 because trkpMode, trketaMode, trkphiMode, trkqoverpModeError were only added from 2024 (in cms-sw/cmssw#43744)).

I'm not sure what is the best solution for this. For ScoutingNano, we can have era modifier so we only output these for 2024 and afterwards. So we only need to make sure the plugin doesn't crash. A try block might work?

Hi @hqucms @ftorrresd, we will eventually put this in ScoutingNano. The edm::ValueMap is used here because we will then put the best track parameters as externalVariables in SimpleFlatTableProducer. In my opinion, the cleanest solution is the plugin only outputs the index of the best track and we retrieve the best track parameters (e.g. trk_pt, trk_eta) in SimpleFlatTableProducer by doing something like Var(trkpt[i]) where i is the best track index. My first thought is that this is not possible as i is not a member of Run3ScoutingElectron class (it is an external variable). Could you please comment on this?

@vlimant
Copy link
Contributor

vlimant commented Apr 7, 2025

enable nano

@vlimant
Copy link
Contributor

vlimant commented Apr 7, 2025

is this producer meant to run in the HLT only.
should the PR also include the code that reads it into scouting nanoaod ?

@mmusich
Copy link
Contributor

mmusich commented Apr 7, 2025

is this producer meant to run in the HLT only.

this is definitely NOT meant to run in the HLT.

@silviodonato
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

@mmusich
Copy link
Contributor

mmusich commented Apr 10, 2025

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-10fcb8/45485/summary.html
COMMIT: 0a14793
CMSSW: CMSSW_15_1_X_2025-04-09-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/47726/45485/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 4 lines from the logs
  • Reco comparison results: 5 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3916361
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3916335
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 215 log files, 184 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

NANO Comparison Summary

Summary:

  • You potentially added 1538 lines to 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: 23
  • DQMHistoTests: Total histograms compared: 90509
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 90509
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 22 files compared)
  • Checked 113 log files, 65 edm output root files, 23 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.115 3.115 0.000 ( +0.0% ) 7.06 6.82 +3.5% 2.560 2.582
2500.002 3.231 3.231 0.000 ( +0.0% ) 6.26 6.11 +2.6% 2.586 3.005
2500.003 3.172 3.172 0.000 ( +0.0% ) 6.53 6.36 +2.7% 2.597 3.001
2500.011 1.647 1.647 0.000 ( +0.0% ) 11.76 11.51 +2.2% 2.635 2.659
2500.012 2.185 2.185 0.000 ( +0.0% ) 6.53 6.37 +2.5% 2.455 2.841
2500.013 2.002 2.002 0.000 ( +0.0% ) 9.32 9.06 +2.9% 2.456 2.758
2500.021 0.022 0.022 0.000 ( +0.0% ) 1.90 1.86 +2.1% 2.702 2.706
2500.022 0.022 0.022 0.000 ( +0.0% ) 1.89 1.79 +5.3% 2.706 2.697
2500.023 0.022 0.022 0.000 ( +0.0% ) 1.81 1.79 +1.1% 2.570 2.569
2500.024 0.022 0.022 0.000 ( +0.0% ) 1.52 1.47 +3.5% 2.813 2.805
2500.031 0.035 0.035 0.000 ( +0.0% ) 1.70 1.64 +4.0% 2.768 2.775
2500.032 0.036 0.036 0.000 ( +0.0% ) 1.65 1.64 +1.2% 2.723 2.731
2500.033 0.037 0.037 0.000 ( +0.0% ) 1.61 1.56 +3.4% 2.804 2.801
2500.034 0.036 0.036 0.000 ( +0.0% ) 1.60 1.58 +1.0% 2.784 2.786
2500.101 2.872 2.872 0.000 ( +0.0% ) 16.34 15.73 +3.9% 2.650 2.640
2500.111 1.474 1.474 0.000 ( +0.0% ) 31.62 30.44 +3.9% 2.346 2.336
2500.112 1.896 1.896 0.000 ( +0.0% ) 26.66 25.98 +2.6% 2.410 2.411
2500.131 0.750 0.750 0.000 ( +0.0% ) 37.57 36.59 +2.7% 1.497 1.497
2500.201 2.706 2.706 0.000 ( +0.0% ) 13.52 13.12 +3.0% 2.215 2.212
2500.211 1.845 1.845 0.000 ( +0.0% ) 27.34 25.60 +6.8% 2.408 2.412
2500.212 2.243 2.243 0.000 ( +0.0% ) 23.20 22.45 +3.4% 2.492 2.499
2500.221 2.141 2.141 0.000 ( +0.0% ) 14.09 13.79 +2.2% 2.130 2.134
2500.222 3.516 3.516 0.000 ( +0.0% ) 13.46 12.95 +4.0% 2.222 2.226
2500.223 10.328 10.328 0.000 ( +0.0% ) 4.74 4.64 +2.3% 2.390 2.387
2500.224 6.622 6.622 0.000 ( +0.0% ) 1.28 1.25 +2.5% 2.345 2.343
2500.225 6.671 6.671 0.000 ( +0.0% ) 1.20 1.17 +2.7% 2.550 2.562
2500.226 3.210 3.210 0.000 ( +0.0% ) 14.08 13.48 +4.4% 2.221 2.215
2500.227 1.442 1.442 0.000 ( +0.0% ) 24.32 23.63 +2.9% 1.439 1.442
2500.228 4.045 4.045 0.000 ( +0.0% ) 9.15 8.82 +3.7% 2.320 2.318
2500.231 1.516 1.516 0.000 ( +0.0% ) 23.11 22.58 +2.3% 2.319 2.313
2500.232 2.502 2.502 0.000 ( +0.0% ) 21.83 20.93 +4.3% 2.404 2.398
2500.233 5.422 5.422 0.000 ( +0.0% ) 7.20 6.98 +3.1% 2.566 2.569
2500.234 3.928 3.928 0.000 ( +0.0% ) 1.64 1.60 +2.3% 2.487 2.487
2500.235 3.960 3.960 0.000 ( +0.0% ) 1.55 1.51 +2.5% 2.686 2.675
2500.236 2.292 2.292 0.000 ( +0.0% ) 22.91 22.35 +2.5% 2.393 2.402
2500.237 1.018 1.018 0.000 ( +0.0% ) 35.57 34.58 +2.9% 1.449 1.450
2500.238 2.477 2.477 0.000 ( +0.0% ) 17.61 17.04 +3.4% 2.476 2.477
2500.241 9.404 9.404 0.000 ( +0.0% ) 8.40 7.80 +7.7% 1.921 1.933
2500.242 10.331 10.331 0.000 ( +0.0% ) 1.71 1.66 +3.5% 1.727 1.732
2500.243 2.712 2.712 0.000 ( +0.0% ) 16.56 16.47 +0.5% 1.059 1.062
2500.244 486.016 486.016 0.000 ( +0.0% ) 1.16 1.15 +0.7% 1.709 1.687
2500.245 826.413 826.413 0.000 ( +0.0% ) 1.55 1.53 +1.1% 1.682 1.674
2500.251 645.333 645.333 0.000 ( +0.0% ) 1.66 1.67 -0.3% 1.790 1.793
2500.301 0.021 0.021 0.000 ( +0.0% ) 1.77 1.74 +1.2% 2.820 2.818
2500.311 0.036 0.036 0.000 ( +0.0% ) 1.74 1.69 +3.3% 2.767 2.781
2500.901 1.819 1.819 0.000 ( +0.0% ) 48.21 45.30 +6.4% 1.437 1.441
2500.902 1.665 1.665 0.000 ( +0.0% ) 48.57 47.49 +2.3% 1.337 1.341
2500.911 14.345 14.345 0.000 ( +0.0% ) 9.23 9.33 -1.1% 1.093 1.092
2500.912 0.199 0.199 0.000 ( +0.0% ) 3.28 4.50 -27.2% 0.850 0.848
2500.913 0.110 0.110 0.000 ( +0.0% ) 2.68 2.48 +8.2% 0.849 0.850

@mmusich
Copy link
Contributor

mmusich commented Apr 10, 2025

Unit test worked, see log.

@silviodonato
Copy link
Contributor

@cms-sw/xpog-l2 I think all fixes suggested by Marco have been implemented (thanks Marco)

@ftorrresd
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @sextonkennedy, @mandrenguyen, @rappoccio, @antoniovilela (and backports should be raised in the release meeting by the corresponding L2)

@mandrenguyen
Copy link
Contributor

+1

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.

9 participants