Importance sampling multiple particle types

Hi,

I’m having an issue assigning/registering importance bias to two particles. Infact, the assigning only works with whatever I register first.

B01DetectorConstruction* detector = new B01DetectorConstruction();
runManager->SetUserInitialization(detector);
G4GeometrySampler gamma_bias(detector->GetWorldVolume(),“gamma”);
physicsList->RegisterPhysics(new G4ImportanceBiasing(&gamma_bias));
G4GeometrySampler electron_bias(detector->GetWorldVolume(),“e-”);
physicsList->RegisterPhysics(new G4ImportanceBiasing(&electron_bias));

In this case the gammas will be biased.

I also found a similar question from 2016 with the same problem and no solution,

http://hypernews.slac.stanford.edu/HyperNews/geant4/get/biasing_scoring/197.html

Any suggestions?

Dean

Hi,

I don’t think this works. There is a bug report from a couple of years ago:
https://bugzilla-geant4.kek.jp/show_bug.cgi?id=1941

Did you try generic biasing (see examples extended/biasing/GB01 to GB06)? These use the generic biasing physics lists (source/physics_lists/constructors/limiters/include/G4GenericBiasingPhysics.hh) which appear to allow multiple particles.