Skip to content

[NGT] Introduce NanoAOD flavour for Phase 2 HLT #48091

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 20 commits into from
Jun 4, 2025

Conversation

elenavernazza
Copy link
Contributor

@elenavernazza elenavernazza commented May 15, 2025

PR description:

The goal of this PR is to introduce a new custom NanoAOD flavour for Phase 2 HLT.
The format is compatible with both the Phase 2 standard menu and the NGT Scouting menu. It includes most of the relevant HLT objects (further developments are foreseen to include Taus and MET) :

  • Gen-level particles
  • Primary Vertices
  • Pixel Tracks
  • General Tracks
  • Electrons and Photons
  • Muons
  • PF candidates
  • Jets (with b-tagging score)

The NanoAOD production is triggered automatically when running "TTbar_14TeV" workflows with offsets:

  • .759 for the standard Phase 2 menu
  • .771 for the NGT Scouting menu

Otherwise, it can be triggered by adding NANO:@Phase2HLT (when running on the standard Phase 2 menu) or NANO:@NGTScouting (when running on the NGT Scouting menu) in the step2 cmsDriver command, as shown below.

E.g. for the standard Phase 2 menu

cmsDriver.py step2 \
-s L1P2GT,HLT:@relvalRun4,NANO:@Phase2HLT \
--conditions auto:phase2_realistic_T33 \
--datatier GEN-SIM-DIGI-RAW,NANOAODSIM \
--eventcontent FEVTDEBUGHLT,NANOAODSIM \
--geometry ExtendedRun4D110 \
--era Phase2C17I13M9 \
--filein file:step1.root -n 100 \
--fileout file:step2.root

E.g. for the standard NGT Scouting

cmsDriver.py step2 \
-s L1P2GT,HLT:NGTScouting,NANO:@NGTScouting \
--conditions auto:phase2_realistic_T33 \
--datatier GEN-SIM-DIGI-RAW,NANOAODSIM \
--eventcontent FEVTDEBUGHLT,NANOAODSIM \
--geometry ExtendedRun4D110 \
--era Phase2C17I13M9 \
--filein file:step1.root -n 100 \
--fileout file:step2.root

PR validation:

I've run the workflow 29834 with both .759 and .771 offsets. The step1 and step2 are produced correctly, NanoAOD branches are correctly filled.

@cmsbuild
Copy link
Contributor

cmsbuild commented May 15, 2025

cms-bot internal usage

@mmusich
Copy link
Contributor

mmusich commented May 15, 2025

type ngt

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48091/44835

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • Configuration/PyReleaseValidation (upgrade, pdmv)
  • HLTrigger/Configuration (hlt)
  • HLTrigger/NGTScouting (****)
  • PhysicsTools/NanoAOD (xpog)
  • RecoBTag/ONNXRuntime (reconstruction)

The following packages do not have a category, yet:

HLTrigger/NGTScouting
Please create a PR for https://github.com/cms-sw/cms-bot/blob/master/categories_map.py to assign category

@AdrianoDee, @Martin-Grunewald, @Moanwar, @cmsbuild, @DickyChant, @ftorrresd, @hqucms, @jfernan2, @mandrenguyen, @miquork, @mmusich, @srimanob, @subirsarkar can you please review it and eventually sign? Thanks.
@AlexDeMoor, @Martin-Grunewald, @Ming-Yan, @Senphy, @SohamBhattacharya, @VourMa, @andrzejnovak, @castaned, @fabiocos, @gpetruc, @makortel, @missirol, @mmusich, @rovere, @slomeo 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

@mmusich
Copy link
Contributor

mmusich commented May 15, 2025

test parameters:

  • relvals_opt = --what upgrade
  • workflows = 29834.759, 29834.771

@mmusich
Copy link
Contributor

mmusich commented May 15, 2025

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

-1

Failed Tests: UnitTests RelVals RelVals-INPUT
Size: This PR adds an extra 224KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-634315/46170/summary.html
COMMIT: 9ab2dcf
CMSSW: CMSSW_15_1_X_2025-05-15-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/48091/46170/install.sh to create a dev area with all the needed externals and cmssw changes.

Unit Tests

I found 4 errors in the following unit tests:

