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

Extension of electron matching in nanoAOD (backport) #33347

Conversation

sscruz
Copy link
Contributor

@sscruz sscruz commented Apr 6, 2021

PR description:

Backport of #32966

Electron matching to MC truth has some inefficiency due to FSR. This PR extends the matching to recover such cases, by adding the possibility that electrons can be matched to gendressed particles. This issue has been reported here:
https://indico.cern.ch/event/962278/contributions/4060711/attachments/2136665/3599026/electron_matching_nano_nov4.pdf

and further discussed here:

cms-nanoAOD#552

The electron matching is performed as follows:

Electrons are first matched to a collection of dressed electrons. This collection is identical to the GenDressedLepton collection that is stored in nanoAOD, but with a looser pt cut. If there's a match, the Electron_genPartFlav variable is set to 1 or 15, depending on the mother of the dressed lepton. Electron_genPartIdx is the index of the electron en GenPart that corresponds to the constituent of the matched dressed leptons with highest pt and abs(pdgId)==11.
For the electrons not matched in the previous step, the logic is the same as in the previous implementation: electrons are matched to GenPart and then Electron_genPartIdx and Electron_genPartFlav are assigned according to this match.

@cmsbuild cmsbuild added this to the CMSSW_10_6_X milestone Apr 6, 2021
@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 6, 2021

A new Pull Request was created by @sscruz for CMSSW_10_6_X.

It involves the following packages:

PhysicsTools/HepMCCandAlgos
PhysicsTools/NanoAOD

@cmsbuild, @santocch, @mariadalfonso, @gouskos, @fgolf can you please review it and eventually sign? Thanks.
@gpetruc, @swertz this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@mariadalfonso
Copy link
Contributor

this backport is not a 1:1 as you have now CandMCMatchTableProducer.cc and CandMCMatchTableProducerNew.cc
Not sure this is the best way to do it.
did you try to add a "bool ExtendMatching" so that we can protect the changed for the v8 production ?

@mariadalfonso
Copy link
Contributor

please test

@mariadalfonso
Copy link
Contributor

backport

@sscruz
Copy link
Contributor Author

sscruz commented Apr 8, 2021

this backport is not a 1:1 as you have now CandMCMatchTableProducer.cc and CandMCMatchTableProducerNew.cc
Not sure this is the best way to do it.
did you try to add a "bool ExtendMatching" so that we can protect the changed for the v8 production ?

indeed, i thought the safest way would be to duplicate the module for the time being... Adding a bool ExtendMatching should be possible, but I'd have to change some of the consumes to "mayConsumes". If you confirm this is the way to go, I can do it

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 8, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-2b75ee/14110/summary.html
COMMIT: 9e8b02b
CMSSW: CMSSW_10_6_X_2021-04-08-1100/slc7_amd64_gcc700
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/33347/14110/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: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 35
  • DQMHistoTests: Total histograms compared: 3215541
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3215206
  • DQMHistoTests: Total skipped: 334
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 34 files compared)
  • Checked 143 log files, 29 edm output root files, 35 DQM output files
  • TriggerResults: found differences in 1 / 34 workflows

@mariadalfonso
Copy link
Contributor

mariadalfonso commented May 12, 2021

this backport is not a 1:1 as you have now CandMCMatchTableProducer.cc and CandMCMatchTableProducerNew.cc
Not sure this is the best way to do it.
did you try to add a "bool ExtendMatching" so that we can protect the changed for the v8 production ?

indeed, i thought the safest way would be to duplicate the module for the time being... Adding a bool ExtendMatching should be possible, but I'd have to change some of the consumes to "mayConsumes". If you confirm this is the way to go, I can do it

yes, please try with this options (cloning files such as CandMCMatchTableProducerNew will be unmaintainable).
Also now the PR got in conflict electrons_cff.py

@sscruz sscruz force-pushed the from-CMSSW_11_2_0_pre10_electromMatching_PR_backport branch from 9e8b02b to d7d836f Compare May 20, 2021 14:49
@cmsbuild
Copy link
Contributor

Pull request #33347 was updated. @cmsbuild, @santocch, @mariadalfonso, @gouskos, @fgolf can you please check and sign again.

@sscruz
Copy link
Contributor Author

sscruz commented May 20, 2021

