cmssw icon indicating copy to clipboard operation
cmssw copied to clipboard

Add DY option to Embedding HepMC filter

Open IzaakWN opened this issue 2 years ago • 14 comments

PR description

This PR adds the IncludeDY option to the EmbeddingHepMCFilter in order to allow for the inclusion of Drell-Yan MC events with virtual photons / Z bosons for which the intermediate boson is missing in the particle collection, e.g. p p > ta ta~). For example, this is needed for correctly filtering events of the DYJetsToTauTauToMuTauh_M-50 sample. The proposed changes were discussed in the TauPOG here: https://indico.cern.ch/event/1170879/#2-validation-of-exclusive-dy-t

We have also added the absolute value function around the mother's PDG ID to allow for charged bosons, such as W (±24) for H → WW.

PR validation

  • We have compared MC events generated with and without the changes to this filter.
  • Usual scram build code-checks and scram build code-format.

PR backporting

After PR, we will request to backport these changes to CMSSW_10_6_X as well, so we can regenerate the DYJetsToTauTauToMuTauh_M-50 sample for Run-2 UL MC for TauPOG studies, and also to the CMSSW version for the future Run-3 MC campaign.

IzaakWN avatar Jul 22 '22 07:07 IzaakWN

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38829/31201

  • This PR adds an extra 16KB to repository

cmsbuild avatar Jul 22 '22 07:07 cmsbuild

A new Pull Request was created by @IzaakWN (Izaak) for master.

It involves the following packages:

  • GeneratorInterface/Core (generators)

@SiewYan, @mkirsano, @Saptaparna, @cmsbuild, @GurpreetSinghChahal, @alberto-sanchez can you please review it and eventually sign? Thanks. @alberto-sanchez, @mkirsano this is something you requested to watch as well. @perrotta, @dpiparo, @qliphy, @rappoccio you are the release manager for this.

cms-bot commands are listed here

cmsbuild avatar Jul 22 '22 07:07 cmsbuild

please test

SiewYan avatar Jul 25 '22 01:07 SiewYan

@IzaakWN , do you happen to have a test snippet included with this PR to test the switch to this filter?

SiewYan avatar Jul 25 '22 01:07 SiewYan

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0ff0c5/26427/summary.html COMMIT: 24cbe44da82991eed97f338a45a3a29aa680da41 CMSSW: CMSSW_12_5_X_2022-07-24-2300/el8_amd64_gcc10 User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/38829/26427/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: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3667670
  • DQMHistoTests: Total failures: 8
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3667640
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 50 files compared)
  • Checked 210 log files, 47 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

cmsbuild avatar Jul 25 '22 05:07 cmsbuild

@IzaakWN , do you happen to have a test snippet included with this PR to test the switch to this filter?

Sure, I grabbed the fragment for DYJetsToTauTauToMuTauh_M-50 from MCM

curl -s -k https://cms-pdmv.cern.ch/mcm/public/restapi/requests/get_test/TAU-RunIISummer20UL18wmLHEGEN-00006 > setup_DYJetsToMuTauh.sh
bash setup_DYJetsToMuTauh_buggy.sh

and simply added IncludeDY = cms.bool(True), as follows:

process.generator = cms.EDFilter("Pythia8HadronizerFilter",
    HepMCFilter = cms.PSet(
        filterName = cms.string('EmbeddingHepMCFilter'),
        filterParameters = cms.PSet(
            BosonPDGID = cms.int32(23),
            IncludeDY = cms.bool(True),
            ElElCut = cms.string(''),
            ElHadCut = cms.string(''),
            ElMuCut = cms.string(''),
            Final_States = cms.vstring('MuHad'),
            HadHadCut = cms.string(''),
            MuHadCut = cms.string('Mu.Pt > 16 && Had.Pt > 16 && Mu.Eta < 2.5 && Had.Eta < 2.7'),
            MuMuCut = cms.string('')
        )
    ),
    # ...
)

and then run with something like

cmsRun -n3 -e -j test TAU-RunIISummer20UL18wmLHEGEN-00006_1_cfg.py

You can find more instruction in the back up of this presentation: https://indico.cern.ch/event/1170879/#2-validation-of-exclusive-dy-t

IzaakWN avatar Jul 25 '22 17:07 IzaakWN

Thanks you for the slide, it looks fine for me.

SiewYan avatar Jul 26 '22 06:07 SiewYan

please test to refresh

qliphy avatar Aug 01 '22 01:08 qliphy

@cms-sw/generators-l2 Do you have any comment?