---> test test-btvNano-run had ERRORS
---> test test-btvNano-check had ERRORS
---> test test_MC_22_crosscheck had ERRORS
and more ...

RelVals

----- Begin Fatal Exception 15-May-2025 18:47:35 CEST-----------------------
An exception of category 'ProductNotFound' occurred while
   [0] Processing  Event run: 1 lumi: 1 event: 1 stream: 0
   [1] Running path 'MINIAODSIMoutput_step'
   [2] Prefetching for module PoolOutputModule/'MINIAODSIMoutput'
   [3] Prefetching for module PATJetSelector/'slimmedJetsAK8'
   [4] Prefetching for module PATJetUpdater/'updatedPatJetsTransientCorrectedSlimmedAK8DeepTags'
   [5] Prefetching for module BoostedJetONNXJetTagsProducer/'pfParticleNetFromMiniAODAK8JetTagsSlimmedAK8DeepTags'
   [6] Prefetching for module ParticleNetFeatureEvaluator/'pfParticleNetFromMiniAODAK8TagInfosSlimmedAK8DeepTags'
   [7] Prefetching for module PATTauHybridProducer/'slimmedTaus'
   [8] Prefetching for module PATJetSelector/'slimmedJetsPuppi'
   [9] Calling method for module PATJetUpdater/'updatedPatJetsTransientCorrectedSlimmedPuppiWithDeepTags'
Exception Message:
Principal::getByToken: Found zero products matching all criteria
Looking for type: edm::AssociationVector<edm::RefToBaseProd<reco::Jet>,std::vector<float>,edm::RefToBase<reco::Jet>,unsigned int,edm::helper::AssociationIdenticalKeyReference>
Looking for module label: pfDeepFlavourJetTagsSlimmedPuppiWithDeepTags
Looking for productInstanceName: probb

   Additional Info:
      [a] If you wish to continue processing events after a ProductNotFound exception,
add "TryToContinue = cms.untracked.vstring('ProductNotFound')" to the "options" PSet in the configuration.

----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 15-May-2025 18:48:29 CEST-----------------------
An exception of category 'ProductNotFound' occurred while
   [0] Processing  Event run: 356381 lumi: 60 event: 49955554 stream: 0
   [1] Running path 'dqmofflineOnPAT_1_step'
   [2] Prefetching for module JetAnalyzer/'jetDQMAnalyzerAk4PFCHSPuppiCleanedMiniAOD'
   [3] Prefetching for module PATJetSelector/'slimmedJetsPuppi'
   [4] Calling method for module PATJetUpdater/'updatedPatJetsTransientCorrectedSlimmedPuppiWithDeepTags'
Exception Message:
Principal::getByToken: Found zero products matching all criteria
Looking for type: edm::AssociationVector<edm::RefToBaseProd<reco::Jet>,std::vector<float>,edm::RefToBase<reco::Jet>,unsigned int,edm::helper::AssociationIdenticalKeyReference>
Looking for module label: pfDeepFlavourJetTagsSlimmedPuppiWithDeepTags
Looking for productInstanceName: probb

   Additional Info:
      [a] If you wish to continue processing events after a ProductNotFound exception,
add "TryToContinue = cms.untracked.vstring('ProductNotFound')" to the "options" PSet in the configuration.

----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 15-May-2025 19:13:19 CEST-----------------------
An exception of category 'InvalidReference' occurred while
   [0] Processing  Event run: 1 lumi: 1 event: 1 stream: 0
   [1] Running path 'dqmofflineOnPAT_1_step'
   [2] Prefetching for module JetAnalyzer/'jetDQMAnalyzerAk8PFPUPPICleanedMiniAOD'
   [3] Prefetching for module PATJetSelector/'slimmedJetsAK8'
   [4] Prefetching for module PATJetUpdater/'updatedPatJetsTransientCorrectedSlimmedAK8DeepTags'
   [5] Prefetching for module PATJetUpdater/'updatedPatJetsSlimmedAK8DeepTags'
   [6] Prefetching for module PATJetSlimmer/'slimmedJetsAK8NoDeepTags'
   [7] Prefetching for module JetSubstructurePacker/'packedPatJetsAK8'
   [8] Prefetching for module BoostedJetMerger/'slimmedJetsAK8PFPuppiSoftDropPacked'
   [9] Prefetching for module PATJetSelector/'selectedUpdatedPatJetsAK8PFPuppiSoftDropSubjetsSlimmedDeepFlavour'
   [10] Prefetching for module PATJetUpdater/'updatedPatJetsTransientCorrectedAK8PFPuppiSoftDropSubjetsSlimmedDeepFlavour'
   [11] Calling method for module DeepFlavourONNXJetTagsProducer/'pfDeepFlavourJetTagsAK8PFPuppiSoftDropSubjetsSlimmedDeepFlavour'
