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

Add DY option to Embedding HepMC filter #38829

Merged
merged 3 commits into from
Aug 16, 2022

Conversation

IzaakWN
Copy link
Contributor

@IzaakWN IzaakWN commented Jul 22, 2022

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.

@cmsbuild
Copy link
Contributor

+code-checks

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

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

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

@SiewYan
Copy link
Contributor

SiewYan commented Jul 25, 2022

please test

@SiewYan
Copy link
Contributor

SiewYan commented Jul 25, 2022

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

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0ff0c5/26427/summary.html
COMMIT: 24cbe44
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

@IzaakWN
Copy link
Contributor Author

IzaakWN commented Jul 25, 2022

@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

@SiewYan
Copy link
Contributor

SiewYan commented Jul 26, 2022

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

@qliphy
Copy link
Contributor

qliphy commented Aug 1, 2022

please test
to refresh

@qliphy
Copy link
Contributor

qliphy commented Aug 1, 2022

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

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 1, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0ff0c5/26553/summary.html
COMMIT: 24cbe44
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

@IzaakWN
Copy link
Contributor Author

IzaakWN commented Aug 2, 2022

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

}
if (mom_id == ZPDGID_) {
isHardProc = true; // intermediate boson
} else if (includeDY_ && 11 <= pdg_id && pdg_id <= 16 && mcTruthHelper_.isFirstCopy(**particle) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

11 <= pdg_id && pdg_id <= 16: instead of doing this, do you want to select the pdg_ids explicitly. Do you care about Z $\rightarrow \nu \nu$?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In principle this filter only targets the charged leptons, but this is done a few lines below and selecting 11, 13 and 15 explicitly should make no significant difference in performance.

I can change it if you really want?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Saptaparna, are you fine with leaving it as it is now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, sorry. It is fine. Just signed PR.

@qliphy
Copy link
Contributor

qliphy commented Aug 15, 2022

please test

@qliphy
Copy link
Contributor

qliphy commented Aug 15, 2022

@cms-sw/generators-l2 Any comment?
#38829 (comment)

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0ff0c5/26821/summary.html
COMMIT: 24cbe44
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

@Saptaparna
Copy link
Contributor

Saptaparna commented Aug 16, 2022

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

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

@qliphy
Copy link
Contributor

qliphy commented Aug 16, 2022

+1

@aandvalenzuela
Copy link
Contributor

@IzaakWN
Copy link
Contributor Author

IzaakWN commented Aug 17, 2022

@qliphy @aandvalenzuela, I guess it is because the IncludeDY parameter is not specified in these test scripts:

generator = cms.EDFilter("Pythia8HadronizerFilter",
maxEventsToPrint = cms.untracked.int32(1),
nAttempts = cms.uint32(1000),
HepMCFilter = cms.PSet(
filterName = cms.string('EmbeddingHepMCFilter'),
filterParameters = cms.PSet(
ElElCut = cms.string('El1.Pt > 22 && El2.Pt > 10'),
ElHadCut = cms.string('El.Pt > 28 && Had.Pt > 25'),
ElMuCut = cms.string('(El.Pt > 21 && Mu.Pt > 10) || (El.Pt > 10 && Mu.Pt > 21)'),
HadHadCut = cms.string('Had1.Pt > 35 && Had2.Pt > 30'),
MuHadCut = cms.string('Mu.Pt > 18 && Had.Pt > 25 && Mu.Eta < 2.1'),
MuMuCut = cms.string('Mu1.Pt > 17 && Mu2.Pt > 8'),
Final_States = cms.vstring('ElEl','ElHad','ElMu','HadHad','MuHad','MuMu'),
BosonPDGID = cms.int32(23)
),
),

Is it possible to make it optional here?

: ZPDGID_(iConfig.getParameter<int>("BosonPDGID")), includeDY_(iConfig.getParameter<bool>("IncludeDY")) {

@perrotta
Copy link
Contributor

@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?

@IzaakWN
Copy link
Contributor Author

IzaakWN commented Aug 17, 2022

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)

1828dd5
Is this okay with you? Then I'll open a new PR, and update the backports as well.

@perrotta
Copy link
Contributor

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

@IzaakWN
Copy link
Contributor Author

IzaakWN commented Aug 17, 2022

Hi @qliphy, @aandvalenzuela, @perrotta, the fix is in PR #39090 and it has been pushed to the backports as well. Apologies for the troubles.

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.

7 participants