@mariadalfonso sorry it took so long, I missed your last message. Just one procedural question: I applied the code checks and that changes parts of the code I didn't mean to change. Is this correct for a backport?

Comment on lines 519 to 530
electronMCTableNew = cms.EDProducer("CandMCMatchTableProducer",
src = electronTable.src,
mcMapDressedLep = cms.InputTag("electronsMCMatchForTableAlt"),
mcMap = cms.InputTag("electronsMCMatchForTable"),
mapTauAnc = cms.InputTag("matchingElecPhoton:hasTauAnc"),
objName = electronTable.name,
objType = cms.string("ElectronDressed"),
branchName = cms.string("genPart"),
docString = cms.string("MC matching to status==1 electrons or photons"),
genparticles = cms.InputTag("finalGenParticles"),
)

Copy link
Contributor

Choose a reason for hiding this comment

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

this "electronMCTableNew" is not used anymore in any sequence.
we should add modification into electronMCTable and have a simple way to take or not the new settings.

@cmsbuild
Copy link
Contributor

Pull request #33347 was updated. @cmsbuild, @santocch, @mariadalfonso, @gouskos, @fgolf can you please check and sign again.

electronSequence = cms.Sequence(bitmapVIDForEle + bitmapVIDForEleHEEP + isoForEle + ptRatioRelForEle + seedGainEle + slimmedElectronsWithUserData + finalElectrons)
electronTables = cms.Sequence (electronMVATTH + electronTable)
electronMC = cms.Sequence(electronsMCMatchForTable + electronMCTable)
electronMCnew = cms.Sequence(particleLevelForMatching + tautaggerForMatching + matchingElecPhoton + electronsMCMatchForTable + electronsMCMatchForTableAlt + electronMCTableNew)
( run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toReplaceWith(electronMC, electronMCnew)
Copy link
Contributor

Choose a reason for hiding this comment

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

we should have the new sequence by default and then for the v8 ( run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel) we should run the old sequence.

can you confirm that runs on both
runTheMatrix -l 1325.81 ( #test ttbar 106Xv1 )
and runTheMatrix -l 1325.7 ( # test ttbar 94XMiniAODv2)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the clarification, i misunderstood the meaning of the modifiers. I've just pushed the proper setting, along with some fixes. I confirm the runTheMatrix workflows are running properly

@cmsbuild
Copy link
Contributor

Pull request #33347 was updated. @cmsbuild, @santocch, @mariadalfonso, @gouskos, @fgolf can you please check and sign again.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-2b75ee/15301/summary.html
COMMIT: d541f6e
CMSSW: CMSSW_10_6_X_2021-05-25-1700/slc7_amd64_gcc700
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/33347/15301/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
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 35
  • DQMHistoTests: Total histograms compared: 3215552
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3215217
  • DQMHistoTests: Total skipped: 334
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 34 files compared)
  • Checked 143 log files, 29 edm output root files, 35 DQM output files
  • TriggerResults: found differences in 1 / 34 workflows

@cmsbuild
Copy link
Contributor

Pull request #33347 was updated. @cmsbuild, @santocch, @mariadalfonso, @gouskos, @fgolf can you please check and sign again.

@mariadalfonso
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-2b75ee/15346/summary.html
COMMIT: 321f2ae
CMSSW: CMSSW_10_6_X_2021-05-26-2300/slc7_amd64_gcc700
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/33347/15346/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: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 35
  • DQMHistoTests: Total histograms compared: 3215552
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3215217
  • DQMHistoTests: Total skipped: 334
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 34 files compared)
  • Checked 143 log files, 29 edm output root files, 35 DQM output files
  • TriggerResults: found differences in 1 / 34 workflows

@mariadalfonso
Copy link
Contributor

backport of #32966

@mariadalfonso
Copy link
Contributor

+xpog

results as in #33347 (comment)
new respect to last sign-off: resolution of #33347 (comment)

@santocch
Copy link

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_10_6_X IBs (tests are also fine) and once validation in the development release cycle CMSSW_12_0_X is complete. This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@qliphy
Copy link
Contributor

qliphy commented May 30, 2021

+1

@cmsbuild cmsbuild merged commit effc7e1 into cms-sw:CMSSW_10_6_X May 30, 2021
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.

None yet

5 participants