material printout added but doesn't work yet
This commit is contained in:
+2
-1
@@ -23,7 +23,8 @@ void makeG4System(M& m, std::string name){
|
||||
.def("run_gui", &G4System::run_gui)
|
||||
.def("run_batch", &G4System::run_batch, py::arg("nEvents"), py::arg("partSpecies"), py::arg("minEnergy_GeV"), py::arg("maxEnergy_GeV"))
|
||||
.def("run_visualize", &G4System::run_visualize, py::arg("partSpecies"), py::arg("minEnergy_GeV"), py::arg("maxEnergy_GeV"))
|
||||
.def("applyUICommand", &G4System::applyUICommand, py::arg("command"));
|
||||
.def("applyUICommand", &G4System::applyUICommand, py::arg("command"))
|
||||
.def("printMaterial", &G4System::printMaterial, py::arg("name"));
|
||||
}
|
||||
|
||||
PYBIND11_MODULE(minicalo, m) {
|
||||
|
||||
+2
-1
@@ -10,4 +10,5 @@ G4s = G4System()
|
||||
G4s.init(cw)
|
||||
G4s.run_batch(100, "gamma", 1, 5) #100 events, photons, 1000 MeV to 5000 MeV
|
||||
|
||||
G4s.run_visualize("gamma", 1, 5)
|
||||
#G4s.run_visualize("gamma", 1, 5)
|
||||
G4s.printMaterial("G4_Pb")
|
||||
@@ -45,6 +45,7 @@ void applyUICommand(const std::string& command){
|
||||
|
||||
void displayEvent()const{}; //just a placeholder, this will be implemented in python
|
||||
|
||||
void printMaterial(const std::string& name)const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
|
||||
#include "G4System.hh"
|
||||
#include <G4Material.hh>
|
||||
#include <G4NistManager.hh>
|
||||
#include <G4String.hh>
|
||||
|
||||
void G4System::init(ConstructionWrapper &CW){
|
||||
|
||||
@@ -122,6 +125,12 @@ void G4System::run_visualize(const std::string& partSpecies, double minEnergy, d
|
||||
runManager->BeamOn(1);
|
||||
}
|
||||
|
||||
void G4System::printMaterial(const std::string& materialName)const{
|
||||
// Get the material from the material name
|
||||
return ; //ToDo
|
||||
}
|
||||
|
||||
|
||||
void G4System::run_gui(){
|
||||
if(ui == nullptr){
|
||||
throw std::runtime_error("GUI not initialized");
|
||||
|
||||
Reference in New Issue
Block a user