Negative cross-section exception with forced collision

Hello,

We are trying to add the forced collision feature into our simulation, as demonstrated in https://gitlab.cern.ch/geant4/geant4/tree/master/examples/extended/biasing/GB02
I added all the relevant code from the example and modified it to our needs:

  • attached to a logical volume of our detector
  • added biasing for pi+ (instead of photon and neutron in the example)

The only difference is that we are using a custom G4VModularPhysicsList. So inside the PhysicsList I added

fBiasPhysicsList = new G4GenericBiasingPhysics();
fBiasPhysicsList->Bias("pi+");

and later in the ConstructProcess method:

fBiasPhysicsList->ConstructProcess();

When running the code, I see the following list of physics processes:

Transportation,               phot,              compt,               conv
Rayl,                msc,              eIoni,              eBrem
CoulombScat,            annihil,             muIoni,            muBrems
muPairProd,              hIoni,             hBrems,          hPairProd
ionIoni,      Scintillation,           Cerenkov,       OpAbsorption
OpBoundary,              OpWLS,              Decay,      photonNuclear
electronNuclear,    positronNuclear,        muonNuclear,         hadElastic
hFritiofCaptureAtRest,hBertiniCaptureAtRest,muMinusCaptureAtRest,         dInelastic
tInelastic,       He3Inelastic,     alphaInelastic,       ionInelastic
nKiller,   neutronInelastic,           nCapture,    protonInelastic
pi-Inelastic,     kaon+Inelastic,     kaon-Inelastic,    kaon0LInelastic
kaon0SInelastic,    lambdaInelastic,anti-lambdaInelastic,    sigma-Inelastic
anti_sigma-Inelastic,    sigma+Inelastic,anti_sigma+Inelastic,       xi-Inelastic
anti_xi-Inelastic,       xi0Inelastic,  anti_xi0Inelastic,    omega-Inelastic
anti_omega-Inelastic,anti_protonInelastic,anti_neutronInelastic,anti_deuteronInelastic
anti_tritonInelastic,  anti_He3Inelastic,anti_alphaInelastic,      DecayWithSpin
biasWrapper(0),   biasWrapper(msc), biasWrapper(hIoni),biasWrapper(hBrems)
biasWrapper(hPairProd),biasWrapper(CoulombScat),biasWrapper(Scintillation),biasWrapper(Cerenkov)
biasWrapper(Decay),biasWrapper(hadElastic),biasWrapper(pi+Inelastic)

And the biasing process seems to start correctly as the track information displays the following information for the original track

*********************************************************************************************************
* G4Track Information:   Particle = pi+,   Track ID = 1,   Parent ID = 0
*********************************************************************************************************
Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
....
12  -5.79 mm   5.88 mm   79.6 m    75.6 GeV     0 eV      0 fm   10.4 m    GigaTrackerCoolingPlate  biasWrapper(0)
....
54  -4.03 mm   5.96 mm    102 m       0 eV   33.5 keV   127 um   33.2 m    GigaTrackerPixels  biasWrapper(pi+Inelastic)

But later, when dealing with the clone of the original track we receive G4Exceptions related to negative cross sections and the biasing seems to fail:

*********************************************************************************************************
* G4Track Information:   Particle = pi+,   Track ID = 3,   Parent ID = 1
*********************************************************************************************************
Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
0  -5.79 mm   5.88 mm   79.6 m    75.6 GeV     0 eV      0 fm   10.4 m    GigaTrackerCoolingPlate    initStep

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : BIAS.GEN.09
      issued by : G4ILawTruncatedExp::SetForceCrossSection(..)
Cross-section value passed is negative. It is set to zero !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : BIAS.GEN.14
      issued by : G4InteractionLawPhysical::SetPhysicalCrossSection(..)
Cross-section value passed is negative. It is set to zero !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : BIAS.GEN.20.2
      issued by :  G4BOptrForceCollision::OperationApplied(...)
 Internal inconsistency : please submit bug report. 
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
...
185  -80.2 cm   6.89 mm    300 m    75.6 GeV1.42e-15 eV   35.7 m     231 m    OutOfWorld  Transportation

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : BIAS.GEN.18
      issued by :  G4BOptrForceCollision::EndTracking()
Current track deleted while under biasing by ForceCollisionForpi+. Will result in inconsistencies.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : BIAS.GEN.19
      issued by :  G4BOptrForceCollisionTrackData::~G4BOptrForceCollisionTrackData()
Track deleted while under G4BOptrForceCollision biasing scheme of operator `ForceCollisionForpi+'. Will 
result in inconsistencies.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

I suppose the difference is linked to the physics list, which is the only significant difference between this code and the example. I can provide the full code of the PhysicsList if necessary.

Can you confirm the origin of the problem? If this is the case, can you advise on how to fix our physics list to allow for the biasing?