Creating neutron collimator

I have developed a neutron collimator, and now I aim to shield it using lead material, similar to the illustration I’ve provided. I attempted to implement this by adopting code snippets from various forum threads, but encountered errors, and the resulting geometry doesn’t resemble my desired configuration. Could someone assist me in rectifying these issues? Below is the code I utilized.

"LeadSize = 23cm;
Lead_Box2 = new G4Box(“Lead2”, //its name
30
cm/2,LeadSize/2,3*cm/2); //its dimensions

Lead_LV2 = new G4LogicalVolume(Lead_Box2)
//its shape
leadMaterial, //its material
“Lead_2”); //its name

G4RotationMatrix* rot180 = new G4RotationMatrix(G4ThreeVector(1,0,0), 180deg);
Lead_PV2 = new G4PVPlacement(0, // no rotation around x-axis
G4ThreeVector(0
cm,26.5cm,5cm), // at (0,26.5,5)
Lead_LV2, // its logical volume
“Lead1”, // its name
fLBox, // its mother volume
false, // no boolean operation
0, // copy number
true); // check for overlaps

G4VisAttributes* yellow= new G4VisAttributes(G4Colour::Yellow());

yellow->SetVisibility(true);
yellow->SetForceAuxEdgeVisible(true);

Lead_LV2->SetVisAttributes(yellow);

"

literature_geometry

Geant4 Version: geant4-v11.1.3

_Operating System: Ubuntu 20.04.6 LTS

_Compiler/Version: c++
_CMake Version: VERSION 2.6 FATAL_ERROR


It is hard to tell from your picture which pieces are in the wrong place, or have the wrong dimensions. I would recomend starting with one section at a time, placing and visualizing, and adding one by one. If the new piece is in the wrong place, it should be easy to see which dimension/location needs to be changed.

It does look like you have placed multiple of the white boxes. Because your design is just nested rectangles, I would place the largest one, then place the next largest on inside of it using the largest as a mother volume, all the way down to the smaller one. Similar to how you used a smaller volume in your collimator.

Thank you very much. I am doing exactly that now. I think I have seen where the mistake is, and I am trying to fix it. Thank you very much.