Geometrical biasing not working on multithread mode


I have some problems running a code, which involve geometrical biasing, in multi-thread mode, namely no biasing is taking place.

The code is running correctly in single-thread mode, the only modification I’ve done is that, as required, the initialization of the RunAction, EventAction, etc… are moved from the main to the ActionInitialization class, while DetectorConstruction and PhysicsList are still initialized in the main; namely

void ActionInitialization::Build() const
PrimaryGeneratorAction* primary = new PrimaryGeneratorAction();

RunAction* runaction = new RunAction();

EventAction* eventaction = new EventAction(histo);

TrackingAction* trackingaction = new TrackingAction(detector, histo);

SteppingAction* steppingaction = (detector, eventaction, histo);
SetUserAction(new SteppingAction);

StackingAction* stackingaction =(detector, eventaction, histo);
SetUserAction( new StackingAction);

int main(int argc,char** argv) {
DetectorConstruction* detector;
detector = new DetectorConstruction;

PhysicsList* aPhysicsList = new PhysicsList();
G4GenericBiasingPhysics* biasingPhysics = new G4GenericBiasingPhysics(); biasingPhysics->NonPhysicsBias(G4Gamma::GammaDefinition()->GetParticleName());

However, if I run the code, even if the multi-threading is working fine, no biasing is happening (all the particles that reach the detector have weight 1; to be sure I added a line of code in the biasing class, that print out a message every time biasing is invoked, no message appears); moreover when I launch the code I can see the following command is executed for each thread:


which is not included in the macro file.
What could be the problem? How could it be fixed?