qliphy avatar Aug 01 '22 01:08 qliphy

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0ff0c5/26553/summary.html COMMIT: 24cbe44da82991eed97f338a45a3a29aa680da41 CMSSW: CMSSW_12_5_X_2022-07-31-2300/el8_amd64_gcc10 User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38829/26553/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: 10 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3669004
  • DQMHistoTests: Total failures: 25
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3668956
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 50 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 210 log files, 47 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

cmsbuild avatar Aug 01 '22 05:08 cmsbuild

Just for the record, I have already opened these two backports:

IzaakWN avatar Aug 02 '22 13:08 IzaakWN

please test

qliphy avatar Aug 15 '22 10:08 qliphy

@cms-sw/generators-l2 Any comment? https://github.com/cms-sw/cmssw/pull/38829#discussion_r935740224

qliphy avatar Aug 15 '22 10:08 qliphy

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0ff0c5/26821/summary.html COMMIT: 24cbe44da82991eed97f338a45a3a29aa680da41 CMSSW: CMSSW_12_5_X_2022-08-15-1100/el8_amd64_gcc10 User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38829/26821/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: 51
  • DQMHistoTests: Total histograms compared: 3692476
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3692452
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 50 files compared)
  • Checked 212 log files, 49 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

cmsbuild avatar Aug 15 '22 15:08 cmsbuild

+1 but some tests failed in the 12X back port.

Saptaparna avatar Aug 16 '22 15:08 Saptaparna

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

cmsbuild avatar Aug 16 '22 15:08 cmsbuild

+1

qliphy avatar Aug 16 '22 15:08 qliphy

@IzaakWN There appears an IB issue after merging this PR: https://cmssdt.cern.ch/SDT/cgi-bin/logreader/el8_amd64_gcc10/CMSSW_12_5_X_2022-08-16-2300/pyRelValMatrixLogs/run/136.9_RunDoubleMuon2016C+RunDoubleMuon2016C+RAWRECOTE16+RAWRECOLHECLEANTE16+EMBEDHADTE16+EMBEDMINIAOD16/step4_RunDoubleMuon2016C+RunDoubleMuon2016C+RAWRECOTE16+RAWRECOLHECLEANTE16+EMBEDHADTE16+EMBEDMINIAOD16.log#/

Please have a quick fix. Thanks!

qliphy avatar Aug 17 '22 01:08 qliphy

Hi @IzaakWN, Also IB unit test is failing: https://cmssdt.cern.ch/SDT/cgi-bin/logreader/el8_amd64_gcc10/CMSSW_12_5_X_2022-08-16-2300/unitTestLogs/TauAnalysis/MCEmbeddingTools#/171-171 because of the same reason.

aandvalenzuela avatar Aug 17 '22 07:08 aandvalenzuela

@qliphy @aandvalenzuela, I guess it is because the IncludeDY parameter is not specified in these test scripts: https://github.com/cms-sw/cmssw/blob/6d2f66057131baacc2fcbdd203588c41c885b42c/TauAnalysis/MCEmbeddingTools/python/EmbeddingPythia8Hadronizer_cfi.py#L8-L24

Is it possible to make it optional here? https://github.com/cms-sw/cmssw/blob/af34412bd8dd78ad213b273d6f0ba080ee8f0b2d/GeneratorInterface/Core/src/EmbeddingHepMCFilter.cc#L7

IzaakWN avatar Aug 17 '22 07:08 IzaakWN

@IzaakWN the optimal solution would be to add a fillDescriptions method in your Pythia8HadronizerFilter.

A quicker fix would be to simply add the missing parameter in cmssw/TauAnalysis/MCEmbeddingTools/python/EmbeddingPythia8Hadronizer_cfi.py, assigning it a "false" default value. Could you please take care of it?

perrotta avatar Aug 17 '22 07:08 perrotta

Hi @perrotta, I prefer to solve it by making the IncludeDY parameter optional like this, so it does not conflict with previous fragment configurations:

iConfig.getUntrackedParameter<bool>("IncludeDY", false)

https://github.com/cms-sw/cmssw/commit/1828dd5f600ee25cfc655e94dc0f62f9a83e560a Is this okay with you? Then I'll open a new PR, and update the backports as well.

IzaakWN avatar Aug 17 '22 08:08 IzaakWN

@IzaakWN in your fix please both update EmbeddingPythia8Hadronizer_cfi.py and assign a default value for "IncludeDY" as you are suggesting

perrotta avatar Aug 17 '22 08:08 perrotta

Hi @qliphy, @aandvalenzuela, @perrotta, the fix is in PR https://github.com/cms-sw/cmssw/pull/39090 and it has been pushed to the backports as well. Apologies for the troubles.

IzaakWN avatar Aug 17 '22 09:08 IzaakWN