I am trying to count hits in a pixelated detection volume, realized with nested
G4Replica volumes like so:
// 1. Mother volume - sensor G4Box* sensor = new G4Box( "sensor", (pixelSize * Nx) / 2.0, (pixelSize * Ny) / 2.0, pixelThickness/ 2.0 ); G4LogicalVolume* sensorLV = new G4LogicalVolume(sensor, Si, sensor->GetName()); // 2. Replica volume - column G4Box* col = new G4Box( "pixelcolumn", pixelSize / 2.0, (Ny*pixelSize) / 2.0, pixelThickness / 2.0); G4LogicalVolume* colLV = new G4LogicalVolume(col, Si, col->GetName()); new G4PVReplica(colLV->GetName(), colLV, sensorLV, kXAxis, Nx, pixelSize); // 3. Replica volume - row G4Box* row = new G4Box( "pixel", pixelSize / 2.0, pixelSize / 2.0, pixelThickness / 2.0); l_sensor = new G4LogicalVolume(row, Si, row->GetName()); new G4PVReplica(l_sensor->GetName(), l_sensor, colLV, kYAxis, Ny, pixelSize); new G4PVPlacement( rot1, pos1, sensorLV, sensor->GetName(), fWorldVolume, 0, 0, false); new G4PVPlacement( rot2, pos2, sensorLV, sensor->GetName(), fWorldVolume, 0, 1, false);
now I try to score an energy histogram of volumeFlux and the dose deposit for the two volumes with a macro as follows:
/score/create/realWorldLogVol sensor 2 /score/quantity/volumeFlux flux /score/quantity/doseDeposit dose /score/close /analysis/h1/create sensor1volFlux volFlux_sensor1 180 0 450 keV /analysis/h1/create sensor2volFlux volFlux_sensor2 180 0 450 keV /score/fill1D 0 pixel flux 0 /score/fill1D 1 pixel flux 1
and — it does not work as expected: All histogram bins are zero…
It seems that the G4Replica inside the
sensor-volume is obscured by the
G4Replica structure inside!?
realWorldLogVol command to use the “pixel” volume instead, things work almost as expected: now the histogram bins are filled with values, and I also get the dose dumped. however: there are as many values as there are pixels per column, all of which except for entry 0 and 1 are again zero.
Alternatively, I used a
G4VSensitiveDetector instead of the command based approach: again, using “sensor” as the detection logical volume yields zero hits, I can however generate hits with the “pixel” LV.
Is this behaviour anticipated? I was expecting the structure to behave like a nested structure of LVs (pixel inside pixelcolumn inside sensor), instead it seems the pixels obscure the column and the sensor!? Am I doing something fundamentally wrong?
Thanks a lot in advance!
- wrapping the mother volume into an additional volume (of the same size as the previous mother volume) can also not be used as a sensitive detector / realWorldLogVol scorer. Changing the size by 1um makes it work.
- Adapting divisions instead of replica Physical Volumes — Book For Application Developers 10.7 documentation does not work for me, the G4Para constructor does not exist anymore in 10.7.2!?