Problem 2545 - 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.
Summary: In the G4PVReplica() function, when creating a cylinder model, the child body...
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/volumes (show other problems)
Version: 11.1
Hardware: PC Windows
: P4 minor
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2023-05-22 10:41 CEST by HahA
Modified: 2023-05-22 13:07 CEST (History)
0 users

See Also:


Attachments
from B1 (11.25 KB, text/plain)
2023-05-22 10:41 CEST, HahA
Details

Note You need to log in before you can comment on or make changes to this problem.
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.