Exception Message:
ValueMap::Filler: handle and reference collections should the same size
----- End Fatal Exception -------------------------------------------------
Expand to see more relval errors ...

RelVals-INPUT

  • 2500.2252500.225_jmeNANOrePuppimc140X/step2_jmeNANOrePuppimc140X.log
  • 2500.2242500.224_jmeNANOmc140X/step2_jmeNANOmc140X.log
  • 4.64.6_MinimumBias2010A/step2_MinimumBias2010A.log
Expand to see more relval errors ...

@mmusich
Copy link
Contributor

mmusich commented May 27, 2025

@cms-sw/xpog-l2 please review.

Comment on lines +193 to +198
<link rel="stylesheet" type="text/css" href="https://cms-nanoaod-integration.web.cern.ch/patsize.css" />
<script type="text/javascript" src="https://cms-nanoaod-integration.web.cern.ch/rgraph/RGraph.common.core.js"></script>
<script type="text/javascript" src="https://cms-nanoaod-integration.web.cern.ch/rgraph/RGraph.pie.js"></script>
<script type="text/javascript" src="https://cms-nanoaod-integration.web.cern.ch/rgraph/RGraph.common.dynamic.js"></script>
<script type="text/javascript" src="https://cms-nanoaod-integration.web.cern.ch/rgraph/RGraph.common.tooltips.js"></script>
<script type="text/javascript" src="https://cms-nanoaod-integration.web.cern.ch/rgraph/RGraph.common.key.js"></script>
Copy link
Contributor

@ftorrresd ftorrresd Jun 2, 2025

Choose a reason for hiding this comment

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

https://cms-nanoaod-integration.web.cern.ch will decommissioned by November. Everything (rgraph included) is being moved to http://cms-xpog.docs.cern.ch.

Can be done in a future PR.

Copy link
Contributor

@mmusich mmusich Jun 3, 2025

Choose a reason for hiding this comment

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

Hi @ftorrresd, thank you for the comment, we take note.
However, further NGT developments are foreseen (already presented to xpog here) and those are beging blocked by this PR (in review since 2 weeks). If you don't have other substantive comments to the overall structure, I would suggest you to sign and let this PR be merged, such that your comment could be acted upon in a follow-up PR.

@ftorrresd
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 3, 2025

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. @rappoccio, @antoniovilela, @sextonkennedy, @mandrenguyen (and backports should be raised in the release meeting by the corresponding L2)

@mandrenguyen
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit d4d35b7 into cms-sw:master Jun 4, 2025
14 checks passed
@mmusich mmusich deleted the ev_HLTNano branch June 4, 2025 07:52
@artlbv
Copy link
Contributor

artlbv commented Jun 5, 2025

FYI I tried to run the NGTScouting wf and while the nano part is in autoNANO, the NGTScouting is missing from HLT:

autoHLT = {
'fake' : 'Fake',
'fake1' : 'Fake1',
'fake2' : 'Fake2',
'relval50ns' : 'Fake',
'relval25ns' : 'Fake1',
'relval2016' : 'Fake2',
'relval2017' : 'Fake2',
'relval2018' : 'Fake2',
'relval2022' : 'Fake2',
'relval2023' : 'Fake2',
'relval2024' : 'Fake2',
'relval2025' : '2025v11',
'relvalRun4' : '75e33',
'test' : 'GRun',
}

I get this error:

