Message: Importance sampling multiple particle types Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Importance sampling multiple particle types 

Forum: Biasing and Scoring
Date: 30 Mar, 2016
From: Andy Kubik <Andy Kubik>

Hi,

I'm following the general example of extended/biasing/B02 to set up an importance sampling scheme. I would like to be able to apply the importance sampling to both neutrons and gammas at the same time. I tried doing the following in (Geant4-10.1.1):

  B02ImportanceDetectorConstruction* pdet =
                   new B02ImportanceDetectorConstruction(parallelName);
  detector->RegisterParallelWorld(pdet);

  G4GeometrySampler pgs1(pdet->GetWorldVolume(),"neutron");
  G4GeometrySampler pgs2(pdet->GetWorldVolume(),"gamma");

  pgs1.SetParallel(true);
  pgs2.SetParallel(true);

  G4VModularPhysicsList* physicsList = new FTFP_BERT;
  physicsList->RegisterPhysics(new G4ImportanceBiasing(&pgs1,parallelName));
  physicsList->RegisterPhysics(new G4ImportanceBiasing(&pgs2,parallelName));
  physicsList->RegisterPhysics(new G4ParallelWorldPhysics(parallelName));

  runManager->SetUserInitialization(physicsList);

This runs, however it seems the importance sampling is only applied to whichever GeometrySampler I register to the physics list first.

I also tried creating a second instance of B02ImportanceDetectorConstruction with it's own GeometrySampler, like this:

  B02ImportanceDetectorConstruction* pdet1 =
                   new B02ImportanceDetectorConstruction(parallelName1);
  detector->RegisterParallelWorld(pdet1);

  B02ImportanceDetectorConstruction* pdet2 =
                   new B02ImportanceDetectorConstruction(parallelName2);
  detector->RegisterParallelWorld(pdet2);

  G4GeometrySampler pgs1(pdet1->GetWorldVolume(),"neutron");
  G4GeometrySampler pgs2(pdet2->GetWorldVolume(),"gamma");

  pgs1.SetParallel(true);
  pgs2.SetParallel(true);

  G4VModularPhysicsList* physicsList = new FTFP_BERT;
  physicsList->RegisterPhysics(new G4ImportanceBiasing(&pgs1,parallelName1));
  physicsList->RegisterPhysics(new G4ImportanceBiasing(&pgs2,parallelName2));
  physicsList->RegisterPhysics(new G4ParallelWorldPhysics(parallelName1));
  physicsList->RegisterPhysics(new G4ParallelWorldPhysics(parallelName2));

  runManager->SetUserInitialization(physicsList);

  B02ActionInitialization* actions = new B02ActionInitialization;
  runManager->SetUserInitialization(actions);

  runManager->Initialize();

  pdet1->CreateImportanceStore();
  pdet2->CreateImportanceStore();

This also compiles ok but crashes on pdet2->CreateImportanceStore(); claiming that the world volume is not found.

Is there a way to apply the importance sampling to two different particle types like this?

Thanks! - Andy

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Question: Re: Importance sampling multiple particle types   (ACamin - 06 Oct, 2016)
 Add Message Add Message
to: "Importance sampling multiple particle types"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews