Skip to content

Conversation

@kerstinlovisa
Copy link

@kerstinlovisa kerstinlovisa commented Jul 8, 2025

PR description:

This PR includes producers and setup for a first version of EXO PAG customizations of nanoAOD, with customization combined from multiple analysis teams working with long-lived particles, including:

  • Displaced muons
  • Displaced electrons
  • Displaced jets (with leptons)
  • Muon detector showers
  • Displaced taus

Previously discussed at the nanoAOD deep dive, within XPOG April 2 2025 and July 9 2025, and within EXO at the EXO workshop and general meeting.

The PR depends on cms-data/RecoTauTag-TrainingFiles#15 PR with training data for the displaced tau tag.

PR validation:

Collections with number of variables and sizes for different datasets has been evaluated:
exonanoaodv1_size_table

Timing study done for running AOD -> EXOnanoAODv1 in one step tested on one file from TTto4Q MC dataset, accounting for differences on different machines. The study shows the relative time difference between producing standard nanoAOD and EXOnanoAODv1 as a function of number of events, with less than a factor 2 relative time increase.
Screenshot 2025-07-09 at 09 21 29

The test script PhysicsTools/NanoAOD/test/test-exoNano.sh runs CMS driver command for AOD->EXOnanoAODv1 in one step (with --step PAT,NANO:(at)EXO) and works for this setup.

@enibigir @jniedzie

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2025

cms-bot internal usage

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2025

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48502/45439

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 9, 2025

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48502/45445

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

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 9, 2025

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48502/45446

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 9, 2025

Pull request #48502 was updated.

@ftorrresd
Copy link
Contributor

enable nano

@ftorrresd
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 9, 2025

-1

Failed Tests: Build ClangBuild
Size: This PR adds an extra 80KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f12b81/47149/summary.html
COMMIT: 7a9ef1f
CMSSW: CMSSW_15_1_X_2025-07-09-1100/el8_amd64_gcc12
Additional Tests: NANO
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/48502/47149/install.sh to create a dev area with all the needed externals and cmssw changes.

Build

I found compilation warning when building: See details on the summary page.

Clang Build

I found compilation warning while trying to compile with clang. Command used:

USER_CUDA_FLAGS='--expt-relaxed-constexpr' USER_CXXFLAGS='-Wno-register -fsyntax-only' /usr/bin/time -v scram build -k -j 32 COMPILER='llvm compile'

See details on the summary page.

@cmsbuild cmsbuild modified the milestones: CMSSW_16_1_X, CMSSW_16_0_X Dec 18, 2025
Copy link

@battibass battibass left a comment

Choose a reason for hiding this comment

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

As promised, some review of the muon part from my side comes now, apologies for the belated action.

I will also have a look at the rest of the code in the coming days.

Comment on lines 51 to 53
int getMatches(const pat::Muon& muon, const reco::Track& dsaMuon, float minPositionDiff = 1e-6) const;
int getDTMatches(const pat::Muon& muon, const reco::Track& dsaMuon, float minPositionDiff = 1e-6) const;
int getCSCMatches(const pat::Muon& muon, const reco::Track& dsaMuon, float minPositionDiff = 1e-6) const;

Choose a reason for hiding this comment

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

These three functions are essentially performing the same logic modulo minor differences. Such approach implies repeating almost-identical loops multiple times.

I would suggest writing a single function that accumulates on a struct containing three int reporting about all matches, DT matches and CSC matches, and returning the struct.

Also you could even store in the struct just two int if all matches is fully redundant.

Comment on lines 112 to 134
pt.push_back(dsaMuon.pt());
ptErr.push_back(dsaMuon.ptError());
eta.push_back(dsaMuon.eta());
etaErr.push_back(dsaMuon.etaError());
phi.push_back(dsaMuon.phi());
phiErr.push_back(dsaMuon.phiError());
charge.push_back(dsaMuon.charge());
dxy.push_back(dsaMuon.dxy());
dz.push_back(dsaMuon.dz());
vx.push_back(dsaMuon.vx());
vy.push_back(dsaMuon.vy());
vz.push_back(dsaMuon.vz());
chi2.push_back(dsaMuon.chi2());
ndof.push_back(dsaMuon.ndof());

