I want to create a simple neutron collimator. This is what I want a solid borated polythene made of 30x30x3cm, then a pinhole in the middle. like the picture I have attached. I used this code from the threads here to create it but I get errors and it doesnt look like what I like. Can anyone help me out? this is the code I used.
“”
//The Borated polythylene_block1 with pinhole
BoratedSize = 30cm;
Borated_thickness = 3cm;
Borated_Box1 = new G4Box(“Borated1”, //its name
BoratedSize/2,BoratedSize/2,Borated_thickness/2); //its dimensions
Hole = new G4Box(“BoxHole”, //its name
5cm/2,5cm/2,3*cm/2); //its dimensions
collimator = new G4SubtractionSolid(“collimator”,
Borated_Box1, //its logical volume
Hole, //its mother volume
0,
G4ThreeVector(0cm,0cm,0*cm)
); //copy number
Borated_LV1 = new G4LogicalVolume(collimator, //its shape
b_polyethylene, //its material
“Borated1”); //its name
Borated_PV1 = new G4PVPlacement(0, //no rotation
G4ThreeVector(0cm,0cm,21.5*cm), //at (0,0,0)
Borated_LV1, //its logical volume
“Borated1”, //its name
fLBox, //its mother volume
false, //no boolean operation
0,true); //copy number
G4VisAttributes* green = new G4VisAttributes(G4Colour::Green());
green->SetVisibility(true);
green->SetForceAuxEdgeVisible(true);
Borated_LV1->SetVisAttributes(green);
“”
and this is what I have when I visualized it.
Geant4 Version: geant4-v11.1.3