Translation of mother volume causing overlapping

Hi, I have a mother volume shaped like a simple cube, within which I’ve defined a complex geometry composed of roughly 20 smaller volumes. Recently, I decided to customize the mother volume to precisely match the shape of my geometry. To achieve this, I employed a G4Sphere with a radius of 332 mm and a theta angle of 8 degrees. I performed a translation to position the mother volume on top of my geometry.

However, during this translation, I encountered visual artifacts where the geometry volumes appear to overlap with the mother volume in the visualization, even though there is no physical overlap in the underlying geometry.


Dear @mogola
The translation of your geometry and the use of G4Sphere with a theta angle of 8 degree migh have created some overlaps in the system.
Remember that the dauthers’ coordinates are defined ralatively to the mother position. For example, a cube of 2 cm dimension will overlap with the above mentioned sphere (50 cm) mother when located at the center only because of the 8 degree theta angle. A simplified view is below
image

Thanks for the reply!
However, when I created the sphere, I set both the inner and outer radii to avoid this overlap. I attempted to make it hollow.

Check your sphere settings, then. Is it possible that you set the inner radius based on the simple cube dimenions, rather than the diagonal distance along your wedge?

1 Like

Check the inner radius according to the box dimensions. I think something is definitely overlapping there. You may also share parts of the geometry for faster issue identification and resolution.

Here is the piece of code:

G4double pmtGlassThickness = 2.0mm;
G4double pmtGlassRadius = 53.0
mm;
G4double pmtCylRadius = 40.15mm;
G4double pmtTubeRadius = 26.1
mm;
G4double pmtCylHeight = 18.0mm;
G4double pmtConeHeight = 20.0
mm;

///////////////////////////////Defining World Volume/////////////////////////////////
G4Sphere mainSolid = new G4Sphere(“mainSolid”,
339.9
mm,
340.mm,
0.0
deg, 360.0deg,
0.0, 8.02
deg);

G4Tubs coneWorld = new G4Tubs(“coneSolid”,
46.9
mm,
47*mm,
51.*mm,
0.*deg, 360.*deg);

G4UnionSolid *motherSolid = new G4UnionSolid(“motherSolid”,
coneWorld,
mainSolid,
0,
G4ThreeVector(0.,0.,-286.*mm));

////////////////////////////////////////////////////////////////////////////////////

G4LogicalVolume *logicWorld = new G4LogicalVolume(//solidWorld,
motherSolid,
Air1,
//Water,
“logicWorld”);

G4Cons *SolidCone = new G4Cons(“pmtCone”,
pmtTubeRadius-pmtGlassThickness,
pmtTubeRadius,
pmtCylRadius-pmtGlassThickness,
pmtCylRadius,
pmtConeHeight/2.*mm,
0.*deg, 360.*deg);

G4Tubs *tube = new G4Tubs(“tube”,
pmtCylRadius-pmtGlassThickness,
pmtCylRadius,
pmtCylHeight/2.*mm,
0.*deg, 360.*deg);
G4UnionSolid combineSolid1 = new G4UnionSolid(“tubeplusreflection”,
SolidCone,
tube,
0,
G4ThreeVector(0.,0.,19.0
mm));

G4LogicalVolume *logicCombine1 = new G4LogicalVolume(combineSolid1,
PMTGlass,
“logicCombine1”);

G4VPhysicalVolume *glassTube = new G4PVPlacement(0,
G4ThreeVector(0.,0.,0.),
logicCombine1,
“glassTube”,
logicWorld,
false,
0,
true);

G4Box *solidCutOff = new G4Box(“cutOffTubs”,
pmtGlassRadius+1.*cm,
pmtGlassRadius+1.cm,
34.597
mm);

G4Sphere pmtGlassSolid = new G4Sphere(“pmtglass”,
pmtGlassRadius-pmtGlassThickness,
pmtGlassRadius,
0.0
deg, 360.0deg,
0.0, 90
deg);

G4SubtractionSolid pmtBulb = new G4SubtractionSolid(“pmtInnerglass”,
pmtGlassSolid,
solidCutOff);
G4Transform3D transform(G4Translate3D(0.0, 0.0, -17.702
mm));

pmtGlassLogic = new G4LogicalVolume(pmtBulb,
PMTGlass,
“pmtGlassLogic”);

G4VPhysicalVolume pmtSphere = new G4PVPlacement(0,
//G4ThreeVector(0.,0.,-18.097
mm),
G4ThreeVector(0.,0.,-6.597*mm),
pmtGlassLogic,
“pmtSphere”,
logicWorld,
false,
0,
true);