Weight=0 error with cross section biasing.
When using cross section biasing as follows:
biasDef1: xsecBias, particle="proton", proc="all", xsecfact=1000, flag=1;
An error occurs in BDSEnergySamplerSD in which the weight of a particle is 0.
BDSEnergySamplerSD checks if the weight of a particle is zero and if it is, exits with an error.
This occured when firing 400GeV protons into 0.1mm of tungsten.
Comments (8)
-
-
reporter BDSEnergyCounterSD, not BDSEnergySamplerSD
-
It seems these lines were added by you: https://bitbucket.org/jairhul/bdsim/commits/99314f94072184a5e1755ee9881aae7e3d44edc7#chg-src/BDSEnergyCounterSD.cc
What is the rationale behind those lines? I feel that it is the wrong place to check on weight 0, and that if one wants to cut on those tracks, one should rather do it in BDSStackingAction or BDSSteppingAction?
Shall we just remove those lines? Would that fix the issue for you or did I misunderstand?
-
reporter I agree one should rather do this check in BDSStackingAction or BDSSteppingAction. Removing those lines would remove the error and the program would run correctly but perhaps produce incorrect output. We should also correct the root cause - the existence of weight=0 particles brought about by using the biasing feature as I would like to be able to use this feature without producing incorrect output. Perhaps weight=0 could be valid in some cases but to me it seems indicative of a bug and warrants further attention.
-
Assigning to @stewartboogert who implemented the biasing. @ldeacon : could you attach a minimum working example?
-
-
assigned issue to
-
assigned issue to
-
I've removed the exit on weight = 0. This should allow the events to progress to completion. I'll leave the issue open though as to whether this is valid behaviour or not.
-
- changed status to resolved
We don't seem to encounter this anymore. The explicit check on 0 has been removed. We've since generated several billion events in various studies using cross-section biasing without issue or 0 weights.
- Log in to comment
There is no class named BDSEnergySamplerSD in develop. Is this in a specific branch?