Geometry Biasing for G4PVParameterised(G4PVReplica)

_Geant4 Version:_11.01
_Operating System:_Ubuntu 22.04
_Compiler/Version:_GCC 11.4.0 x86_64-linux-gnu
_CMake Version:_3.23.1

I am trying to assign importance to a G4PVParameterised volume.
So I’ve tried two method

  1. Using SetBaisWeight function for logical volume
  2. G4IStore AddImportanceGeometryCell from Geant4 exmaple/extended/biasing/B01

but both way seem not appliable to G4PVParameterised volume.

For the SetBiasWeight function, I tried two approach.
a. SetBiasWeight for *pLogical, from

b. SetBiasWeight for logical volumes one by one, by accessing G4VPVParameterisation pParam, calling each G4PhysicalVolume* phy, phy->GetLogicalVolume()->SetBiasWeight(G4double 2.0), inside ComputeMaterial member function since this function has G4int repNo and G4VPhysicalVolume currentVol as parameters.

G4Material* TETParameterisation::ComputeMaterial(const G4int copyNo,
                                             G4VPhysicalVolume* phy,
                                             const G4VTouchable* )
return (some G4Material* type thing)

but both approach seem, simply not apply importance to a G4PVParameterised volume.

For the exmaple/extended/biasing/B01 method, I also tried two approach.
a. use AddImportanceGeometryCell to G4PVParameterised volume.

G4IStore* istore = G4IStore::GetInstance();
istore->AddImportanceGeometryCell(1, *fWorldPhysical, 0);
istore->AddImportanceGeometryCell(3, *ParameterisedVolume, 1);

Since G4PVParameterised is inheriting from G4VReplica, and G4VReplica is inheriting from G4VPhysicalVolume, I thought this apporach may work.

b. declare G4IStore instance inside the constructor of G4PVParameterisation, use AddImportanceGeometryCell function inside ComputeMaterial member function one by one for the G4VPhysicalVolume* currentVol, returns G4IStore instance to the main.cpp

for a. approach, it returns exception error

EEEE ------- G4Exception-START -------- EEEE -------
G4Exception : GeomBias0002
issued by : G4IStore::Error()
AddImportanceGeometryCell() - Physical volume not found!
Fatal Exception *** core dump ***
Track information is not available at this moment
Step information is not available at this moment
EEEE -------- G4Exception-END --------- EEEE ------
*** G4Exception: Aborting execution ***
Aborted (core dumped)

for b. approach, during RunManager’s Initialize() operation, segmentaion error occurs.

So my question is these

  1. Geometry Biasing for G4PVParameterised volume is possible?
  2. If so, using SetBiasWeight or AddImportanceGeometryCell is appropriate way for G4PVParameterised volume? It should work but did I something wrong or should I use other method?

Thank you

To my knowledge biasing has not been tested with G4PVParameterised volumes. I will have to look in more detail to see why it fails. Could you create a bug report so that it’s easier to track and propose a resolution?

1 Like

Thank you for your reply.
I could perform geometry biasing for parameterised volume by using geant4 example/extended/biasing/GB03.
But It would be convenient if SetBiasWeight function could be appliable to G4PVParameterised volume too. So, which information might be needed for the bug report?
Plus, I cannot compile example/extended/biasing/GB06.
Geant4 patch note says “Replaced use of deprecated G4TouchableHistoryHandle with G4TouchableHandle.”, but I have to change code inside “GB06BOptnSplitAndKillByImportance.hh”

   G4TouchableHistoryHandle                   fPreStepTouchableHistory;
   G4TouchableHistoryHandle                  fPostStepTouchableHistory;

like this. Now It runs but I don’t know why it failed.


The bug report would be basically what you wrote in your first post - i.e. that B01 fails to apply biasing to G4PVParameterised volumes - this is the Geometrical Importance Biasing (for which I’m responsible). All the details you posted would be sufficient. That way we can keep track of it and also you’ll get notifications.

GB03 and GB06 are part of the generic biasing, which is by nature more extensible and broadly applicable, but with a different API and framework. If that fails to compile with v11.2 then I would suggest submitting another bug report giving your specific platform and compiler etc…


1 Like