$ cmsDriver.py step2 \-s L1P2GT,HLT:@NGTScouting,NANO:@NGTScouting -n 10 \                                                                                                                                                                                          
--conditions auto:phase2_realistic_T33 \
--datatier NANOAODSIM \
--eventcontent NANOAODSIM \
--geometry ExtendedRun4D110 \
--era Phase2C17I13M9 \
--filein file:/eos/cms/store/mc/Phase2Spring24DIGIRECOMiniAOD/GluGluToHHTo4B_node_SM_TuneCP5_14TeV-amcatnlo-pythia8/GEN-SIM-DIGI-RAW-MINIAOD/PU200_AllTP_140X_mcRun4_realistic_v4-v1/130000/03474707-bf67-466b-9886-8d6379bf66e9.root \
--fileout file:step2.root
L1P2GT,HLT:@NGTScouting,NANO:@NGTScouting,ENDJOB
We have determined that this is simulation (if not, rerun cmsDriver.py with --data)
entry file:/eos/cms/store/mc/Phase2Spring24DIGIRECOMiniAOD/GluGluToHHTo4B_node_SM_TuneCP5_14TeV-amcatnlo-pythia8/GEN-SIM-DIGI-RAW-MINIAOD/PU200_AllTP_140X_mcRun4_realistic_v4-v1/130000/03474707-bf67-466b-9886-8d6379bf66e9.root
Step: L1P2GT Spec: 
Loading P2GT menu from L1Trigger.Configuration.Phase2GTMenus.step1_2024
Step: HLT Spec: ['@NGTScouting']
Traceback (most recent call last):
  File "/cvmfs/cms-ib.cern.ch/sw/x86_64/week0/el9_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_X_2025-06-04-2300/bin/el9_amd64_gcc12/cmsDriver.py", line 40, in <module>
    run()
  File "/cvmfs/cms-ib.cern.ch/sw/x86_64/week0/el9_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_X_2025-06-04-2300/bin/el9_amd64_gcc12/cmsDriver.py", line 16, in run
    configBuilder.prepare()
  File "/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02892/el9_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_X_2025-06-04-2300/src/Configuration/Applications/python/ConfigBuilder.py", line 2340, in prepare
    self.addStandardSequences()
  File "/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02892/el9_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_X_2025-06-04-2300/src/Configuration/Applications/python/ConfigBuilder.py", line 859, in addStandardSequences
    getattr(self,"prepare_"+stepName)(stepSpec = '+'.join(stepSpec))
  File "/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02892/el9_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_X_2025-06-04-2300/src/Configuration/Applications/python/ConfigBuilder.py", line 1679, in prepare_HLT
    raise ValueError('no HLT mapping key "%s" found in autoHLT' % key)
ValueError: no HLT mapping key "NGTScouting" found in autoHLT

For the normal HLT step I get this error but I guess I should check the HLT upgrade docs first before continuing :)

05-Jun-2025 11:35:53 CEST  Closed file file:/eos/cms/store/mc/Phase2Spring24DIGIRECOMiniAOD/GluGluToHHTo4B_node_SM_TuneCP5_14TeV-amcatnlo-pythia8/GEN-SIM-DIGI-RAW-MINIAOD/PU200_AllTP_140X_mcRun4_realistic_v4-v1/130000/03474707-bf67-466b-9886-8d6379bf66e9.root
----- Begin Fatal Exception 05-Jun-2025 11:35:53 CEST-----------------------
An exception of category 'Configuration' occurred while
   [0] Constructing the EventProcessor
Exception Message:
EDAlias conflicts with data
A product of type 'EBDigiCollection'
with module label 'simEcalUnsuppressedDigis' and instance name ''
already exists.
----- End Fatal Exception -------------------------------------------------

@mmusich
Copy link
Contributor

mmusich commented Jun 5, 2025

@artlbv

FYI I tried to run the NGTScouting wf and while the nano part is in autoNANO, the NGTScouting is missing from HLT:

There are recipes on how to run at #48091 (comment).
The NGTScouting key is intentionally missing from autoHLT.

@elenavernazza
Copy link
Contributor Author

Hi @artlbv
Sorry I've realised there is a typo in the instructions.
It should be HLT:NGTScouting (not HLT:@NGTScouting), this is the reason for the error message.
I have updated the PR description, let me know if it works now. And thank you for your feedback!

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