vtkGeantEvent

This commit is contained in:
AndreaRigoni
2026-03-16 17:51:53 +00:00
parent c63a1ae047
commit d8ef413216
31 changed files with 509 additions and 155 deletions

View File

@@ -5,6 +5,7 @@
#include "Math/ContainerBox.h"
#include "Math/TriangleMesh.h"
#include "Math/Dense.h"
#include "Math/Units.h"
#include "testing-prototype.h"
#include <Geant4/G4Material.hh>
#include <Geant4/G4NistManager.hh>
@@ -20,9 +21,8 @@ int main() {
// Test: Scene with iron cube in air, launch muons, collect events //
{
// 1. Create world box (air, 30m x 30m x 30m)
ContainerBox world_box(Vector3f(30000, 30000, 30000)); // mm
Geant::Scene scene;
scene.ConstructWorldBox(&world_box, "G4_AIR");
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

View File

@@ -8,10 +8,8 @@ using namespace uLib;
int main() {
uLib::ContainerBox world_box(Vector3f(100, 100, 100));
uLib::Geant::Scene scene;
scene.ConstructWorldBox(&world_box, "G4_AIR");
scene.ConstructWorldBox(Vector3f(100, 100, 100), "G4_AIR");
scene.Initialize();
return 0;

View File

@@ -15,9 +15,12 @@ int main() {
// Test Solid initialization and NIST material //
{
Geant::Solid solid("test_solid");
TEST1(solid.GetLogical() != nullptr);
// Logical volume is not created until material and solid are set
TEST1(solid.GetLogical() == nullptr);
solid.SetNistMaterial("G4_AIR");
// Still null because base Solid has no GetG4Solid()
TEST1(solid.GetLogical() == nullptr);
TEST1(solid.GetMaterial() != nullptr);
TEST1(solid.GetMaterial()->GetName() == "G4_AIR");
}
@@ -25,6 +28,7 @@ int main() {
// Test TessellatedSolid with a simple mesh //
{
Geant::TessellatedSolid tsolid("test_tessellated");
tsolid.SetNistMaterial("G4_AIR");
TEST1(tsolid.GetLogical() != nullptr);
TEST1(tsolid.GetSolid() != nullptr);