From 90666bc1befa9c8b206d0408ff76a8da0b85e66a Mon Sep 17 00:00:00 2001 From: Jan Kieseler Date: Tue, 19 Sep 2023 09:34:56 +0000 Subject: [PATCH] changed to GeV --- bind/bindings.cpp | 4 ++-- include/G4System.hh | 4 ++-- src/PrimaryGeneratorAction.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bind/bindings.cpp b/bind/bindings.cpp index 7023f87..130f8a0 100644 --- a/bind/bindings.cpp +++ b/bind/bindings.cpp @@ -21,8 +21,8 @@ void makeG4System(M& m, std::string name){ py::class_(m, name.data()).def(py::init()) .def("init", &G4System::init, py::arg("cw"), py::arg("gui")=false) .def("run_gui", &G4System::run_gui) - .def("run_batch", &G4System::run_batch, py::arg("nEvents"), py::arg("partSpecies"), py::arg("minEnergy"), py::arg("maxEnergy")) - .def("run_visualize", &G4System::run_visualize, py::arg("partSpecies"), py::arg("minEnergy"), py::arg("maxEnergy")) + .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")); } diff --git a/include/G4System.hh b/include/G4System.hh index 4d031a0..ac8e01a 100644 --- a/include/G4System.hh +++ b/include/G4System.hh @@ -33,10 +33,10 @@ G4System(){}; void init(ConstructionWrapper &cw, bool gui=false); //will use dawn for visualization, also wrap more in python -void run_visualize(const std::string& partSpecies, double minEnergy, double maxEnergy); +void run_visualize(const std::string& partSpecies, double minEnergy_GeV, double maxEnergy_GeV); //runs the whole gui if available void run_gui(); -void run_batch(int nEvents, const std::string& partSpecies, double minEnergy, double maxEnergy); +void run_batch(int nEvents, const std::string& partSpecies, double minEnergy_GeV, double maxEnergy_GeV); void applyUICommand(const std::string& command){ check(); diff --git a/src/PrimaryGeneratorAction.cc b/src/PrimaryGeneratorAction.cc index a053701..a1e1cad 100644 --- a/src/PrimaryGeneratorAction.cc +++ b/src/PrimaryGeneratorAction.cc @@ -90,7 +90,7 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) } fParticleGun->SetParticleDefinition(particleDefinition); fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.)); - fParticleGun->SetParticleEnergy(partEnergy*MeV); + fParticleGun->SetParticleEnergy(partEnergy*GeV); // In order to avoid dependence of PrimaryGeneratorAction // on DetectorConstruction class we get world volume