GENIE-MC / Generator

The popular GENIE Generator product is used by nearly all accelerator neutrino experiments and it plays a key role in the exploitation of neutrino data. The Generator implements a modern software framework and it includes state-of-the-art physics modules. It captures the latest results of the GENIE global analysis of neutrino scattering data and includes several tunes that were produced using the proprietary Comparisons and Tuning products. The GENIE physics model is universal and comprehensive: It handles all neutrinos and targets, and all processes relevant from MeV to PeV energy scales. The Generator includes several tools (flux drivers, detector geometry navigators, specialized event generation apps, event reweighting engines) to simulate complex experimental setups in full detail and to support generator-related analysis tasks.
http://www.genie-mc.org
42 stars 92 forks source link

fix RESKinematicsGenerator #291

Closed idkakorin closed 1 year ago

idkakorin commented 1 year ago

Fixing of the problem with RESKinematicsGenerator reported in issue #282 .

I suggest getting rid of the variable QD2 to avoid confusion with Jacobian, variable transformation and global maximum searching. The function double genie::utils::kinematics::RESImportanceSamplingEnvelope(double * x, double * par) is used only in RESKinematicsGenerator.cxx, therefore it should not cause problems anywhere else. All changes are trivial.

candreop commented 1 year ago

Hi Igor: the transformation from Q2 to Q2_d = 1/(1+Q2/c), was done to flatten the differential cross-section by taking out the dipole form. It is easy to remove the transformation and the code would work. But what is the impact on efficiency? If it now becomes much slower, perhaps we want to keep it and fix what is wrong with the sampling envelope? But we need some assessment of CPU efficiency first. Please can you check how fast you can generate RES events w/ and w/o that transformation?

idkakorin commented 1 year ago

Hi Igor: the transformation from Q2 to Q2_d = 1/(1+Q2/c), was done to flatten the differential cross-section by taking out the dipole form. It is easy to remove the transformation and the code would work. But what is the impact on efficiency? If it now becomes much slower, perhaps we want to keep it and fix what is wrong with the sampling envelope? But we need some assessment of CPU efficiency first. Please can you check how fast you can generate RES events w/ and w/o that transformation?

Hi Costas! I understand your point about flattering, but straightforward comparison of previous version and proposed fix would not be quite correct, because in the previous version of code some of the events are accepted, although they should have been rejected. Anyway, such comparison shows, that without fix time/event: 0.00597427 s, with fix: 0.0499688 s.

idkakorin commented 1 year ago

Now, the maximum is searched in W, QD2 variables. We decided to get rid of envelope. The test runs of the command: time gevgen -p 14 -t 1000010010 -n 10000 -e 0.1,100 -f 1 --cross-sections out.xml --tune G00_00a_00_000 --event-generator-list RES showed that it works faster with this option, see Presentation.pdf.