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

Incorrect xsec_max in RES importance sampling #282

Open
physcxia opened this issue May 18, 2023 · 2 comments
Open

Incorrect xsec_max in RES importance sampling #282

physcxia opened this issue May 18, 2023 · 2 comments

Comments

@physcxia
Copy link

In the importance sampling of RESKinematicsGenerator, the maximal cross section xsec_max is being passed to the envelope function in the following line:

fEnvelope->SetParameter(2, xsec_max); // max differential xsec

The envelope represents a distribution of the transformed kinematic variable $Q_D^2$. However, the variable xsec_max is calculated as the maximal differential cross section, $\frac{d\sigma^{\max}}{dWdQ^2}$, with original $Q^2$,

double xsec_max = (fGenerateUniformly) ? -1 : this->MaxXSec(evrec);

which has incorrect dimension and numerically may be much less than the maximal differential cross section in $Q_D^2$, $\frac{d\sigma^{\max}}{dWdQ_D^2}$, as expected by the envelope.

The phase space kPSWQD2fE instead of kPSWQ2fE should be used in ComputeMaxXSec,

double xsec = fXSecModel->XSec(interaction, kPSWQ2fE);

Could someone help investigate this issue?

@candreop
Copy link
Member

Thanks for the report, Chen. This is somewhat old code, so we will need to refresh our memory about how the importance sampliing envelope was constructed and investigate further. We will try to do this asap. In the mean time, if you are concerned that the actual differential cross-section overshoots the importance sampling envelope and, therefore, the generation of kinematics distorts the inputs cross-section modek, you can use the safety check implemented in KineGeneratorWithCache::AssertXSecLimits() - See https://github.com/GENIE-MC/Generator/blob/25df35f9ca97b6eeab79308b6b49974ffb01d4ef/src/Physics/Common/KineGeneratorWithCache.cxx.
You can enable this check by setting the MaxXSec-DiffTolerance in https://github.com/GENIE-MC/Generator/blob/master/config/RESKinematicsGenerator.xml

@candreop
Copy link
Member

Follow up by Chen Xia:

Following your suggestions, we set MaxXSec-DiffTolerance = 0.1 and tested with the following command using GENIE R-3_04_00:

gevgen -n 10000 -e 5.0 -p 12 -t 1000260560 --cross-sections ./genie_xsec/v3_04_00/NULL/G1802a00000-k250-e1000/data/gxspl-NUsmall.xml --seed 171872 --event-generator-list NCRES

This test was passed.

However, we found an issue with the test code implemented in RESKinematicGenerator.cxx, which is at Line 215:

this->AssertXSecLimits(interaction, xsec, max);

This comparison between xsec and max is incorrect because xsec is the differential cross section in terms of Q^2, but the max is the value of the envelope which is a function of QD^2.

We have tried to correct this line as follows:

this->AssertXSecLimits(interaction, xsec*J, max);

where the Jacobian J is inserted. In this case, the test was failed even if setting a large tolerance of MaxXSec-DiffTolerance = 100.

We would greatly appreciate any further guidance or assistance you can provide regarding this matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants