refactor: introduce PhysicalVolume class and update Geant scene hierarchy to use logical and physical volumes
This commit is contained in:
@@ -25,11 +25,17 @@ int main() {
|
||||
scene.ConstructWorldBox(Vector3f(30_m, 30_m, 30_m), "G4_AIR");
|
||||
|
||||
// 2. Create iron cube (1m x 1m x 1m) at center
|
||||
ContainerBox iron_box(Vector3f(1000, 1000, 1000)); // mm
|
||||
Geant::BoxSolid *iron_cube = new Geant::BoxSolid("IronCube", &iron_box);
|
||||
iron_cube->SetNistMaterial("G4_Fe");
|
||||
iron_cube->Update(); // apply dimensions
|
||||
scene.AddSolid(iron_cube);
|
||||
ContainerBox *iron_box = new ContainerBox(Vector3f(1000, 1000, 1000)); // mm
|
||||
Geant::BoxSolid *iron_cube = new Geant::BoxSolid("IronCube", iron_box);
|
||||
|
||||
Geant::Material *iron_mat = new Geant::Material("G4_Fe");
|
||||
Geant::LogicalVolume *iron_lv = new Geant::LogicalVolume("IronCube_lv");
|
||||
iron_lv->SetSolid(iron_cube);
|
||||
iron_lv->SetMaterial(iron_mat);
|
||||
iron_lv->Update();
|
||||
|
||||
Geant::PhysicalVolume *iron_pv = new Geant::PhysicalVolume("IronCube", iron_lv);
|
||||
scene.AddVolume(iron_pv);
|
||||
|
||||
// 3. Set up emitter (default: mu- at 1 GeV, from z=+10m downward)
|
||||
Geant::EmitterPrimary *emitter = new Geant::EmitterPrimary();
|
||||
|
||||
Reference in New Issue
Block a user