Problem 2545

Summary: In the G4PVReplica() function, when creating a cylinder model, the child body does not have to be completely filled with the parent body to compile and run properly.
Product: Geant4 Reporter: HahA <lirui-china>
Component: geometry/volumesAssignee: Gabriele Cosmo <Gabriele.Cosmo>
Status: RESOLVED INVALID    
Severity: minor    
Priority: P4    
Version: 11.1   
Hardware: PC   
OS: Windows   
Attachments: from B1

Description HahA 2023-05-22 10:41:04 CEST
Created attachment 813 [details]
from B1

In the G4PVReplica() function, when creating a cylinder model, the child body does not have to be completely filled with the parent body to compile and run properly. just like this.


G4Material* shape1_mat =
	nist->FindOrBuildMaterial("G4_A-150_TISSUE");
G4ThreeVector pos1 = G4ThreeVector(0, 2 * cm, -7 * cm);

auto shape1New = new G4Tubs("ShNew", 0 * cm, 5 * cm, 2.5 * cm,
	0 * deg, 360 * deg);
auto logicShape1 = new G4LogicalVolume(shape1New, shape1_mat,
	"Shape1");

new G4PVPlacement(nullptr,
	pos1, logicShape1, "Shape1", logicEnv, false, 0, checkOverlaps);


auto TubeSmall = new G4Tubs("TbSmall", 0 * cm, 1 * cm, 2.0 * cm,
	0 * deg, 360 * deg);
auto logicTubeSmall = new G4LogicalVolume(TubeSmall, shape1_mat,
	"logicTubeSmall");


new G4PVReplica("RepCyl",
	logicTubeSmall,
	logicShape1,
	kRho, 5, 0.5 * cm, 0);
Comment 1 Gabriele Cosmo 2023-05-22 13:07:07 CEST
Slices in G4PVReplica must fully fill the parent body by specification.
Your code might build and display, but will not work in tracking.
You can define an offset if wished to displace the replication.
There is no control done at construction time for such incorrect replica setup definitions.