I am trying to make a box without one of its surfaces. I have realized I must use G4SubtractionSolid, but I am having no success in making a solution to remove only one face of the cube correctly. Therefore, I would be glad to learn a good solution to this problem.
G4Box) in Geant4 are not “hollow containers”. They are solid volumes. You can’t just “remove a face” the way you’re imagining.
For a “box container”, consider a cardboard carton. In Geant4, that volume would consist of the six (or five, in your case) panels of cardboard, each with a finite, but small, thickness.
You can construct this in Geant4 in four completely different ways.
G4Polyhedra and make it as a single volume, by defining appropriate R-Z planes and specifying that you want four sides.
G4SubtractionSolid and subtract a
G4Box corresponding to the inner empty region from a
G4Box corresponding to the outer solid region.
G4UnionSolid (or better,
G4MultiUnion to build your hollow box out of five flat
G4Box panels, with appropriate orientation and center positions.
You can also place a
G4Box of air or vacuum as a daughter volume of your solid box. But if you have anything going “inside the box”, you would then have to place them as daughters of that air/vacuum volume.