trkNumPlanes.push_back(dsaMuon.hitPattern().muonStationsWithValidHits());
trkNumHits.push_back(dsaMuon.hitPattern().numberOfValidMuonHits());
trkNumDTHits.push_back(dsaMuon.hitPattern().numberOfValidMuonDTHits());
trkNumCSCHits.push_back(dsaMuon.hitPattern().numberOfValidMuonCSCHits());
normChi2.push_back(dsaMuon.normalizedChi2());

outerEta.push_back(dsaMuon.extra().isNonnull() && dsaMuon.extra().isAvailable() ? dsaMuon.outerEta() : -999);
outerPhi.push_back(dsaMuon.extra().isNonnull() && dsaMuon.extra().isAvailable() ? dsaMuon.outerPhi() : -999);

Choose a reason for hiding this comment

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

Can't variables such as those ones be ntuplised using a SimpleTrackFlatTableProducer? If so, I would recommend using existing modules and configure them to extract the variables you need.

Comment on lines +163 to +171
innerTrackValidFraction.push_back((!muon.innerTrack().isNull()) ? muon.innerTrack()->validFraction() : -1);
globalTrackNormalizedChi2.push_back((!muon.globalTrack().isNull()) ? muon.globalTrack()->normalizedChi2() : -1);
CQChi2Position.push_back(muon.combinedQuality().chi2LocalPosition);
CQTrackKink.push_back(muon.combinedQuality().trkKink);
numberOfMatchedStation.push_back(muon.numberOfMatchedStations());
numberOfValidPixelHits.push_back(
(!muon.innerTrack().isNull()) ? muon.innerTrack()->hitPattern().numberOfValidPixelHits() : 0);
numberOfValidTrackerHits.push_back(
(!muon.innerTrack().isNull()) ? muon.innerTrack()->hitPattern().numberOfValidTrackerHits() : 0);

Choose a reason for hiding this comment

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

Also in this module, one can delegate the extraction of variables such as these ones to a simplePATMuonFlatTableProducer.

DEFINE_FWK_MODULE(SimpleTriggerTrackFlatTableProducer);
DEFINE_FWK_MODULE(SimpleGsfTrackFlatTableProducer);
DEFINE_FWK_MODULE(SimpleCompositeCandidateFlatTableProducer);
DEFINE_FWK_MODULE(SimpleMuonRecHitClusterFlatTableProducer);

Choose a reason for hiding this comment

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

Is this ever used?

Comment on lines 54 to 56
int getTotSegments(const reco::Track& dsaMuon) const;
int getDTSegments(const reco::Track& dsaMuon) const;
int getCSCSegments(const reco::Track& dsaMuon) const;
Copy link

@battibass battibass Dec 18, 2025

Choose a reason for hiding this comment

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

The same strategy proposed above could apply here as well

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48502/47781

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

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48502/47782

@cmsbuild
Copy link
Contributor

Pull request #48502 was updated. @AdrianoDee, @DickyChant, @antoniovagnerini, @battibass, @cmsbuild, @ftorrresd, @miquork can you please check and sign again.

@ftorrresd
Copy link
Contributor

enable nano

@ftorrresd
Copy link
Contributor

please test

@kerstinlovisa
Copy link
Author

Sorry for the delay in responding to all comments. I have made changes to all comments on the muon implementations, but we still need to go over the remaining comments on displaced tau and displaced jets. As I did not make the original implementations myself, these fixes might take slightly longer.

@cmsbuild
Copy link
Contributor

-1

Failed Tests: RelVals-NANO
Size: This PR adds an extra 56KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f12b81/51018/summary.html
COMMIT: 81669af
CMSSW: CMSSW_16_1_X_2026-01-30-1100/el8_amd64_gcc13
Additional Tests: NANO
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/48502/51018/install.sh to create a dev area with all the needed externals and cmssw changes.

Failed RelVals-NANO

  • 2500.3212500.321_EXONANOmc150X/step2_EXONANOmc150X.log
  • 2500.33112500.3311_EXONANOdata150Xrun3/step2_EXONANOdata150Xrun3.log

Comparison Summary

Summary:

  • You potentially added 4 lines to the logs
  • Reco comparison results: 7 differences found in the comparisons
  • DQMHistoTests: Total files compared: 52
  • DQMHistoTests: Total histograms compared: 4028550
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4028524
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 51 files compared)
  • Checked 222 log files, 193 edm output root files, 52 DQM output files
  • TriggerResults: no differences found

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.

6 participants