-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into VRM_jacquet_2
- Loading branch information
Showing
257 changed files
with
13,236 additions
and
3,094 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
#include <pybind11/stl_bind.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4DataVector.hh" | ||
|
||
void init_G4DataVector(py::module &m) { | ||
py::class_<G4DataVector>(m, "G4DataVector").def(py::init<>()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4DecayTable.hh" | ||
|
||
void init_G4DecayTable(py::module &m) { | ||
py::class_<G4DecayTable>(m, "G4DecayTable") | ||
.def("entries", &G4DecayTable::entries) | ||
.def("GetDecayChannel", &G4DecayTable::GetDecayChannel, | ||
py::return_value_policy::reference); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4IInterpolator.hh" | ||
|
||
void init_G4IInterpolator(py::module &m) { | ||
py::class_<G4IInterpolator>(m, "G4IInterpolator"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4IonTable.hh" | ||
#include "G4ParticleDefinition.hh" | ||
|
||
void init_G4IonTable(py::module &m) { | ||
|
||
py::class_<G4IonTable, std::unique_ptr<G4IonTable, py::nodelete>>( | ||
m, "G4IonTable") | ||
.def("GetIonTable", &G4IonTable::GetIonTable, | ||
py::return_value_policy::reference) | ||
|
||
.def("GetNumberOfElements", &G4IonTable::GetNumberOfElements) | ||
.def("Entries", &G4IonTable::Entries) | ||
.def("size", &G4IonTable::size) | ||
.def("CreateAllIon", &G4IonTable::CreateAllIon) | ||
.def("CreateAllIsomer", &G4IonTable::CreateAllIsomer) | ||
|
||
.def("GetIon", | ||
(G4ParticleDefinition * | ||
(G4IonTable::*)(G4int Z, G4int A, G4int lvl)) & | ||
G4IonTable::GetIon, | ||
py::return_value_policy::reference) | ||
|
||
.def("GetIon", | ||
(G4ParticleDefinition * | ||
(G4IonTable::*)(G4int Z, G4int A, G4double E, G4int J)) & | ||
G4IonTable::GetIon, | ||
py::return_value_policy::reference) | ||
|
||
.def("GetIon", | ||
(G4ParticleDefinition * (G4IonTable::*)(G4int encoding)) & | ||
G4IonTable::GetIon, | ||
py::return_value_policy::reference) | ||
|
||
//.def("GetIonName", (G4String(G4IonTable::*)(G4int Z, G4int A, G4int lvl) | ||
// const) & G4IonTable::GetIonName) | ||
// FIXME WARNING adapted to work both with G4 v11.1.1 and G4 v11.1.2 | ||
// to be changed when switch to 11.1.2 | ||
.def("GetIonName", | ||
[](G4IonTable &t, G4int Z, G4int A, G4int lvl) -> G4String { | ||
return t.GetIonName(Z, A, lvl); | ||
}) | ||
|
||
.def("DumpTable", &G4IonTable::DumpTable); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4Ions.hh" | ||
#include "G4ParticleDefinition.hh" | ||
|
||
void init_G4Ions(py::module &m) { | ||
py::class_<G4Ions, G4ParticleDefinition>(m, "G4Ions") | ||
.def("GetExcitationEnergy", &G4Ions::GetExcitationEnergy) | ||
.def("GetIsomerLevel", &G4Ions::GetIsomerLevel) | ||
.def("GetFloatLevelBase", &G4Ions::GetFloatLevelBase) | ||
.def("GetFloatLevelBaseIndex", &G4Ions::GetFloatLevelBaseIndex); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4LinInterpolator.hh" | ||
|
||
void init_G4LinInterpolator(py::module &m) { | ||
py::class_<G4LinInterpolator, G4IInterpolator>(m, "G4LinInterpolator") | ||
.def(py::init<>()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
core/opengate_core/g4_bindings/pyG4PixeCrossSectionHandler.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4PixeCrossSectionHandler.hh" | ||
|
||
void init_G4PixeCrossSectionHandler(py::module &m) { | ||
py::class_<G4PixeCrossSectionHandler>(m, "G4PixeCrossSectionHandler") | ||
|
||
.def(py::init<>()) | ||
.def("PrintData", &G4PixeCrossSectionHandler::PrintData); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4IInterpolator.hh" | ||
#include "G4PixeShellDataSet.hh" | ||
|
||
void init_G4PixeShellDataSet(py::module &m) { | ||
py::class_<G4PixeShellDataSet, | ||
std::unique_ptr<G4PixeShellDataSet, py::nodelete>>( | ||
m, "G4PixeShellDataSet") | ||
.def(py::init<G4int, G4IInterpolator *, const G4String &, | ||
const G4String &, const G4String &, G4double, G4double>()) | ||
.def("LoadData", &G4PixeShellDataSet::LoadData) | ||
.def("NumberOfComponents", &G4PixeShellDataSet::NumberOfComponents) | ||
.def("GetEnergies", | ||
[](G4PixeShellDataSet &d, G4int componentId) { | ||
std::vector<double> e = d.GetEnergies(componentId); | ||
return e; | ||
}) | ||
.def("GetData", | ||
[](G4PixeShellDataSet &d, G4int componentId) { | ||
std::vector<double> e = d.GetData(componentId); | ||
return e; | ||
}) | ||
.def("GetData", &G4PixeShellDataSet::GetData) | ||
.def("PrintData", &G4PixeShellDataSet::PrintData); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4ProcessTable.hh" | ||
#include "G4ProcessVector.hh" | ||
#include "G4RadioactiveDecay.hh" | ||
|
||
void init_G4ProcessTable(py::module &m) { | ||
|
||
py::class_<G4ProcessTable, std::unique_ptr<G4ProcessTable, py::nodelete>>( | ||
m, "G4ProcessTable") | ||
.def("GetProcessTable", &G4ProcessTable::GetProcessTable, | ||
py::return_value_policy::reference) | ||
.def("Length", &G4ProcessTable::Length) | ||
.def( | ||
"FindProcesses", | ||
(G4ProcessVector * (G4ProcessTable::*)(const G4String &processName)) & | ||
G4ProcessTable::FindProcesses, | ||
py::return_value_policy::reference) | ||
.def( | ||
"FindRadioactiveDecay", | ||
[](G4ProcessTable &t) -> G4RadioactiveDecay * { | ||
// std::cout << "here" << std::endl; | ||
/*{ | ||
auto *pv = t.FindProcesses(); | ||
for (auto i = 0; i < pv->size(); i++) { | ||
std::cout << (*pv)[i]->GetProcessName() << std::endl; | ||
} | ||
}*/ | ||
|
||
auto *pv = t.FindProcesses("RadioactiveDecay"); | ||
|
||
// WARNING this fill change with the next G4 version 11.1.2 | ||
// auto *pv = t.FindProcesses("Decay"); | ||
/* | ||
std::cout << pv << " size=" << pv->size() << std::endl; | ||
std::cout << p << std::endl; | ||
*/ | ||
auto *p = (*pv)[0]; | ||
return (G4RadioactiveDecay *)(p); | ||
}, | ||
py::return_value_policy::reference); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4ProcessVector.hh" | ||
#include "G4VProcess.hh" | ||
|
||
void init_G4ProcessVector(py::module &m) { | ||
|
||
py::class_<G4ProcessVector>(m, "G4ProcessVector") | ||
.def("size", &G4ProcessVector::size) | ||
// Bracket operator | ||
.def("__getitem__", [](const G4ProcessVector &s, int i) { return s[i]; }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4DecayTable.hh" | ||
#include "G4Ions.hh" | ||
#include "G4RadioactiveDecay.hh" | ||
#include "G4VRestDiscreteProcess.hh" | ||
|
||
void init_G4RadioactiveDecay(py::module &m) { | ||
py::class_<G4RadioactiveDecay, G4VRestDiscreteProcess>(m, | ||
"G4RadioactiveDecay") | ||
.def("LoadDecayTable", &G4RadioactiveDecay::LoadDecayTable) | ||
.def("GetDecayTable", &G4RadioactiveDecay::GetDecayTable); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "G4ParticleDefinition.hh" | ||
#include "G4VDecayChannel.hh" | ||
|
||
void init_G4VDecayChannel(py::module &m) { | ||
py::class_<G4VDecayChannel>(m, "G4VDecayChannel") | ||
.def("GetKinematicsName", &G4VDecayChannel::GetKinematicsName) | ||
.def("GetBR", &G4VDecayChannel::GetBR) | ||
.def("GetNumberOfDaughters", &G4VDecayChannel::GetNumberOfDaughters) | ||
.def("GetParent", &G4VDecayChannel::GetParent, | ||
py::return_value_policy::reference) | ||
.def("GetDaughter", &G4VDecayChannel::GetDaughter, | ||
py::return_value_policy::reference) | ||
.def("GetDaughterName", &G4VDecayChannel::GetDaughterName) | ||
.def("GetParentMass", &G4VDecayChannel::GetParentMass) | ||
.def("GetDaughterMass", &G4VDecayChannel::GetDaughterMass); | ||
} |
Oops, something went wrong.