add Geant namespace
This commit is contained in:
@@ -34,7 +34,9 @@
|
|||||||
#cmakedefine HAVE_FLOOR
|
#cmakedefine HAVE_FLOOR
|
||||||
|
|
||||||
/* Having Geant4 installed */
|
/* Having Geant4 installed */
|
||||||
|
#ifndef HAVE_GEANT4
|
||||||
#cmakedefine HAVE_GEANT4
|
#cmakedefine HAVE_GEANT4
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
#cmakedefine HAVE_INTTYPES_H
|
#cmakedefine HAVE_INTTYPES_H
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ find_package(Qt6 COMPONENTS Widgets REQUIRED)
|
|||||||
find_package(Geant4)
|
find_package(Geant4)
|
||||||
if(Geant4_FOUND)
|
if(Geant4_FOUND)
|
||||||
message(STATUS "Geant4 libs: ${Geant4_LIBRARIES}")
|
message(STATUS "Geant4 libs: ${Geant4_LIBRARIES}")
|
||||||
add_compile_definitions(HAVE_GEANT)
|
add_compile_definitions(HAVE_GEANT4)
|
||||||
set(HAVE_GEANT4 1)
|
set(HAVE_GEANT4 1)
|
||||||
|
|
||||||
# Sanitize Geant4 targets to remove Qt5 dependencies that conflict with VTK/Qt6
|
# Sanitize Geant4 targets to remove Qt5 dependencies that conflict with VTK/Qt6
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ int main(int argc, char** argv) {
|
|||||||
d2.Translate(Vector3f(0, 0, 10));
|
d2.Translate(Vector3f(0, 0, 10));
|
||||||
|
|
||||||
|
|
||||||
Scene scene;
|
Geant::Scene scene;
|
||||||
scene.ConstructWorldBox(&world_box, "G4_AIR");
|
scene.ConstructWorldBox(&world_box, "G4_AIR");
|
||||||
scene.Initialize();
|
scene.Initialize();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
#include "ActionInitialization.hh"
|
#include "ActionInitialization.hh"
|
||||||
#include "EmitterPrimary.hh"
|
#include "EmitterPrimary.hh"
|
||||||
|
|
||||||
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
ActionInitialization::ActionInitialization() : G4VUserActionInitialization() {}
|
ActionInitialization::ActionInitialization() : G4VUserActionInitialization() {}
|
||||||
|
|
||||||
ActionInitialization::~ActionInitialization() {}
|
ActionInitialization::~ActionInitialization() {}
|
||||||
@@ -23,3 +26,6 @@ void ActionInitialization::Build() const {
|
|||||||
// SetUserAction(new EventAction());
|
// SetUserAction(new EventAction());
|
||||||
// SetUserAction(new SteppingAction());
|
// SetUserAction(new SteppingAction());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
|
} // namespace uLib
|
||||||
@@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
#include "G4VUserActionInitialization.hh"
|
#include "G4VUserActionInitialization.hh"
|
||||||
|
|
||||||
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
class ActionInitialization : public G4VUserActionInitialization {
|
class ActionInitialization : public G4VUserActionInitialization {
|
||||||
public:
|
public:
|
||||||
ActionInitialization();
|
ActionInitialization();
|
||||||
@@ -15,4 +18,7 @@ public:
|
|||||||
virtual void Build() const;
|
virtual void Build() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
|
} // namespace uLib
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "G4SystemOfUnits.hh"
|
#include "G4SystemOfUnits.hh"
|
||||||
|
|
||||||
namespace uLib {
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
DetectorConstruction::DetectorConstruction(const char *name) : G4VUserDetectorConstruction() {}
|
DetectorConstruction::DetectorConstruction(const char *name) : G4VUserDetectorConstruction() {}
|
||||||
|
|
||||||
@@ -21,9 +22,5 @@ G4VPhysicalVolume *DetectorConstruction::Construct() { return nullptr; }
|
|||||||
|
|
||||||
void DetectorConstruction::ConstructSDandField() {}
|
void DetectorConstruction::ConstructSDandField() {}
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
|
} // namespace uLib
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -9,6 +9,7 @@ class G4VPhysicalVolume;
|
|||||||
class G4LogicalVolume;
|
class G4LogicalVolume;
|
||||||
|
|
||||||
namespace uLib {
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
class DetectorConstruction : public G4VUserDetectorConstruction {
|
class DetectorConstruction : public G4VUserDetectorConstruction {
|
||||||
public:
|
public:
|
||||||
@@ -20,6 +21,7 @@ public:
|
|||||||
virtual void ConstructSDandField();
|
virtual void ConstructSDandField();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
} // namespace uLib
|
} // namespace uLib
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
#include "G4SystemOfUnits.hh"
|
#include "G4SystemOfUnits.hh"
|
||||||
#include "Randomize.hh"
|
#include "Randomize.hh"
|
||||||
|
|
||||||
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
EmitterPrimary::EmitterPrimary()
|
EmitterPrimary::EmitterPrimary()
|
||||||
: G4VUserPrimaryGeneratorAction(), fParticleGun(nullptr) {
|
: G4VUserPrimaryGeneratorAction(), fParticleGun(nullptr) {
|
||||||
// Creiamo il ParticleGun impostandolo per sparare 1 particella alla volta
|
// Creiamo il ParticleGun impostandolo per sparare 1 particella alla volta
|
||||||
@@ -147,3 +150,6 @@ void QuadMeshEmitterPrimary::GeneratePrimaries(G4Event *anEvent) {
|
|||||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
|
} // namespace uLib
|
||||||
@@ -4,9 +4,15 @@
|
|||||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||||
#include "globals.hh"
|
#include "globals.hh"
|
||||||
|
|
||||||
|
#include "Math/QuadMesh.h"
|
||||||
|
#include <vector> // Added for std::vector
|
||||||
|
|
||||||
class G4ParticleGun;
|
class G4ParticleGun;
|
||||||
class G4Event;
|
class G4Event;
|
||||||
|
|
||||||
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
class EmitterPrimary : public G4VUserPrimaryGeneratorAction
|
class EmitterPrimary : public G4VUserPrimaryGeneratorAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -21,14 +27,6 @@ class EmitterPrimary : public G4VUserPrimaryGeneratorAction
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "Math/QuadMesh.h"
|
|
||||||
#include <vector> // Added for std::vector
|
|
||||||
|
|
||||||
namespace uLib {
|
|
||||||
class QuadMesh;
|
|
||||||
}
|
|
||||||
|
|
||||||
class QuadMeshEmitterPrimary : public EmitterPrimary
|
class QuadMeshEmitterPrimary : public EmitterPrimary
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -48,6 +46,9 @@ class QuadMeshEmitterPrimary : public EmitterPrimary
|
|||||||
void CalculateAreas();
|
void CalculateAreas();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
|
} // namespace uLib
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
#include "Detectors/ChamberHitEvent.h"
|
#include "Detectors/ChamberHitEvent.h"
|
||||||
|
|
||||||
namespace uLib {
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
class GeantEventData {
|
class GeantEventData {
|
||||||
public:
|
public:
|
||||||
@@ -56,6 +57,7 @@ public:
|
|||||||
uLibRefMacro(ChEvents, Vector<ChamberHitEventData>)
|
uLibRefMacro(ChEvents, Vector<ChamberHitEventData>)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
} // namespace uLib
|
} // namespace uLib
|
||||||
|
|
||||||
#endif // GEANTEVENT_H
|
#endif // GEANTEVENT_H
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class G4Element;
|
|||||||
class G4Material;
|
class G4Material;
|
||||||
|
|
||||||
namespace uLib {
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -65,6 +66,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
#include "G4EmStandardPhysics.hh"
|
#include "G4EmStandardPhysics.hh"
|
||||||
#include "G4RadioactiveDecayPhysics.hh"
|
#include "G4RadioactiveDecayPhysics.hh"
|
||||||
|
|
||||||
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
PhysicsList::PhysicsList() : G4VModularPhysicsList() {
|
PhysicsList::PhysicsList() : G4VModularPhysicsList() {
|
||||||
SetVerboseLevel(1);
|
SetVerboseLevel(1);
|
||||||
|
|
||||||
@@ -20,3 +23,6 @@ PhysicsList::PhysicsList() : G4VModularPhysicsList() {
|
|||||||
PhysicsList::~PhysicsList() {}
|
PhysicsList::~PhysicsList() {}
|
||||||
|
|
||||||
void PhysicsList::SetCuts() { G4VModularPhysicsList::SetCuts(); }
|
void PhysicsList::SetCuts() { G4VModularPhysicsList::SetCuts(); }
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
|
} // namespace uLib
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
#include "G4VModularPhysicsList.hh"
|
#include "G4VModularPhysicsList.hh"
|
||||||
|
|
||||||
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
class PhysicsList : public G4VModularPhysicsList {
|
class PhysicsList : public G4VModularPhysicsList {
|
||||||
public:
|
public:
|
||||||
PhysicsList();
|
PhysicsList();
|
||||||
@@ -11,4 +14,7 @@ public:
|
|||||||
virtual void SetCuts();
|
virtual void SetCuts();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
|
} // namespace uLib
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include "ActionInitialization.hh"
|
#include "ActionInitialization.hh"
|
||||||
|
|
||||||
namespace uLib {
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
class SceneDetectorConstruction : public DetectorConstruction {
|
class SceneDetectorConstruction : public DetectorConstruction {
|
||||||
public:
|
public:
|
||||||
@@ -146,4 +147,5 @@ void Scene::Initialize() {
|
|||||||
d->Initialize();
|
d->Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
} // namespace uLib
|
} // namespace uLib
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
class G4VPhysicalVolume;
|
class G4VPhysicalVolume;
|
||||||
|
|
||||||
namespace uLib {
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
class Scene : public Object {
|
class Scene : public Object {
|
||||||
public:
|
public:
|
||||||
@@ -51,5 +52,6 @@ private:
|
|||||||
class SceneImpl *d;
|
class SceneImpl *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
} // namespace uLib
|
} // namespace uLib
|
||||||
#endif // SCENE_H
|
#endif // SCENE_H
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
#include "Solid.h"
|
#include "Solid.h"
|
||||||
|
|
||||||
namespace uLib {
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
class DetectorsSolidImpl {
|
class DetectorsSolidImpl {
|
||||||
public:
|
public:
|
||||||
@@ -175,4 +176,5 @@ void BoxSolid::Update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
} // namespace uLib
|
} // namespace uLib
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class G4TessellatedSolid;
|
|||||||
class G4Box;
|
class G4Box;
|
||||||
|
|
||||||
namespace uLib {
|
namespace uLib {
|
||||||
|
namespace Geant {
|
||||||
|
|
||||||
class Solid : public Object {
|
class Solid : public Object {
|
||||||
public:
|
public:
|
||||||
@@ -109,6 +110,7 @@ private:
|
|||||||
G4Box *m_Solid;
|
G4Box *m_Solid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Geant
|
||||||
} // namespace uLib
|
} // namespace uLib
|
||||||
|
|
||||||
#endif // SOLID_H
|
#endif // SOLID_H
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ int main(int argc, char **argv) {
|
|||||||
// runManager->SetUserInitialization(new PhysicsList());
|
// runManager->SetUserInitialization(new PhysicsList());
|
||||||
|
|
||||||
// 3. INIZIALIZZAZIONE DELLE AZIONI (Il nostro generatore!)
|
// 3. INIZIALIZZAZIONE DELLE AZIONI (Il nostro generatore!)
|
||||||
runManager->SetUserInitialization(new ActionInitialization());
|
runManager->SetUserInitialization(new uLib::Geant::ActionInitialization());
|
||||||
|
|
||||||
// ... Inizializzazione del kernel ( runManager->Initialize(); ), UI manager,
|
// ... Inizializzazione del kernel ( runManager->Initialize(); ), UI manager,
|
||||||
// vis manager, ecc.
|
// vis manager, ecc.
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ set(TESTS
|
|||||||
SolidTest
|
SolidTest
|
||||||
EventTest
|
EventTest
|
||||||
GeantApp
|
GeantApp
|
||||||
|
ActionInitialization
|
||||||
)
|
)
|
||||||
|
|
||||||
set(LIBRARIES
|
set(LIBRARIES
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ int main() {
|
|||||||
|
|
||||||
// Test Solid initialization and NIST material //
|
// Test Solid initialization and NIST material //
|
||||||
{
|
{
|
||||||
Solid solid("test_solid");
|
Geant::Solid solid("test_solid");
|
||||||
TEST1(solid.GetLogical() != nullptr);
|
TEST1(solid.GetLogical() != nullptr);
|
||||||
|
|
||||||
solid.SetNistMaterial("G4_AIR");
|
solid.SetNistMaterial("G4_AIR");
|
||||||
@@ -25,7 +25,7 @@ int main() {
|
|||||||
|
|
||||||
// Test TessellatedSolid with a simple mesh //
|
// Test TessellatedSolid with a simple mesh //
|
||||||
{
|
{
|
||||||
TessellatedSolid tsolid("test_tessellated");
|
Geant::TessellatedSolid tsolid("test_tessellated");
|
||||||
TEST1(tsolid.GetLogical() != nullptr);
|
TEST1(tsolid.GetLogical() != nullptr);
|
||||||
TEST1(tsolid.GetSolid() != nullptr);
|
TEST1(tsolid.GetSolid() != nullptr);
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using namespace uLib;
|
|||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
uLib::ContainerBox world_box(Vector3f(100, 100, 100));
|
uLib::ContainerBox world_box(Vector3f(100, 100, 100));
|
||||||
uLib::Scene scene;
|
uLib::Geant::Scene scene;
|
||||||
|
|
||||||
scene.ConstructWorldBox(&world_box, "G4_AIR");
|
scene.ConstructWorldBox(&world_box, "G4_AIR");
|
||||||
scene.Initialize();
|
scene.Initialize();
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ int main() {
|
|||||||
|
|
||||||
// Test Solid initialization and NIST material //
|
// Test Solid initialization and NIST material //
|
||||||
{
|
{
|
||||||
Solid solid("test_solid");
|
Geant::Solid solid("test_solid");
|
||||||
TEST1(solid.GetLogical() != nullptr);
|
TEST1(solid.GetLogical() != nullptr);
|
||||||
|
|
||||||
solid.SetNistMaterial("G4_AIR");
|
solid.SetNistMaterial("G4_AIR");
|
||||||
@@ -24,7 +24,7 @@ int main() {
|
|||||||
|
|
||||||
// Test TessellatedSolid with a simple mesh //
|
// Test TessellatedSolid with a simple mesh //
|
||||||
{
|
{
|
||||||
TessellatedSolid tsolid("test_tessellated");
|
Geant::TessellatedSolid tsolid("test_tessellated");
|
||||||
TEST1(tsolid.GetLogical() != nullptr);
|
TEST1(tsolid.GetLogical() != nullptr);
|
||||||
TEST1(tsolid.GetSolid() != nullptr);
|
TEST1(tsolid.GetSolid() != nullptr);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
#if !defined(HAVE_GEANT4) && !defined(HEP_SYSTEM_OF_UNITS_H) && !defined(HEP_PHYSICAL_CONSTANTS_H)
|
||||||
#ifndef CLHEP_defs_h
|
#ifndef CLHEP_defs_h
|
||||||
#define CLHEP_defs_h
|
#define CLHEP_defs_h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace CLHEP {
|
namespace CLHEP {
|
||||||
|
|
||||||
|
|
||||||
@@ -365,4 +368,6 @@ static constexpr double universe_mean_density = 1.e-25*g/cm3;
|
|||||||
|
|
||||||
} // namespace CLHEP
|
} // namespace CLHEP
|
||||||
|
|
||||||
#endif
|
#endif // CLHEP_defs_h
|
||||||
|
#endif // HAVE_GEANT4 / CLHEP checks
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user