-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Pythia8 ResonanceDecayFilter Fix #48383
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
Open
manuel-gonzalez-henandez
wants to merge
2
commits into
cms-sw:master
Choose a base branch
from
manuel-gonzalez-henandez:manu_RDF_2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Pythia8 ResonanceDecayFilter Fix #48383
manuel-gonzalez-henandez
wants to merge
2
commits into
cms-sw:master
from
manuel-gonzalez-henandez:manu_RDF_2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cms-bot internal usage |
598124c
to
665a2ce
Compare
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48383/45276
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
backport of #46725 |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48383/45277
|
Pull request #48383 was updated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR description:
This pull request proposes a solution to the issue outlined in https://gitlab.cern.ch/cms-gen/gen_tasklist/-/issues/9. The ResonanceDecayFilter was not correctly accounting for the total number of tried events, leading to an incorrect cross section calculation (as the branching ratio was omitted). To address this, I introduced a counter in ResonanceDecayFilterHook.h to track the number of events vetoed by the filter, along with a function to reset the counter after each event. This data is then passed from Pythia8Hadronizer.cc to GenFilterEfficiencyProducer.cc using an object of the class ResonanceDecayFilterCounter I created.
The counter is applied only to the weight counts and not to the event counts, as requested by PDMV, to ensure the event-level GenFilter efficiency excludes the ResonanceDecayFilter information. This exclusion allows PDMV to accurately determine the number of LHE events required to generate a specific number of Gen events.
Additionally, I introduced the input_genfilter_efficiency variable in GenXsecAnalyzer.cc to ensure that when the ResonanceDecayFilter is enabled, the filter efficiency is always calculated using weight counts (where the filter information is stored) instead of event counts. This adjustment ensures consistent efficiency calculations for both LO and NLO processes and includes the filter’s contribution.
Furthermore, now it is possible to use matching between mother and daughter particles like:
'ResonanceDecayFilter:matching = on'
To indicate the matched decays, it is possible to use just one vector
'ResonanceDecayFilter:matchedDecays = {m1: dau11 dau12, m2: dau21 dau22,…, mN: dauN1 … dauNM}'
or “split” into small vectors
'ResonanceDecayFilter:matchedDecays = {m1: dau11 dau12}',
'ResonanceDecayFilter:matchedDecays += {m2: dau21 dau22}',
'ResonanceDecayFilter:matchedDecays += {mN: dauN1 … dauNM}' # N-body decays are allowed
Expected changes to the output are as follows:
Be careful: if the decay properties are modified in Pythia (e.g. 'onIfMatch') and the ResonanceDecayFilter is used, the filter efficiency could not be the same as the branching ratio.
PR validation:
To verify the correctness of the cross section calculation, I used the LO Radion_GF_HH_M300_narrow gridpack (as referenced in https://gitlab.cern.ch/cms-gen/gen_tasklist/-/issues/9) and a simple NLO ttbar custom gridpack that I generated for testing. In both cases, the resulting cross section was calculated correctly.
I also performed the checks outlined in https://cms-sw.github.io/PRWorkflow.html. I executed the runTheMatrix suite of tests. The mistakes obtained by the tests were "No such file or directory" caused by missing root files. . To investigate further, I ran the same runTheMatrix tests using an unmodified version of CMSSW and observed identical errors. This strongly indicates that the issues are unrelated to my modifications.
This PR is a backport to the PR #46725 (Fix cross section when using ResonanceDecayFilter) because there were some issues related to code-checks (the patches given by the bot were impossible to implement).