diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1f1a4a3..6b24256a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,7 +79,7 @@ add_subdirectory(projects/math)
add_subdirectory(projects/dataclasses)
add_subdirectory(projects/geometry)
add_subdirectory(projects/detector)
-add_subdirectory(projects/crosssections)
+add_subdirectory(projects/interactions)
add_subdirectory(projects/distributions)
add_subdirectory(projects/injection)
@@ -98,7 +98,7 @@ target_link_libraries(LeptonInjector
LI_dataclasses
LI_geometry
LI_detector
- LI_crosssections
+ LI_interactions
LI_distributions
LI_injection
)
@@ -114,7 +114,7 @@ target_link_libraries(LeptonInjector
LI_dataclasses
LI_geometry
LI_detector
- LI_crosssections
+ LI_interactions
LI_distributions
LI_injection
)
@@ -136,7 +136,7 @@ if(DEFINED SKBUILD)
LI_dataclasses
LI_geometry
LI_detector
- LI_crosssections
+ LI_interactions
LI_distributions
LI_injection
EXPORT ${PROJECT_NAME}Config
@@ -151,7 +151,7 @@ if(DEFINED SKBUILD)
LI_dataclasses
LI_geometry
LI_detector
- LI_crosssections
+ LI_interactions
LI_distributions
LI_injection
EXPORT ${PROJECT_NAME}Config
@@ -167,7 +167,7 @@ else()
LI_dataclasses
LI_geometry
LI_detector
- LI_crosssections
+ LI_interactions
LI_distributions
LI_injection
EXPORT ${PROJECT_NAME}Config
@@ -213,7 +213,7 @@ if(DEFINED SKBUILD)
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector)
install(TARGETS detector
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector)
- install(TARGETS crosssections
+ install(TARGETS interactions
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector)
install(TARGETS distributions
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector)
diff --git a/projects/crosssections/CMakeLists.txt b/projects/crosssections/CMakeLists.txt
deleted file mode 100644
index 3976bf2e..00000000
--- a/projects/crosssections/CMakeLists.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-
-#core files
-LIST (APPEND crosssections_SOURCES
- ${PROJECT_SOURCE_DIR}/projects/crosssections/private/Decay.cxx
- ${PROJECT_SOURCE_DIR}/projects/crosssections/private/CrossSection.cxx
- ${PROJECT_SOURCE_DIR}/projects/crosssections/private/CrossSectionCollection.cxx
- ${PROJECT_SOURCE_DIR}/projects/crosssections/private/DipoleFromTable.cxx
- ${PROJECT_SOURCE_DIR}/projects/crosssections/private/DarkNewsCrossSection.cxx
- ${PROJECT_SOURCE_DIR}/projects/crosssections/private/DarkNewsDecay.cxx
- ${PROJECT_SOURCE_DIR}/projects/crosssections/private/NeutrissimoDecay.cxx
- ${PROJECT_SOURCE_DIR}/projects/crosssections/private/DISFromSpline.cxx
- ${PROJECT_SOURCE_DIR}/projects/crosssections/private/HNLFromSpline.cxx
- ${PROJECT_SOURCE_DIR}/projects/crosssections/private/ElasticScattering.cxx
- ${PROJECT_SOURCE_DIR}/projects/crosssections/private/DummyCrossSection.cxx
-)
-add_library(LI_crosssections OBJECT ${crosssections_SOURCES})
-set_property(TARGET LI_crosssections PROPERTY POSITION_INDEPENDENT_CODE ON)
-target_include_directories(LI_crosssections PUBLIC
- $
- $
-)
-
-target_link_libraries(LI_crosssections
- PRIVATE
- $
- pybind11::embed
- PUBLIC
- photospline
- LI_serialization
- LI_utilities
- LI_math
- LI_dataclasses
- LI_detector
-)
-
-install(DIRECTORY "${PROJECT_SOURCE_DIR}/projects/crosssections/public/"
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
- FILES_MATCHING
- PATTERN "*.h"
- PATTERN "*.tcc"
-)
-
-package_add_test(UnitTest_DISFromSpline ${PROJECT_SOURCE_DIR}/projects/crosssections/private/test/DISFromSpline_TEST.cxx)
-package_add_test(UnitTest_DipoleFromTable ${PROJECT_SOURCE_DIR}/projects/crosssections/private/test/DipoleFromTable_TEST.cxx)
-#package_add_test(UnitTest_ElasticScattering ${PROJECT_SOURCE_DIR}/projects/crosssections/private/test/ElasticScattering_TEST.cxx)
-
-pybind11_add_module(crosssections ${PROJECT_SOURCE_DIR}/projects/crosssections/private/pybindings/crosssections.cxx)
-target_link_libraries(crosssections PRIVATE LeptonInjector photospline rk_static pybind11::embed)
-pybind11_add_module(pyDarkNewsSerializer ${PROJECT_SOURCE_DIR}/projects/crosssections/private/pybindings/pyDarkNewsSerializer.cxx)
-target_link_libraries(pyDarkNewsSerializer PRIVATE LeptonInjector photospline rk_static pybind11::embed)
-if(DEFINED SKBUILD)
-set_target_properties(crosssections PROPERTIES
- BUILD_WITH_INSTALL_RPATH FALSE
- LINK_FLAGS "-Wl,-rpath,$ORIGIN/../leptoninjector.libs/")
-endif()
diff --git a/projects/crosssections/private/pybindings/CrossSectionCollection.h b/projects/crosssections/private/pybindings/CrossSectionCollection.h
deleted file mode 100644
index 0daedefd..00000000
--- a/projects/crosssections/private/pybindings/CrossSectionCollection.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-#include "../../public/LeptonInjector/crosssections/CrossSection.h"
-#include "../../public/LeptonInjector/crosssections/CrossSectionCollection.h"
-#include "../../public/LeptonInjector/crosssections/Decay.h"
-#include "../../../dataclasses/public/LeptonInjector/dataclasses/Particle.h"
-#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
-#include "../../../utilities/public/LeptonInjector/utilities/Random.h"
-
-void register_CrossSectionCollection(pybind11::module_ & m) {
- using namespace pybind11;
- using namespace LI::crosssections;
-
- class_>(m, "CrossSectionCollection")
- .def(init<>())
- .def(init>>())
- .def(init>>())
- .def(init>, std::vector>>())
- .def(self == self)
- .def("GetDecays",&CrossSectionCollection::GetDecays)
- .def("HasCrossSections",&CrossSectionCollection::HasCrossSections)
- .def("HasDecays",&CrossSectionCollection::HasDecays)
- .def("GetCrossSectionsForTarget",&CrossSectionCollection::GetCrossSectionsForTarget)
- .def("GetCrossSectionsByTarget",&CrossSectionCollection::GetCrossSectionsByTarget)
- .def("TargetTypes",&CrossSectionCollection::TargetTypes)
- .def("TotalDecayWidth",&CrossSectionCollection::TotalDecayWidth)
- .def("TotalDecayLength",&CrossSectionCollection::TotalDecayLength)
- .def("MatchesPrimary",&CrossSectionCollection::MatchesPrimary)
- ;
-}
diff --git a/projects/detector/CMakeLists.txt b/projects/detector/CMakeLists.txt
index 86af2dd8..7114de60 100644
--- a/projects/detector/CMakeLists.txt
+++ b/projects/detector/CMakeLists.txt
@@ -13,7 +13,7 @@ LIST (APPEND detector_SOURCES
${PROJECT_SOURCE_DIR}/projects/detector/private/ExponentialDistribution1D.cxx
${PROJECT_SOURCE_DIR}/projects/detector/private/DensityDistribution.cxx
- ${PROJECT_SOURCE_DIR}/projects/detector/private/EarthModel.cxx
+ ${PROJECT_SOURCE_DIR}/projects/detector/private/DetectorModel.cxx
${PROJECT_SOURCE_DIR}/projects/detector/private/MaterialModel.cxx
${PROJECT_SOURCE_DIR}/projects/detector/private/Path.cxx
)
@@ -46,7 +46,7 @@ install(DIRECTORY "${PROJECT_SOURCE_DIR}/projects/detector/public/"
package_add_test(UnitTest_Axis ${PROJECT_SOURCE_DIR}/projects/detector/private/test/Axis_TEST.cxx)
package_add_test(UnitTest_DensityDistribution ${PROJECT_SOURCE_DIR}/projects/detector/private/test/DensityDistribution_TEST.cxx)
package_add_test(UnitTest_Distribution1D ${PROJECT_SOURCE_DIR}/projects/detector/private/test/Distribution1D_TEST.cxx)
-package_add_test(UnitTest_EarthModel ${PROJECT_SOURCE_DIR}/projects/detector/private/test/EarthModel_TEST.cxx)
+package_add_test(UnitTest_DetectorModel ${PROJECT_SOURCE_DIR}/projects/detector/private/test/DetectorModel_TEST.cxx)
package_add_test(UnitTest_MaterialModel ${PROJECT_SOURCE_DIR}/projects/detector/private/test/MaterialModel_TEST.cxx)
package_add_test(UnitTest_Path ${PROJECT_SOURCE_DIR}/projects/detector/private/test/Path_TEST.cxx)
diff --git a/projects/detector/private/EarthModel.cxx b/projects/detector/private/DetectorModel.cxx
similarity index 87%
rename from projects/detector/private/EarthModel.cxx
rename to projects/detector/private/DetectorModel.cxx
index 99e2605e..26f1025e 100644
--- a/projects/detector/private/EarthModel.cxx
+++ b/projects/detector/private/DetectorModel.cxx
@@ -1,4 +1,4 @@
-#include "LeptonInjector/detector/EarthModel.h"
+#include "LeptonInjector/detector/DetectorModel.h"
#include
#include
@@ -104,12 +104,12 @@ class accumulator {
};
}
-bool EarthSector::operator==(EarthSector const & o) const {
+bool DetectorSector::operator==(DetectorSector const & o) const {
return name == o.name and material_id == o.material_id and level == o.level and geo == o.geo and density == o.density;
}
-std::ostream & EarthSector::Print(std::ostream& oss) const {
- oss << "[EarthSector:\n"
+std::ostream & DetectorSector::Print(std::ostream& oss) const {
+ oss << "[DetectorSector:\n"
<< " Name : " << name << '\n'
<< " MaterialID : " << material_id << '\n'
<< " Level : " << level << '\n'
@@ -118,73 +118,73 @@ std::ostream & EarthSector::Print(std::ostream& oss) const {
return oss;
}
-std::ostream& operator<<(std::ostream& oss, EarthSector const & bcm) {
+std::ostream& operator<<(std::ostream& oss, DetectorSector const & bcm) {
return(bcm.Print(oss));
}
-std::ostream& operator<<(std::ostream& oss, EarthSector & bcm) {
+std::ostream& operator<<(std::ostream& oss, DetectorSector & bcm) {
return(bcm.Print(oss));
}
-EarthModel::EarthModel() {
+DetectorModel::DetectorModel() {
LoadDefaultMaterials();
LoadDefaultSectors();
}
-EarthModel::EarthModel(std::string const & earth_model, std::string const & material_model) {
+DetectorModel::DetectorModel(std::string const & earth_model, std::string const & material_model) {
LoadDefaultMaterials();
LoadDefaultSectors();
LoadMaterialModel(material_model);
- LoadEarthModel(earth_model);
+ LoadDetectorModel(earth_model);
}
-EarthModel::EarthModel(std::string const & path, std::string const & earth_model, std::string const & material_model) : path_(path) {
+DetectorModel::DetectorModel(std::string const & path, std::string const & earth_model, std::string const & material_model) : path_(path) {
LoadDefaultMaterials();
LoadDefaultSectors();
LoadMaterialModel(material_model);
- LoadEarthModel(earth_model);
+ LoadDetectorModel(earth_model);
}
-bool EarthModel::operator==(EarthModel const & o) const {
+bool DetectorModel::operator==(DetectorModel const & o) const {
return
std::tie(materials_, sectors_, sector_map_, detector_origin_)
==
std::tie(o.materials_, o.sectors_, o.sector_map_, o.detector_origin_);
}
-std::string EarthModel::GetPath() const {
+std::string DetectorModel::GetPath() const {
return path_;
}
-void EarthModel::SetPath(std::string const & path) {
+void DetectorModel::SetPath(std::string const & path) {
path_ = path;
}
-MaterialModel const & EarthModel::GetMaterials() const {
+MaterialModel const & DetectorModel::GetMaterials() const {
return materials_;
}
-void EarthModel::SetMaterials(MaterialModel const & materials) {
+void DetectorModel::SetMaterials(MaterialModel const & materials) {
materials_ = materials;
}
-std::vector const & EarthModel::GetSectors() const {
+std::vector const & DetectorModel::GetSectors() const {
return sectors_;
}
-void EarthModel::SetSectors(std::vector const & sectors) {
+void DetectorModel::SetSectors(std::vector const & sectors) {
sectors_ = sectors;
}
-Vector3D EarthModel::GetDetectorOrigin() const {
+Vector3D DetectorModel::GetDetectorOrigin() const {
return detector_origin_;
}
-void EarthModel::SetDetectorOrigin(Vector3D const & detector_origin) {
+void DetectorModel::SetDetectorOrigin(Vector3D const & detector_origin) {
detector_origin_ = detector_origin;
}
-void EarthModel::AddSector(EarthSector sector) {
+void DetectorModel::AddSector(DetectorSector sector) {
if(sector_map_.count(sector.level) > 0) {
throw(std::runtime_error("Already have a sector of that heirarchy!"));
}
@@ -194,7 +194,7 @@ void EarthModel::AddSector(EarthSector sector) {
}
}
-EarthSector EarthModel::GetSector(int heirarchy) const {
+DetectorSector DetectorModel::GetSector(int heirarchy) const {
auto const iter = sector_map_.find(heirarchy);
assert(iter != sector_map_.end());
unsigned int index = sector_map_.at(heirarchy);
@@ -204,7 +204,7 @@ EarthSector EarthModel::GetSector(int heirarchy) const {
return sectors_[index];
}
-void EarthModel::ClearSectors() {
+void DetectorModel::ClearSectors() {
sectors_.clear();
sector_map_.clear();
}
@@ -217,7 +217,7 @@ bool fexists(const std::string filename)
}
}
-void EarthModel::LoadEarthModel(std::string const & earth_model) {
+void DetectorModel::LoadDetectorModel(std::string const & earth_model) {
if(earth_model.empty())
throw(std::runtime_error("Received empty earth model filename!"));
@@ -287,7 +287,7 @@ void EarthModel::LoadEarthModel(std::string const & earth_model) {
ss >> type;
if(type.find("object") != std::string::npos) {
- EarthSector sector;
+ DetectorSector sector;
sector.level = level;
level += 1;
double xc, yc, zc; // Coordinates of the center of the shape
@@ -411,7 +411,7 @@ void EarthModel::LoadEarthModel(std::string const & earth_model) {
in.close();
}
-void EarthModel::LoadDefaultMaterials() {
+void DetectorModel::LoadDefaultMaterials() {
// Interstellar medium mass composition from
// https://arxiv.org/abs/astro-ph/0106359
// Limited information exists for Z > 2
@@ -429,8 +429,8 @@ void EarthModel::LoadDefaultMaterials() {
); // Assume there are 1 neutrons for every 7 protons in the universe
}
-void EarthModel::LoadDefaultSectors() {
- EarthSector sector;
+void DetectorModel::LoadDefaultSectors() {
+ DetectorSector sector;
sector.material_id = materials_.GetMaterialId("VACUUM");
sector.level = std::numeric_limits::min();
sector.geo = Sphere(std::numeric_limits::infinity(), 0).create();
@@ -438,13 +438,13 @@ void EarthModel::LoadDefaultSectors() {
AddSector(sector);
}
-void EarthModel::LoadMaterialModel(std::string const & material_model) {
+void DetectorModel::LoadMaterialModel(std::string const & material_model) {
materials_.SetPath(path_);
materials_.AddModelFile(material_model);
}
-double EarthModel::GetMassDensity(Geometry::IntersectionList const & intersections, Vector3D const & p0) const {
+double DetectorModel::GetMassDensity(Geometry::IntersectionList const & intersections, Vector3D const & p0) const {
Vector3D direction = p0 - intersections.position;
if(direction.magnitude() == 0) {
direction = intersections.direction;
@@ -469,7 +469,7 @@ double EarthModel::GetMassDensity(Geometry::IntersectionList const & intersectio
// whereas the lower end is bounded by the end of the last line segment, and the entry into the sector
double start_point = std::max(offset + dot * current_intersection->distance, offset + dot * last_point);
if(start_point <= 0 and end_point >= 0) {
- EarthSector sector = GetSector(current_intersection->hierarchy);
+ DetectorSector sector = GetSector(current_intersection->hierarchy);
density = sector.density->Evaluate(p0);
return true;
} else {
@@ -484,13 +484,13 @@ double EarthModel::GetMassDensity(Geometry::IntersectionList const & intersectio
return density;
}
-double EarthModel::GetMassDensity(Vector3D const & p0) const {
+double DetectorModel::GetMassDensity(Vector3D const & p0) const {
Vector3D direction(1,0,0); // Any direction will work for determining the sector heirarchy
Geometry::IntersectionList intersections = GetIntersections(p0, direction);
return GetMassDensity(intersections, p0);
}
-double EarthModel::GetParticleDensity(Geometry::IntersectionList const & intersections, Vector3D const & p0, LI::dataclasses::Particle::ParticleType target) const {
+double DetectorModel::GetParticleDensity(Geometry::IntersectionList const & intersections, Vector3D const & p0, LI::dataclasses::Particle::ParticleType target) const {
Vector3D direction = p0 - intersections.position;
if(direction.magnitude() == 0) {
direction = intersections.direction;
@@ -515,7 +515,7 @@ double EarthModel::GetParticleDensity(Geometry::IntersectionList const & interse
// whereas the lower end is bounded by the end of the last line segment, and the entry into the sector
double start_point = std::max(offset + dot * current_intersection->distance, offset + dot * last_point);
if(start_point <= 0 and end_point >= 0) {
- EarthSector sector = GetSector(current_intersection->hierarchy);
+ DetectorSector sector = GetSector(current_intersection->hierarchy);
density = sector.density->Evaluate(p0);
density *= materials_.GetTargetParticleFraction(sector.material_id, target);
return true;
@@ -531,13 +531,13 @@ double EarthModel::GetParticleDensity(Geometry::IntersectionList const & interse
return density;
}
-double EarthModel::GetParticleDensity(Vector3D const & p0, LI::dataclasses::Particle::ParticleType target) const {
+double DetectorModel::GetParticleDensity(Vector3D const & p0, LI::dataclasses::Particle::ParticleType target) const {
Vector3D direction(1,0,0); // Any direction will work for determining the sector heirarchy
Geometry::IntersectionList intersections = GetIntersections(p0, direction);
return GetParticleDensity(intersections, p0, target);
}
-double EarthModel::GetInteractionDensity(Geometry::IntersectionList const & intersections, Vector3D const & p0,
+double DetectorModel::GetInteractionDensity(Geometry::IntersectionList const & intersections, Vector3D const & p0,
std::vector const & targets,
std::vector const & total_cross_sections,
double const & total_decay_length) const {
@@ -572,7 +572,7 @@ double EarthModel::GetInteractionDensity(Geometry::IntersectionList const & inte
// whereas the lower end is bounded by the end of the last line segment, and the entry into the sector
double start_point = std::max(offset + dot * current_intersection->distance, offset + dot * last_point);
if(start_point <= 0 and end_point >= 0) {
- EarthSector sector = GetSector(current_intersection->hierarchy);
+ DetectorSector sector = GetSector(current_intersection->hierarchy);
double density = sector.density->Evaluate(p0);
std::vector particle_fractions = materials_.GetTargetParticleFraction(sector.material_id, targets.begin(), targets.end());
interaction_density = 0.0;
@@ -595,7 +595,7 @@ double EarthModel::GetInteractionDensity(Geometry::IntersectionList const & inte
return interaction_density;
}
-double EarthModel::GetInteractionDensity(Vector3D const & p0,
+double DetectorModel::GetInteractionDensity(Vector3D const & p0,
std::vector const & targets,
std::vector const & total_cross_sections,
double const & total_decay_length) const {
@@ -604,7 +604,7 @@ double EarthModel::GetInteractionDensity(Vector3D const & p0,
return GetInteractionDensity(intersections, p0, targets, total_cross_sections, total_decay_length);
}
-double EarthModel::GetColumnDepthInCGS(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & p1) const {
+double DetectorModel::GetColumnDepthInCGS(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & p1) const {
if(p0 == p1) {
return 0.0;
}
@@ -635,7 +635,7 @@ double EarthModel::GetColumnDepthInCGS(Geometry::IntersectionList const & inters
double start_point = std::max(std::max(offset + dot * current_intersection->distance, 0.0), offset + dot * last_point);
if(end_point > 0) {
double segment_length = end_point - start_point;
- EarthSector sector = GetSector(current_intersection->hierarchy);
+ DetectorSector sector = GetSector(current_intersection->hierarchy);
double integral = sector.density->Integral(p0+start_point*direction, direction, segment_length);
column_depth += integral;
}
@@ -649,7 +649,7 @@ double EarthModel::GetColumnDepthInCGS(Geometry::IntersectionList const & inters
return column_depth * 100;
}
-double EarthModel::GetColumnDepthInCGS(Vector3D const & p0, Vector3D const & p1) const {
+double DetectorModel::GetColumnDepthInCGS(Vector3D const & p0, Vector3D const & p1) const {
if(p0 == p1) {
return 0.0;
}
@@ -664,7 +664,7 @@ double EarthModel::GetColumnDepthInCGS(Vector3D const & p0, Vector3D const & p1)
return GetColumnDepthInCGS(intersections, p0, p1);
}
-double EarthModel::DistanceForColumnDepthFromPoint(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & dir, double column_depth) const {
+double DetectorModel::DistanceForColumnDepthFromPoint(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & dir, double column_depth) const {
Vector3D direction = dir;
column_depth /= 100;
bool flip = column_depth < 0;
@@ -694,7 +694,7 @@ double EarthModel::DistanceForColumnDepthFromPoint(Geometry::IntersectionList co
// whereas the lower end is bounded by the global start point, the end of the last line segment, and the entry into the sector
double start_point = std::max(std::max(offset + dot * current_intersection->distance, 0.0), offset + dot * last_point);
double segment_length = end_point - start_point;
- EarthSector sector = GetSector(current_intersection->hierarchy);
+ DetectorSector sector = GetSector(current_intersection->hierarchy);
double target = column_depth - total_column_depth;
double distance = sector.density->InverseIntegral(p0+start_point*direction, direction, target, segment_length);
@@ -720,20 +720,20 @@ double EarthModel::DistanceForColumnDepthFromPoint(Geometry::IntersectionList co
return total_distance;
}
-double EarthModel::DistanceForColumnDepthFromPoint(Vector3D const & p0, Vector3D const & direction, double column_depth) const {
+double DetectorModel::DistanceForColumnDepthFromPoint(Vector3D const & p0, Vector3D const & direction, double column_depth) const {
Geometry::IntersectionList intersections = GetIntersections(p0, direction);
return DistanceForColumnDepthFromPoint(intersections, p0, direction, column_depth);
}
-double EarthModel::DistanceForColumnDepthToPoint(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & direction, double column_depth) const {
+double DetectorModel::DistanceForColumnDepthToPoint(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & direction, double column_depth) const {
return DistanceForColumnDepthFromPoint(intersections, p0, -direction, column_depth);
}
-double EarthModel::DistanceForColumnDepthToPoint(Vector3D const & p0, Vector3D const & direction, double column_depth) const {
+double DetectorModel::DistanceForColumnDepthToPoint(Vector3D const & p0, Vector3D const & direction, double column_depth) const {
return DistanceForColumnDepthFromPoint(p0, -direction, column_depth);
}
-double EarthModel::GetMassDensity(Geometry::IntersectionList const & intersections, Vector3D const & p0, std::set targets) const {
+double DetectorModel::GetMassDensity(Geometry::IntersectionList const & intersections, Vector3D const & p0, std::set targets) const {
Vector3D direction = p0 - intersections.position;
if(direction.magnitude() == 0) {
direction = intersections.direction;
@@ -758,7 +758,7 @@ double EarthModel::GetMassDensity(Geometry::IntersectionList const & intersectio
// whereas the lower end is bounded by the end of the last line segment, and the entry into the sector
double start_point = std::max(offset + dot * current_intersection->distance, offset + dot * last_point);
if(start_point <= 0 and end_point >= 0) {
- EarthSector sector = GetSector(current_intersection->hierarchy);
+ DetectorSector sector = GetSector(current_intersection->hierarchy);
density = sector.density->Evaluate(p0);
std::vector mass_fractions = materials_.GetTargetMassFraction(sector.material_id, targets.begin(), targets.end());
density *= std::accumulate(mass_fractions.begin(), mass_fractions.end(), 0.0);
@@ -775,13 +775,13 @@ double EarthModel::GetMassDensity(Geometry::IntersectionList const & intersectio
return density;
}
-double EarthModel::GetMassDensity(Vector3D const & p0, std::set targets) const {
+double DetectorModel::GetMassDensity(Vector3D const & p0, std::set targets) const {
Vector3D direction(1,0,0); // Any direction will work for determining the sector heirarchy
Geometry::IntersectionList intersections = GetIntersections(p0, direction);
return GetMassDensity(intersections, p0, targets);
}
-std::vector EarthModel::GetParticleDensity(Geometry::IntersectionList const & intersections, Vector3D const & p0, std::set targets) const {
+std::vector DetectorModel::GetParticleDensity(Geometry::IntersectionList const & intersections, Vector3D const & p0, std::set targets) const {
Vector3D direction = p0 - intersections.position;
if(direction.magnitude() == 0) {
direction = intersections.direction;
@@ -807,7 +807,7 @@ std::vector EarthModel::GetParticleDensity(Geometry::IntersectionList co
// whereas the lower end is bounded by the end of the last line segment, and the entry into the sector
double start_point = std::max(offset + dot * current_intersection->distance, offset + dot * last_point);
if(start_point <= 0 and end_point >= 0) {
- EarthSector sector = GetSector(current_intersection->hierarchy);
+ DetectorSector sector = GetSector(current_intersection->hierarchy);
density = sector.density->Evaluate(p0);
particle_fractions = materials_.GetTargetParticleFraction(sector.material_id, targets.begin(), targets.end());
return true;
@@ -827,13 +827,13 @@ std::vector EarthModel::GetParticleDensity(Geometry::IntersectionList co
return particle_fractions;
}
-std::vector EarthModel::GetParticleDensity(Vector3D const & p0, std::set targets) const {
+std::vector DetectorModel::GetParticleDensity(Vector3D const & p0, std::set targets) const {
Vector3D direction(1,0,0); // Any direction will work for determining the sector heirarchy
Geometry::IntersectionList intersections = GetIntersections(p0, direction);
return GetParticleDensity(intersections, p0, targets);
}
-double EarthModel::GetInteractionDepthInCGS(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & p1,
+double DetectorModel::GetInteractionDepthInCGS(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & p1,
std::vector const & targets,
std::vector const & total_cross_sections,
double const & total_decay_length) const {
@@ -872,7 +872,7 @@ double EarthModel::GetInteractionDepthInCGS(Geometry::IntersectionList const & i
double start_point = std::max(std::max(offset + dot * current_intersection->distance, 0.0), offset + dot * last_point);
if(end_point > 0) {
double segment_length = end_point - start_point;
- EarthSector sector = GetSector(current_intersection->hierarchy);
+ DetectorSector sector = GetSector(current_intersection->hierarchy);
double integral = sector.density->Integral(p0+start_point*direction, direction, segment_length);
std::vector particle_fractions = materials_.GetTargetParticleFraction(sector.material_id, targets.begin(), targets.end());
@@ -898,7 +898,7 @@ double EarthModel::GetInteractionDepthInCGS(Geometry::IntersectionList const & i
return interaction_depth;
}
-std::vector EarthModel::GetParticleColumnDepth(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & p1, std::vector const & targets) const {
+std::vector DetectorModel::GetParticleColumnDepth(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & p1, std::vector const & targets) const {
if(p0 == p1) {
return std::vector(targets.size(), 0.0);
}
@@ -930,7 +930,7 @@ std::vector EarthModel::GetParticleColumnDepth(Geometry::IntersectionLis
double start_point = std::max(std::max(offset + dot * current_intersection->distance, 0.0), offset + dot * last_point);
if(end_point > 0) {
double segment_length = end_point - start_point;
- EarthSector sector = GetSector(current_intersection->hierarchy);
+ DetectorSector sector = GetSector(current_intersection->hierarchy);
double integral = sector.density->Integral(p0+start_point*direction, direction, segment_length);
std::vector particle_fractions = materials_.GetTargetParticleFraction(sector.material_id, targets.begin(), targets.end());
for(unsigned int i=0; i EarthModel::GetParticleColumnDepth(Geometry::IntersectionLis
return target_counts;
}
-double EarthModel::GetInteractionDepthInCGS(Vector3D const & p0, Vector3D const & p1,
+double DetectorModel::GetInteractionDepthInCGS(Vector3D const & p0, Vector3D const & p1,
std::vector const & targets,
std::vector const & total_cross_sections,
double const & total_decay_length) const {
@@ -965,7 +965,7 @@ double EarthModel::GetInteractionDepthInCGS(Vector3D const & p0, Vector3D const
return GetInteractionDepthInCGS(intersections, p0, p1, targets, total_cross_sections, total_decay_length);
}
-EarthSector EarthModel::GetContainingSector(Geometry::IntersectionList const & intersections, Vector3D const & p0) const {
+DetectorSector DetectorModel::GetContainingSector(Geometry::IntersectionList const & intersections, Vector3D const & p0) const {
Vector3D direction = intersections.direction;
double offset = (intersections.position - p0) * direction;
@@ -977,7 +977,7 @@ EarthSector EarthModel::GetContainingSector(Geometry::IntersectionList const & i
dot = 1;
}
- EarthSector sector;
+ DetectorSector sector;
std::function::const_iterator, std::vector::const_iterator, double)> callback =
[&] (std::vector::const_iterator current_intersection, std::vector::const_iterator intersection, double last_point) {
@@ -996,13 +996,13 @@ EarthSector EarthModel::GetContainingSector(Geometry::IntersectionList const & i
return sector;
}
-EarthSector EarthModel::GetContainingSector(Vector3D const & p0) const {
+DetectorSector DetectorModel::GetContainingSector(Vector3D const & p0) const {
Vector3D direction(0, 0, 1);
Geometry::IntersectionList intersections = GetIntersections(p0, direction);
return GetContainingSector(intersections, p0);
}
-Geometry::IntersectionList EarthModel::GetIntersections(Vector3D const & p0, Vector3D const & direction) const {
+Geometry::IntersectionList DetectorModel::GetIntersections(Vector3D const & p0, Vector3D const & direction) const {
Geometry::IntersectionList intersections;
intersections.position = p0;
intersections.direction = direction;
@@ -1023,11 +1023,11 @@ Geometry::IntersectionList EarthModel::GetIntersections(Vector3D const & p0, Vec
return intersections;
}
-void EarthModel::SortIntersections(Geometry::IntersectionList & intersections) {
+void DetectorModel::SortIntersections(Geometry::IntersectionList & intersections) {
SortIntersections(intersections.intersections);
}
-void EarthModel::SortIntersections(std::vector & intersections) {
+void DetectorModel::SortIntersections(std::vector & intersections) {
// Intersections should be sorted according to distance and then hierarchy
std::function comp = [](Geometry::Intersection const & a, Geometry::Intersection const & b){
bool a_enter = a.entering;
@@ -1056,7 +1056,7 @@ void EarthModel::SortIntersections(std::vector & interse
std::sort(intersections.begin(), intersections.end(), comp);
}
-Geometry::IntersectionList EarthModel::GetOuterBounds(Geometry::IntersectionList const & intersections) {
+Geometry::IntersectionList DetectorModel::GetOuterBounds(Geometry::IntersectionList const & intersections) {
Geometry::IntersectionList result;
result.position = intersections.position;
result.direction = intersections.direction;
@@ -1078,23 +1078,23 @@ Geometry::IntersectionList EarthModel::GetOuterBounds(Geometry::IntersectionList
return result;
}
-Geometry::IntersectionList EarthModel::GetOuterBounds(Vector3D const & p0, Vector3D const & direction) const {
+Geometry::IntersectionList DetectorModel::GetOuterBounds(Vector3D const & p0, Vector3D const & direction) const {
Geometry::IntersectionList intersections = GetIntersections(p0, direction);
return GetOuterBounds(intersections);
}
-std::set EarthModel::GetAvailableTargets(std::array const & vertex) const {
+std::set DetectorModel::GetAvailableTargets(std::array const & vertex) const {
Geometry::IntersectionList intersections = GetIntersections(vertex, math::Vector3D(0,0,1));
return GetAvailableTargets(intersections, vertex);
}
-std::set EarthModel::GetAvailableTargets(geometry::Geometry::IntersectionList const & intersections, std::array const & vertex) const {
+std::set DetectorModel::GetAvailableTargets(geometry::Geometry::IntersectionList const & intersections, std::array const & vertex) const {
int matID = GetContainingSector(intersections, Vector3D(vertex[0],vertex[1],vertex[2])).material_id;
std::vector particles = materials_.GetMaterialConstituents(matID);
return std::set(particles.begin(), particles.end());
}
-void EarthModel::SectorLoop(std::function::const_iterator, std::vector::const_iterator, double)> callback, Geometry::IntersectionList const & intersections, bool reverse) {
+void DetectorModel::SectorLoop(std::function::const_iterator, std::vector::const_iterator, double)> callback, Geometry::IntersectionList const & intersections, bool reverse) {
// Keep track of the integral progress
double last_point;
@@ -1180,7 +1180,7 @@ void EarthModel::SectorLoop(std::function const & targets,
std::vector const & total_cross_sections,
double const & total_decay_length) const {
@@ -1221,7 +1221,7 @@ double EarthModel::DistanceForInteractionDepthFromPoint(Geometry::IntersectionLi
// whereas the lower end is bounded by the global start point, the end of the last line segment, and the entry into the sector
double start_point = std::max(std::max(offset + dot * current_intersection->distance, 0.0), offset + dot * last_point);
double segment_length = end_point - start_point;
- EarthSector sector = GetSector(current_intersection->hierarchy);
+ DetectorSector sector = GetSector(current_intersection->hierarchy);
double target = interaction_depth - total_interaction_depth;
// This next line is because when we evaluate the density integral,
// we end up calculating an interaction length in units of m/cm.
@@ -1264,7 +1264,7 @@ double EarthModel::DistanceForInteractionDepthFromPoint(Geometry::IntersectionLi
return total_distance;
}
-double EarthModel::DistanceForInteractionDepthFromPoint(Vector3D const & p0, Vector3D const & direction, double interaction_depth,
+double DetectorModel::DistanceForInteractionDepthFromPoint(Vector3D const & p0, Vector3D const & direction, double interaction_depth,
std::vector const & targets,
std::vector const & total_cross_sections,
double const & total_decay_length) const {
@@ -1272,37 +1272,37 @@ double EarthModel::DistanceForInteractionDepthFromPoint(Vector3D const & p0, Vec
return DistanceForInteractionDepthFromPoint(intersections, p0, direction, interaction_depth, targets, total_cross_sections, total_decay_length);
}
-double EarthModel::DistanceForInteractionDepthToPoint(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & direction, double interaction_depth,
+double DetectorModel::DistanceForInteractionDepthToPoint(Geometry::IntersectionList const & intersections, Vector3D const & p0, Vector3D const & direction, double interaction_depth,
std::vector const & targets,
std::vector const & total_cross_sections,
double const & total_decay_length) const {
return DistanceForInteractionDepthFromPoint(intersections, p0, -direction, interaction_depth, targets, total_cross_sections, total_decay_length);
}
-double EarthModel::DistanceForInteractionDepthToPoint(Vector3D const & p0, Vector3D const & direction, double interaction_depth,
+double DetectorModel::DistanceForInteractionDepthToPoint(Vector3D const & p0, Vector3D const & direction, double interaction_depth,
std::vector const & targets,
std::vector const & total_cross_sections,
double const & total_decay_length) const {
return DistanceForInteractionDepthFromPoint(p0, -direction, interaction_depth, targets, total_cross_sections, total_decay_length);
}
-Vector3D EarthModel::GetEarthCoordPosFromDetCoordPos(Vector3D const & point) const {
+Vector3D DetectorModel::GetEarthCoordPosFromDetCoordPos(Vector3D const & point) const {
return point + detector_origin_;
}
-Vector3D EarthModel::GetEarthCoordDirFromDetCoordDir(Vector3D const & direction) const {
+Vector3D DetectorModel::GetEarthCoordDirFromDetCoordDir(Vector3D const & direction) const {
return direction;
}
-Vector3D EarthModel::GetDetCoordPosFromEarthCoordPos(Vector3D const & point) const {
+Vector3D DetectorModel::GetDetCoordPosFromEarthCoordPos(Vector3D const & point) const {
return point - detector_origin_;
}
-Vector3D EarthModel::GetDetCoordDirFromEarthCoordDir(Vector3D const & direction) const {
+Vector3D DetectorModel::GetDetCoordDirFromEarthCoordDir(Vector3D const & direction) const {
return direction;
}
-void EarthModel::LoadConcentricShellsFromLegacyFile(std::string model_fname, double detector_depth, double ice_cap_angle) {
+void DetectorModel::LoadConcentricShellsFromLegacyFile(std::string model_fname, double detector_depth, double ice_cap_angle) {
if(model_fname.empty())
throw(std::runtime_error("Received empty earth model filename!"));
@@ -1381,7 +1381,7 @@ void EarthModel::LoadConcentricShellsFromLegacyFile(std::string model_fname, dou
throw(std::runtime_error(ss.str()));
}
- EarthSector sector;
+ DetectorSector sector;
sector.material_id = materials_.GetMaterialId(medtype);
sector.level = level;
sector.name = label;
@@ -1416,7 +1416,7 @@ void EarthModel::LoadConcentricShellsFromLegacyFile(std::string model_fname, dou
std::vector ice_layers;
bool saw_ice = false;
for(unsigned int i=1; i(sector.geo.get());
sector.geo = Sphere(Placement(Vector3D(0,0,ice_offset), QFromZXZr(0,0,0)), geo->GetRadius()-ice_offset, 0).create();
//geo->SetRadius(geo->GetRadius()-ice_offset);
@@ -1482,7 +1482,7 @@ void EarthModel::LoadConcentricShellsFromLegacyFile(std::string model_fname, dou
}
}
-double EarthModel::GetTargetMass(LI::dataclasses::Particle::ParticleType target) const {
+double DetectorModel::GetTargetMass(LI::dataclasses::Particle::ParticleType target) const {
double molar_mass = materials_.GetMolarMass(target); // grams per mole
return molar_mass * LI::utilities::Constants::GeV_per_amu;
}
diff --git a/projects/detector/private/Path.cxx b/projects/detector/private/Path.cxx
index b6e3af72..8b1e6d38 100644
--- a/projects/detector/private/Path.cxx
+++ b/projects/detector/private/Path.cxx
@@ -8,7 +8,7 @@
#include // for max
#include "LeptonInjector/dataclasses/Particle.h" // for Particle
-#include "LeptonInjector/detector/EarthModel.h" // for EarthModel
+#include "LeptonInjector/detector/DetectorModel.h" // for DetectorModel
#include "LeptonInjector/geometry/Geometry.h" // for Geometry
namespace LI {
@@ -18,21 +18,21 @@ Path::Path() {
}
-Path::Path(std::shared_ptr earth_model) {
- SetEarthModel(earth_model);
+Path::Path(std::shared_ptr earth_model) {
+ SetDetectorModel(earth_model);
}
-Path::Path(std::shared_ptr earth_model, math::Vector3D const & first_point, math::Vector3D const & last_point) {
- SetEarthModel(earth_model);
+Path::Path(std::shared_ptr earth_model, math::Vector3D const & first_point, math::Vector3D const & last_point) {
+ SetDetectorModel(earth_model);
SetPoints(first_point, last_point);
}
-Path::Path(std::shared_ptr earth_model, math::Vector3D const & first_point, math::Vector3D const & direction, double distance) {
- SetEarthModel(earth_model);
+Path::Path(std::shared_ptr earth_model, math::Vector3D const & first_point, math::Vector3D const & direction, double distance) {
+ SetDetectorModel(earth_model);
SetPointsWithRay(first_point, direction, distance);
}
-bool Path::HasEarthModel() {
+bool Path::HasDetectorModel() {
return set_earth_model_;
}
@@ -48,7 +48,7 @@ bool Path::HasColumnDepth() {
return set_column_depth_;
}
-std::shared_ptr Path::GetEarthModel() {
+std::shared_ptr Path::GetDetectorModel() {
return earth_model_;
}
@@ -72,12 +72,12 @@ geometry::Geometry::IntersectionList const & Path::GetIntersections() {
return intersections_;
}
-void Path::SetEarthModel(std::shared_ptr earth_model) {
+void Path::SetDetectorModel(std::shared_ptr earth_model) {
earth_model_ = earth_model;
set_earth_model_ = true;
}
-void Path::EnsureEarthModel() {
+void Path::EnsureDetectorModel() {
if(not set_earth_model_) {
throw(std::runtime_error("Earth model not set!"));
}
@@ -119,7 +119,7 @@ void Path::SetIntersections(geometry::Geometry::IntersectionList const & interse
}
void Path::ComputeIntersections() {
- EnsureEarthModel();
+ EnsureDetectorModel();
EnsurePoints();
intersections_ = earth_model_->GetIntersections(first_point_, direction_);
set_intersections_ = true;
@@ -134,7 +134,7 @@ void Path::EnsureIntersections() {
void Path::ClipToOuterBounds() {
EnsureIntersections();
EnsurePoints();
- geometry::Geometry::IntersectionList bounds = EarthModel::GetOuterBounds(intersections_);
+ geometry::Geometry::IntersectionList bounds = DetectorModel::GetOuterBounds(intersections_);
if(bounds.intersections.size() > 0) {
assert(bounds.intersections.size() == 2);
math::Vector3D p0 = bounds.intersections[0].position;
diff --git a/projects/detector/private/pybindings/Axis1D.h b/projects/detector/private/pybindings/Axis1D.h
index 16053d48..878e90d5 100644
--- a/projects/detector/private/pybindings/Axis1D.h
+++ b/projects/detector/private/pybindings/Axis1D.h
@@ -6,7 +6,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/Axis1D.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
diff --git a/projects/detector/private/pybindings/CartesianAxis1D.h b/projects/detector/private/pybindings/CartesianAxis1D.h
index faa7b1aa..92be73e0 100644
--- a/projects/detector/private/pybindings/CartesianAxis1D.h
+++ b/projects/detector/private/pybindings/CartesianAxis1D.h
@@ -6,7 +6,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/CartesianAxis1D.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
diff --git a/projects/detector/private/pybindings/CartesianAxisExponentialDensityDistribution.h b/projects/detector/private/pybindings/CartesianAxisExponentialDensityDistribution.h
index 32de67a1..a729538f 100644
--- a/projects/detector/private/pybindings/CartesianAxisExponentialDensityDistribution.h
+++ b/projects/detector/private/pybindings/CartesianAxisExponentialDensityDistribution.h
@@ -6,7 +6,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/CartesianAxisExponentialDensityDistribution.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
diff --git a/projects/detector/private/pybindings/CartesianAxisPolynomialDensityDistribution.h b/projects/detector/private/pybindings/CartesianAxisPolynomialDensityDistribution.h
index 4cf0cd93..f8d1ad64 100644
--- a/projects/detector/private/pybindings/CartesianAxisPolynomialDensityDistribution.h
+++ b/projects/detector/private/pybindings/CartesianAxisPolynomialDensityDistribution.h
@@ -6,7 +6,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/CartesianAxisPolynomialDensityDistribution.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
diff --git a/projects/detector/private/pybindings/ConstantDensityDistribution.h b/projects/detector/private/pybindings/ConstantDensityDistribution.h
index 479f3190..39936a65 100644
--- a/projects/detector/private/pybindings/ConstantDensityDistribution.h
+++ b/projects/detector/private/pybindings/ConstantDensityDistribution.h
@@ -6,7 +6,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/ConstantDensityDistribution.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
diff --git a/projects/detector/private/pybindings/ConstantDistribution1D.h b/projects/detector/private/pybindings/ConstantDistribution1D.h
index ab7a0e63..53b82155 100644
--- a/projects/detector/private/pybindings/ConstantDistribution1D.h
+++ b/projects/detector/private/pybindings/ConstantDistribution1D.h
@@ -6,7 +6,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/Distribution1D.h"
#include "../../public/LeptonInjector/detector/ConstantDistribution1D.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
diff --git a/projects/detector/private/pybindings/DensityDistribution.h b/projects/detector/private/pybindings/DensityDistribution.h
index 35b31b58..f681ca63 100644
--- a/projects/detector/private/pybindings/DensityDistribution.h
+++ b/projects/detector/private/pybindings/DensityDistribution.h
@@ -6,7 +6,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/DensityDistribution.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
diff --git a/projects/detector/private/pybindings/EarthModel.h b/projects/detector/private/pybindings/DetectorModel.h
similarity index 57%
rename from projects/detector/private/pybindings/EarthModel.h
rename to projects/detector/private/pybindings/DetectorModel.h
index c133b069..0eab19d6 100644
--- a/projects/detector/private/pybindings/EarthModel.h
+++ b/projects/detector/private/pybindings/DetectorModel.h
@@ -5,122 +5,122 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
-void register_EarthModel(pybind11::module_ & m) {
+void register_DetectorModel(pybind11::module_ & m) {
using namespace pybind11;
using namespace LI::detector;
- class_>(m, "EarthModel")
+ class_>(m, "DetectorModel")
.def(init<>())
.def(init())
.def(init())
- .def("LoadEarthModel",&EarthModel::LoadEarthModel)
- .def("LoadMaterialModel",&EarthModel::LoadMaterialModel)
+ .def("LoadDetectorModel",&DetectorModel::LoadDetectorModel)
+ .def("LoadMaterialModel",&DetectorModel::LoadMaterialModel)
.def("GetMassDensity", (
- double (EarthModel::*)(LI::geometry::Geometry::IntersectionList const &, LI::math::Vector3D const &) const
- )(&EarthModel::GetMassDensity))
+ double (DetectorModel::*)(LI::geometry::Geometry::IntersectionList const &, LI::math::Vector3D const &) const
+ )(&DetectorModel::GetMassDensity))
.def("GetMassDensity", (
- double (EarthModel::*)(LI::math::Vector3D const &) const
- )(&EarthModel::GetMassDensity))
+ double (DetectorModel::*)(LI::math::Vector3D const &) const
+ )(&DetectorModel::GetMassDensity))
.def("GetParticleDensity", (
- double (EarthModel::*)(LI::geometry::Geometry::IntersectionList const &, LI::math::Vector3D const &, LI::dataclasses::Particle::ParticleType) const
- )(&EarthModel::GetParticleDensity))
+ double (DetectorModel::*)(LI::geometry::Geometry::IntersectionList const &, LI::math::Vector3D const &, LI::dataclasses::Particle::ParticleType) const
+ )(&DetectorModel::GetParticleDensity))
.def("GetParticleDensity", (
- double (EarthModel::*)(LI::math::Vector3D const &, LI::dataclasses::Particle::ParticleType) const
- )(&EarthModel::GetParticleDensity))
+ double (DetectorModel::*)(LI::math::Vector3D const &, LI::dataclasses::Particle::ParticleType) const
+ )(&DetectorModel::GetParticleDensity))
.def("GetInteractionDensity", (
- double (EarthModel::*)(LI::geometry::Geometry::IntersectionList const &,
+ double (DetectorModel::*)(LI::geometry::Geometry::IntersectionList const &,
LI::math::Vector3D const &,
std::vector const &,
std::vector const &,
double const &) const
- )(&EarthModel::GetInteractionDensity))
+ )(&DetectorModel::GetInteractionDensity))
.def("GetInteractionDensity", (
- double (EarthModel::*)(LI::math::Vector3D const &,
+ double (DetectorModel::*)(LI::math::Vector3D const &,
std::vector const &,
std::vector const &,
double const &) const
- )(&EarthModel::GetInteractionDensity))
+ )(&DetectorModel::GetInteractionDensity))
.def("GetColumnDepthInCGS", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::geometry::Geometry::IntersectionList const &,
LI::math::Vector3D const &,
LI::math::Vector3D const &) const
- )(&EarthModel::GetColumnDepthInCGS))
+ )(&DetectorModel::GetColumnDepthInCGS))
.def("GetColumnDepthInCGS", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::math::Vector3D const &,
LI::math::Vector3D const &) const
- )(&EarthModel::GetColumnDepthInCGS))
+ )(&DetectorModel::GetColumnDepthInCGS))
.def("DistanceForColumnDepthFromPoint", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::geometry::Geometry::IntersectionList const &,
LI::math::Vector3D const &,
LI::math::Vector3D const &,
double) const
- )(&EarthModel::DistanceForColumnDepthFromPoint))
+ )(&DetectorModel::DistanceForColumnDepthFromPoint))
.def("DistanceForColumnDepthFromPoint", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::math::Vector3D const &,
LI::math::Vector3D const &,
double) const
- )(&EarthModel::DistanceForColumnDepthFromPoint))
+ )(&DetectorModel::DistanceForColumnDepthFromPoint))
.def("DistanceForColumnDepthToPoint", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::geometry::Geometry::IntersectionList const &,
LI::math::Vector3D const &,
LI::math::Vector3D const &,
double) const
- )(&EarthModel::DistanceForColumnDepthToPoint))
+ )(&DetectorModel::DistanceForColumnDepthToPoint))
.def("DistanceForColumnDepthToPoint", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::math::Vector3D const &,
LI::math::Vector3D const &,
double) const
- )(&EarthModel::DistanceForColumnDepthToPoint))
+ )(&DetectorModel::DistanceForColumnDepthToPoint))
.def("GetMassDensity", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::geometry::Geometry::IntersectionList const &,
LI::math::Vector3D const &,
std::set) const
- )(&EarthModel::GetMassDensity))
+ )(&DetectorModel::GetMassDensity))
.def("GetMassDensity", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::math::Vector3D const &,
std::set) const
- )(&EarthModel::GetMassDensity))
+ )(&DetectorModel::GetMassDensity))
.def("GetParticleDensity", (
- std::vector (EarthModel::*)(
+ std::vector (DetectorModel::*)(
LI::geometry::Geometry::IntersectionList const &,
LI::math::Vector3D const &,
std::set) const
- )(&EarthModel::GetParticleDensity))
+ )(&DetectorModel::GetParticleDensity))
.def("GetParticleDensity", (
- std::vector (EarthModel::*)(
+ std::vector (DetectorModel::*)(
LI::math::Vector3D const &,
std::set) const
- )(&EarthModel::GetParticleDensity))
+ )(&DetectorModel::GetParticleDensity))
.def("GetInteractionDepthInCGS", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::geometry::Geometry::IntersectionList const &,
LI::math::Vector3D const &,
LI::math::Vector3D const &,
std::vector const &,
std::vector const &,
double const &) const
- )(&EarthModel::GetInteractionDepthInCGS))
+ )(&DetectorModel::GetInteractionDepthInCGS))
.def("GetInteractionDepthInCGS", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::math::Vector3D const &,
LI::math::Vector3D const &,
std::vector const &,
std::vector const &,
double const &) const
- )(&EarthModel::GetInteractionDepthInCGS))
+ )(&DetectorModel::GetInteractionDepthInCGS))
.def("DistanceForInteractionDepthFromPoint", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::geometry::Geometry::IntersectionList const &,
LI::math::Vector3D const &,
LI::math::Vector3D const &,
@@ -128,18 +128,18 @@ void register_EarthModel(pybind11::module_ & m) {
std::vector const &,
std::vector const &,
double const &) const
- )(&EarthModel::DistanceForInteractionDepthFromPoint))
+ )(&DetectorModel::DistanceForInteractionDepthFromPoint))
.def("DistanceForInteractionDepthFromPoint", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::math::Vector3D const &,
LI::math::Vector3D const &,
double,
std::vector const &,
std::vector const &,
double const &) const
- )(&EarthModel::DistanceForInteractionDepthFromPoint))
+ )(&DetectorModel::DistanceForInteractionDepthFromPoint))
.def("DistanceForInteractionDepthToPoint", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::geometry::Geometry::IntersectionList const &,
LI::math::Vector3D const &,
LI::math::Vector3D const &,
@@ -147,86 +147,86 @@ void register_EarthModel(pybind11::module_ & m) {
std::vector const &,
std::vector const &,
double const &) const
- )(&EarthModel::DistanceForInteractionDepthToPoint))
+ )(&DetectorModel::DistanceForInteractionDepthToPoint))
.def("DistanceForInteractionDepthToPoint", (
- double (EarthModel::*)(
+ double (DetectorModel::*)(
LI::math::Vector3D const &,
LI::math::Vector3D const &,
double,
std::vector const &,
std::vector const &,
double const &) const
- )(&EarthModel::DistanceForInteractionDepthToPoint))
+ )(&DetectorModel::DistanceForInteractionDepthToPoint))
.def("GetParticleColumnDepth", (
- std::vector (EarthModel::*)(
+ std::vector (DetectorModel::*)(
LI::geometry::Geometry::IntersectionList const &,
LI::math::Vector3D const &,
LI::math::Vector3D const &,
std::vector const &) const
- )(&EarthModel::GetParticleColumnDepth))
+ )(&DetectorModel::GetParticleColumnDepth))
.def("GetContainingSector", (
- EarthSector (EarthModel::*)(
+ DetectorSector (DetectorModel::*)(
LI::geometry::Geometry::IntersectionList const &,
LI::math::Vector3D const & p0) const
- )(&EarthModel::GetContainingSector))
+ )(&DetectorModel::GetContainingSector))
.def("GetContainingSector", (
- EarthSector (EarthModel::*)(
+ DetectorSector (DetectorModel::*)(
LI::math::Vector3D const & p0) const
- )(&EarthModel::GetContainingSector))
+ )(&DetectorModel::GetContainingSector))
.def("GetEarthCoordPosFromDetCoordPos", (
- LI::math::Vector3D (EarthModel::*)(
+ LI::math::Vector3D (DetectorModel::*)(
LI::math::Vector3D const &) const
- )(&EarthModel::GetEarthCoordPosFromDetCoordPos))
+ )(&DetectorModel::GetEarthCoordPosFromDetCoordPos))
.def("GetEarthCoordDirFromDetCoordDir", (
- LI::math::Vector3D (EarthModel::*)(
+ LI::math::Vector3D (DetectorModel::*)(
LI::math::Vector3D const &) const
- )(&EarthModel::GetEarthCoordDirFromDetCoordDir))
+ )(&DetectorModel::GetEarthCoordDirFromDetCoordDir))
.def("GetDetCoordPosFromEarthCoordPos", (
- LI::math::Vector3D (EarthModel::*)(
+ LI::math::Vector3D (DetectorModel::*)(
LI::math::Vector3D const &) const
- )(&EarthModel::GetDetCoordPosFromEarthCoordPos))
+ )(&DetectorModel::GetDetCoordPosFromEarthCoordPos))
.def("GetDetCoordDirFromEarthCoordDir", (
- LI::math::Vector3D (EarthModel::*)(
+ LI::math::Vector3D (DetectorModel::*)(
LI::math::Vector3D const &) const
- )(&EarthModel::GetDetCoordDirFromEarthCoordDir))
- .def_property("Path", &EarthModel::GetPath, &EarthModel::SetPath)
- .def_property("Materials", &EarthModel::GetMaterials, &EarthModel::SetMaterials)
- .def_property("Sectors", &EarthModel::GetSectors, &EarthModel::SetSectors)
- .def_property("DetectorOrigin", &EarthModel::GetDetectorOrigin, &EarthModel::SetDetectorOrigin)
- .def("AddSector", &EarthModel::AddSector)
- .def("GetSector", &EarthModel::GetSector)
- .def("ClearSectors", &EarthModel::ClearSectors)
- .def("GetIntersections", &EarthModel::GetIntersections)
+ )(&DetectorModel::GetDetCoordDirFromEarthCoordDir))
+ .def_property("Path", &DetectorModel::GetPath, &DetectorModel::SetPath)
+ .def_property("Materials", &DetectorModel::GetMaterials, &DetectorModel::SetMaterials)
+ .def_property("Sectors", &DetectorModel::GetSectors, &DetectorModel::SetSectors)
+ .def_property("DetectorOrigin", &DetectorModel::GetDetectorOrigin, &DetectorModel::SetDetectorOrigin)
+ .def("AddSector", &DetectorModel::AddSector)
+ .def("GetSector", &DetectorModel::GetSector)
+ .def("ClearSectors", &DetectorModel::ClearSectors)
+ .def("GetIntersections", &DetectorModel::GetIntersections)
.def_static("SortIntersections", (
void (*)(LI::geometry::Geometry::IntersectionList &)
- )(&EarthModel::SortIntersections))
+ )(&DetectorModel::SortIntersections))
.def_static("SortIntersections", (
void (*)(std::vector &)
- )(&EarthModel::SortIntersections))
- .def_static("SectorLoop", &EarthModel::SectorLoop)
+ )(&DetectorModel::SortIntersections))
+ .def_static("SectorLoop", &DetectorModel::SectorLoop)
.def_static("GetOuterBoundsFromIntersections", (
LI::geometry::Geometry::IntersectionList (*)(
LI::geometry::Geometry::IntersectionList const &)
- )(&EarthModel::GetOuterBounds))
- .def("GetOuterBounds", [](LI::detector::EarthModel const & earth, LI::geometry::Geometry::IntersectionList const & intersections){
+ )(&DetectorModel::GetOuterBounds))
+ .def("GetOuterBounds", [](LI::detector::DetectorModel const & earth, LI::geometry::Geometry::IntersectionList const & intersections){
return earth.GetOuterBounds(intersections);
})
.def("GetOuterBounds", (
- LI::geometry::Geometry::IntersectionList (EarthModel::*)(
+ LI::geometry::Geometry::IntersectionList (DetectorModel::*)(
LI::math::Vector3D const &,
LI::math::Vector3D const &) const
- )(&EarthModel::GetOuterBounds))
+ )(&DetectorModel::GetOuterBounds))
.def("GetAvailableTargets", (
- std::set (EarthModel::*)(
+ std::set (DetectorModel::*)(
LI::geometry::Geometry::IntersectionList const &,
std::array const &) const
- )(&EarthModel::GetAvailableTargets))
+ )(&DetectorModel::GetAvailableTargets))
.def("GetAvailableTargets", (
- std::set (EarthModel::*)(
+ std::set (DetectorModel::*)(
std::array const &) const
- )(&EarthModel::GetAvailableTargets))
- .def("GetTargetMass", &EarthModel::GetTargetMass)
- .def("GetMaterials",&EarthModel::GetMaterials)
- .def("GetDetectorOrigin",&EarthModel::GetDetectorOrigin);
+ )(&DetectorModel::GetAvailableTargets))
+ .def("GetTargetMass", &DetectorModel::GetTargetMass)
+ .def("GetMaterials",&DetectorModel::GetMaterials)
+ .def("GetDetectorOrigin",&DetectorModel::GetDetectorOrigin);
}
diff --git a/projects/detector/private/pybindings/DetectorSector.h b/projects/detector/private/pybindings/DetectorSector.h
new file mode 100644
index 00000000..ab0b163c
--- /dev/null
+++ b/projects/detector/private/pybindings/DetectorSector.h
@@ -0,0 +1,27 @@
+#include
+#include
+#include
+
+#include
+
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
+
+std::string to_str(LI::detector::DetectorSector const & sector) {
+ std::stringstream ss;
+ sector.Print(ss);
+ return ss.str();
+}
+
+void register_DetectorSector(pybind11::module_ & m) {
+ using namespace pybind11;
+ using namespace LI::detector;
+
+ class_>(m, "DetectorSector")
+ .def(init<>())
+ .def("__str__", &to_str)
+ .def_readwrite("name",&DetectorSector::name)
+ .def_readwrite("material_id",&DetectorSector::material_id)
+ .def_readwrite("level", &DetectorSector::level)
+ .def_readwrite("geo",&DetectorSector::geo)
+ .def_readwrite("density",&DetectorSector::density);
+}
diff --git a/projects/detector/private/pybindings/Distribution1D.h b/projects/detector/private/pybindings/Distribution1D.h
index dfff9703..8bd255e2 100644
--- a/projects/detector/private/pybindings/Distribution1D.h
+++ b/projects/detector/private/pybindings/Distribution1D.h
@@ -6,7 +6,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/Distribution1D.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
diff --git a/projects/detector/private/pybindings/EarthSector.h b/projects/detector/private/pybindings/EarthSector.h
deleted file mode 100644
index 955aee19..00000000
--- a/projects/detector/private/pybindings/EarthSector.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#include
-#include
-#include
-
-#include
-
-#include "../../public/LeptonInjector/detector/EarthModel.h"
-
-std::string to_str(LI::detector::EarthSector const & sector) {
- std::stringstream ss;
- sector.Print(ss);
- return ss.str();
-}
-
-void register_EarthSector(pybind11::module_ & m) {
- using namespace pybind11;
- using namespace LI::detector;
-
- class_>(m, "EarthSector")
- .def(init<>())
- .def("__str__", &to_str)
- .def_readwrite("name",&EarthSector::name)
- .def_readwrite("material_id",&EarthSector::material_id)
- .def_readwrite("level", &EarthSector::level)
- .def_readwrite("geo",&EarthSector::geo)
- .def_readwrite("density",&EarthSector::density);
-}
diff --git a/projects/detector/private/pybindings/ExponentialDistribution1D.h b/projects/detector/private/pybindings/ExponentialDistribution1D.h
index 1188c910..dcc58ba3 100644
--- a/projects/detector/private/pybindings/ExponentialDistribution1D.h
+++ b/projects/detector/private/pybindings/ExponentialDistribution1D.h
@@ -6,7 +6,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/Distribution1D.h"
#include "../../public/LeptonInjector/detector/ExponentialDistribution1D.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
diff --git a/projects/detector/private/pybindings/Path.h b/projects/detector/private/pybindings/Path.h
index 4066f73b..34d55206 100644
--- a/projects/detector/private/pybindings/Path.h
+++ b/projects/detector/private/pybindings/Path.h
@@ -4,7 +4,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/Path.h"
void register_Path(pybind11::module_ & m) {
@@ -12,16 +12,16 @@ void register_Path(pybind11::module_ & m) {
using namespace LI::detector;
class_>(m, "Path")
- .def(init>())
- .def(init, LI::math::Vector3D const &, LI::math::Vector3D const &>())
- .def(init, LI::math::Vector3D const &, LI::math::Vector3D const &, double>())
+ .def(init>())
+ .def(init, LI::math::Vector3D const &, LI::math::Vector3D const &>())
+ .def(init, LI::math::Vector3D const &, LI::math::Vector3D const &, double>())
- .def("HasEarthModel",&Path::HasEarthModel)
+ .def("HasDetectorModel",&Path::HasDetectorModel)
.def("HasPoints",&Path::HasPoints)
.def("HasIntersections",&Path::HasIntersections)
.def("HasColumnDepth",&Path::HasColumnDepth)
- .def("GetEarthModel",&Path::GetEarthModel)
- .def("HasEarthModel",&Path::HasEarthModel)
+ .def("GetDetectorModel",&Path::GetDetectorModel)
+ .def("HasDetectorModel",&Path::HasDetectorModel)
.def("GetFirstPoint",&Path::GetFirstPoint)
.def("GetLastPoint",&Path::GetLastPoint)
.def("GetDirection",&Path::GetDirection)
diff --git a/projects/detector/private/pybindings/PolynomialDistribution1D.h b/projects/detector/private/pybindings/PolynomialDistribution1D.h
index 8b64383c..fea51d93 100644
--- a/projects/detector/private/pybindings/PolynomialDistribution1D.h
+++ b/projects/detector/private/pybindings/PolynomialDistribution1D.h
@@ -6,7 +6,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/Distribution1D.h"
#include "../../public/LeptonInjector/detector/PolynomialDistribution1D.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
diff --git a/projects/detector/private/pybindings/RadialAxis1D.h b/projects/detector/private/pybindings/RadialAxis1D.h
index 2e43e5ba..a7a52583 100644
--- a/projects/detector/private/pybindings/RadialAxis1D.h
+++ b/projects/detector/private/pybindings/RadialAxis1D.h
@@ -6,7 +6,7 @@
#include
#include
-#include "../../public/LeptonInjector/detector/EarthModel.h"
+#include "../../public/LeptonInjector/detector/DetectorModel.h"
#include "../../public/LeptonInjector/detector/Axis1D.h"
#include "../../public/LeptonInjector/detector/RadialAxis1D.h"
#include "../../../geometry/public/LeptonInjector/geometry/Geometry.h"
diff --git a/projects/detector/private/pybindings/detector.cxx b/projects/detector/private/pybindings/detector.cxx
index 6d0704fc..37a33cbc 100644
--- a/projects/detector/private/pybindings/detector.cxx
+++ b/projects/detector/private/pybindings/detector.cxx
@@ -1,8 +1,8 @@
#include
#include
-#include "./EarthModel.h"
-#include "./EarthSector.h"
+#include "./DetectorModel.h"
+#include "./DetectorSector.h"
#include "./Path.h"
#include "./DensityDistribution.h"
#include "./Distribution1D.h"
@@ -20,8 +20,8 @@
using namespace pybind11;
PYBIND11_MODULE(detector,m) {
- register_EarthModel(m);
- register_EarthSector(m);
+ register_DetectorModel(m);
+ register_DetectorSector(m);
register_Path(m);
register_DensityDistribution(m);
register_Distribution1D(m);
diff --git a/projects/detector/private/pybindings/earthmodel-service.cxx b/projects/detector/private/pybindings/earthmodel-service.cxx
index 521eebf6..864b48ae 100644
--- a/projects/detector/private/pybindings/earthmodel-service.cxx
+++ b/projects/detector/private/pybindings/earthmodel-service.cxx
@@ -8,8 +8,8 @@
#include
#include
#include
-#include
-#include
+#include
+#include
// #include
#include
@@ -71,13 +71,13 @@ void ListToVec(std::vector &ret, boost::python::list l){
}
namespace earthmodel{
- struct LIEarthModelCalculator {
+ struct LIDetectorModelCalculator {
};
}
-BOOST_PYTHON_MODULE(EarthModelService){
+BOOST_PYTHON_MODULE(DetectorModelService){
using namespace earthmodel;
- typedef std::vector Sectors;
+ typedef std::vector Sectors;
class_("Sectors")
.def(vector_indexing_suite());
@@ -109,57 +109,57 @@ BOOST_PYTHON_MODULE(EarthModelService){
.def("SetSphericalCoordinates",&Vector3D::SetSphericalCoordinates)
;
- class_("EarthSector", init<>())
- .def_readwrite("name", &EarthSector::name)
- .def_readwrite("material_id", &EarthSector::material_id)
- .def_readwrite("level", &EarthSector::level)
- .def_readwrite("geo", &EarthSector::geo)
- .def_readwrite("density", &EarthSector::density)
+ class_("DetectorSector", init<>())
+ .def_readwrite("name", &DetectorSector::name)
+ .def_readwrite("material_id", &DetectorSector::material_id)
+ .def_readwrite("level", &DetectorSector::level)
+ .def_readwrite("geo", &DetectorSector::geo)
+ .def_readwrite("density", &DetectorSector::density)
;
- double (EarthModel::*GetMassDensity_cached)(Geometry::IntersectionList const & intersections, Vector3D const & p0) const = &EarthModel::GetMassDensity;
- double (EarthModel::*GetMassDensity)(Vector3D const & p0) const = &EarthModel::GetMassDensity;
+ double (DetectorModel::*GetMassDensity_cached)(Geometry::IntersectionList const & intersections, Vector3D const & p0) const = &DetectorModel::GetMassDensity;
+ double (DetectorModel::*GetMassDensity)(Vector3D const & p0) const = &DetectorModel::GetMassDensity;
- double (EarthModel::*DistanceForColumnDepthToPoint_cached)(Geometry::IntersectionList const & intersections, Vector3D const & end_point, Vector3D const & direction, double column_depth) const = &EarthModel::DistanceForColumnDepthToPoint;
- double (EarthModel::*DistanceForColumnDepthToPoint)(Vector3D const & end_point, Vector3D const & direction, double column_depth) const = &EarthModel::DistanceForColumnDepthToPoint;
+ double (DetectorModel::*DistanceForColumnDepthToPoint_cached)(Geometry::IntersectionList const & intersections, Vector3D const & end_point, Vector3D const & direction, double column_depth) const = &DetectorModel::DistanceForColumnDepthToPoint;
+ double (DetectorModel::*DistanceForColumnDepthToPoint)(Vector3D const & end_point, Vector3D const & direction, double column_depth) const = &DetectorModel::DistanceForColumnDepthToPoint;
- class_("EarthModel", init<>())
+ class_("DetectorModel", init<>())
.def(init())
.def(init())
- .def("LoadEarthModel",&EarthModel::LoadEarthModel)
- .def("LoadMaterialModel",&EarthModel::LoadMaterialModel)
- //.def("GetColumnDepthInCGS",&EarthModel::GetColumnDepthInCGS)
+ .def("LoadDetectorModel",&DetectorModel::LoadDetectorModel)
+ .def("LoadMaterialModel",&DetectorModel::LoadMaterialModel)
+ //.def("GetColumnDepthInCGS",&DetectorModel::GetColumnDepthInCGS)
.def("GetColumnDepthInCGS", GetMassDensity)
.def("GetColumnDepthInCGS", GetMassDensity_cached)
.def("DistanceForColumnDepthToPoint", DistanceForColumnDepthToPoint)
.def("DistanceForColumnDepthToPoint", DistanceForColumnDepthToPoint_cached)
- .def("GetEarthCoordPosFromDetCoordPos",&EarthModel::GetEarthCoordPosFromDetCoordPos)
- .def("GetEarthCoordDirFromDetCoordDir",&EarthModel::GetEarthCoordDirFromDetCoordDir)
- .def("GetDetCoordPosFromEarthCoordPos",&EarthModel::GetDetCoordPosFromEarthCoordPos)
- .def("GetDetCoordDirFromEarthCoordDir",&EarthModel::GetDetCoordDirFromEarthCoordDir)
- .def("GetPath",&EarthModel::GetPath)
- .def("SetPath",&EarthModel::SetPath)
- .def("GetMaterials",&EarthModel::GetMaterials, return_value_policy())
- .def("SetMaterials",&EarthModel::SetMaterials)
- .def("GetSectors",&EarthModel::GetSectors, return_value_policy())
- .def("SetSectors",&EarthModel::SetSectors)
- .def("GetDetectorOrigin",&EarthModel::GetDetectorOrigin)
- .def("SetDetectorOrigin",&EarthModel::SetDetectorOrigin)
- .def("AddSector",&EarthModel::AddSector)
- .def("GetSector",&EarthModel::GetSector)
- .def("ClearSectors",&EarthModel::ClearSectors)
+ .def("GetEarthCoordPosFromDetCoordPos",&DetectorModel::GetEarthCoordPosFromDetCoordPos)
+ .def("GetEarthCoordDirFromDetCoordDir",&DetectorModel::GetEarthCoordDirFromDetCoordDir)
+ .def("GetDetCoordPosFromEarthCoordPos",&DetectorModel::GetDetCoordPosFromEarthCoordPos)
+ .def("GetDetCoordDirFromEarthCoordDir",&DetectorModel::GetDetCoordDirFromEarthCoordDir)
+ .def("GetPath",&DetectorModel::GetPath)
+ .def("SetPath",&DetectorModel::SetPath)
+ .def("GetMaterials",&DetectorModel::GetMaterials, return_value_policy())
+ .def("SetMaterials",&DetectorModel::SetMaterials)
+ .def("GetSectors",&DetectorModel::GetSectors, return_value_policy())
+ .def("SetSectors",&DetectorModel::SetSectors)
+ .def("GetDetectorOrigin",&DetectorModel::GetDetectorOrigin)
+ .def("SetDetectorOrigin",&DetectorModel::SetDetectorOrigin)
+ .def("AddSector",&DetectorModel::AddSector)
+ .def("GetSector",&DetectorModel::GetSector)
+ .def("ClearSectors",&DetectorModel::ClearSectors)
;
{
- scope earthmodel = class_("EarthModelCalculator");
-
- def("GetImpactParameter", &EarthModelCalculator::GetImpactParameter);
- def("GetIntersectionsWithSphere", &EarthModelCalculator::GetIntersectionsWithSphere);
- def("GetDistsToIntersectionsWithSphere", &EarthModelCalculator::GetDistsToIntersectionsWithSphere);
- def("GetLeptonRange", &EarthModelCalculator::GetLeptonRange);
- def("ColumnDepthCGStoMWE",&EarthModelCalculator::ColumnDepthCGStoMWE);
- def("MWEtoColumnDepthCGS",&EarthModelCalculator::MWEtoColumnDepthCGS);
+ scope earthmodel = class_("DetectorModelCalculator");
+
+ def("GetImpactParameter", &DetectorModelCalculator::GetImpactParameter);
+ def("GetIntersectionsWithSphere", &DetectorModelCalculator::GetIntersectionsWithSphere);
+ def("GetDistsToIntersectionsWithSphere", &DetectorModelCalculator::GetDistsToIntersectionsWithSphere);
+ def("GetLeptonRange", &DetectorModelCalculator::GetLeptonRange);
+ def("ColumnDepthCGStoMWE",&DetectorModelCalculator::ColumnDepthCGStoMWE);
+ def("MWEtoColumnDepthCGS",&DetectorModelCalculator::MWEtoColumnDepthCGS);
}
using namespace scitbx::boost_python::container_conversions;
diff --git a/projects/detector/private/test/EarthModel_TEST.cxx b/projects/detector/private/test/DetectorModel_TEST.cxx
similarity index 83%
rename from projects/detector/private/test/EarthModel_TEST.cxx
rename to projects/detector/private/test/DetectorModel_TEST.cxx
index 269b6eea..125fc337 100644
--- a/projects/detector/private/test/EarthModel_TEST.cxx
+++ b/projects/detector/private/test/DetectorModel_TEST.cxx
@@ -13,7 +13,7 @@
#include "LeptonInjector/geometry/Geometry.h"
#include "LeptonInjector/geometry/Sphere.h"
-#include "LeptonInjector/detector/EarthModel.h"
+#include "LeptonInjector/detector/DetectorModel.h"
#include "LeptonInjector/utilities/Constants.h"
#include "LeptonInjector/detector/DensityDistribution.h"
#include "LeptonInjector/detector/Distribution1D.h"
@@ -25,7 +25,7 @@
#include "LeptonInjector/detector/ExponentialDistribution1D.h"
#include "LeptonInjector/detector/DensityDistribution1D.h"
-#include "FakeEarthModel.h"
+#include "FakeDetectorModel.h"
#include "FakeMaterialModel.h"
using namespace LI::math;
@@ -36,12 +36,12 @@ using namespace LI::dataclasses;
TEST(Constructor, Default)
{
- EXPECT_NO_THROW(EarthModel A);
+ EXPECT_NO_THROW(DetectorModel A);
}
TEST(DefaultMaterials, VacuumOnly)
{
- EarthModel A;
+ DetectorModel A;
MaterialModel materials = A.GetMaterials();
int material_count = 0;
@@ -86,7 +86,7 @@ TEST(DefaultMaterials, VacuumOnly)
}
/*
- EarthSector sector;
+ DetectorSector sector;
sector.material_id = materials_.GetMaterialId("VACUUM");
sector.level = sectors_.size();
sector.geo = Sphere(Vector3D(0,0,0), std::numeric_limits::infinity(), 0).create();
@@ -96,10 +96,10 @@ TEST(DefaultMaterials, VacuumOnly)
TEST(DefaultSectors, VacuumOnly)
{
- EarthModel A;
- std::vector sectors = A.GetSectors();
+ DetectorModel A;
+ std::vector sectors = A.GetSectors();
ASSERT_EQ(1, sectors.size());
- EarthSector sector = sectors[0];
+ DetectorSector sector = sectors[0];
EXPECT_EQ(0, sector.material_id);
EXPECT_EQ(std::numeric_limits::min(), sector.level);
Sphere geo(Vector3D(0,0,0),std::numeric_limits::infinity(), 0);
@@ -108,44 +108,44 @@ TEST(DefaultSectors, VacuumOnly)
EXPECT_EQ(density, *sector.density);
}
-TEST_F(FakeMaterialModelTest, EarthModelConstructorEmptyModel)
+TEST_F(FakeMaterialModelTest, DetectorModelConstructorEmptyModel)
{
- EXPECT_THROW(EarthModel A("", materials_file), std::runtime_error);
+ EXPECT_THROW(DetectorModel A("", materials_file), std::runtime_error);
}
-TEST_F(FakeMaterialModelTest, EarthModelConstructorEmptyPathEmptyModel)
+TEST_F(FakeMaterialModelTest, DetectorModelConstructorEmptyPathEmptyModel)
{
- EXPECT_THROW(EarthModel A("", "", materials_file), std::runtime_error);
+ EXPECT_THROW(DetectorModel A("", "", materials_file), std::runtime_error);
}
-TEST(Constructor, EarthModelConstructorEmptyModelEmptyMaterials)
+TEST(Constructor, DetectorModelConstructorEmptyModelEmptyMaterials)
{
- EXPECT_THROW(EarthModel A("", ""), std::runtime_error);
+ EXPECT_THROW(DetectorModel A("", ""), std::runtime_error);
}
-TEST(Constructor, EarthModelConstructorEmptyPathEmptyModelEmptyMaterials)
+TEST(Constructor, DetectorModelConstructorEmptyPathEmptyModelEmptyMaterials)
{
- EXPECT_THROW(EarthModel A("", "", ""), std::runtime_error);
+ EXPECT_THROW(DetectorModel A("", "", ""), std::runtime_error);
}
-TEST_F(FakeMaterialModelTest, EarthModelConstructorEmptyPathBadModel)
+TEST_F(FakeMaterialModelTest, DetectorModelConstructorEmptyPathBadModel)
{
- EXPECT_THROW(EarthModel("", std::tmpnam(nullptr), materials_file), std::runtime_error);
+ EXPECT_THROW(DetectorModel("", std::tmpnam(nullptr), materials_file), std::runtime_error);
}
-TEST_F(FakeMaterialModelTest, EarthModelConstructorBadModel)
+TEST_F(FakeMaterialModelTest, DetectorModelConstructorBadModel)
{
- EXPECT_THROW(EarthModel(std::tmpnam(nullptr), materials_file), std::runtime_error);
+ EXPECT_THROW(DetectorModel(std::tmpnam(nullptr), materials_file), std::runtime_error);
}
-TEST_F(FakeMaterialModelTest, EarthModelConstructorBadModelEmptyMaterial)
+TEST_F(FakeMaterialModelTest, DetectorModelConstructorBadModelEmptyMaterial)
{
- EXPECT_THROW(EarthModel(std::tmpnam(nullptr), ""), std::runtime_error);
+ EXPECT_THROW(DetectorModel(std::tmpnam(nullptr), ""), std::runtime_error);
}
TEST(Path, SetGet)
{
- EarthModel A;
+ DetectorModel A;
std::string result;
std::string expect;
A.SetPath("a");
@@ -167,7 +167,7 @@ TEST(Path, SetGet)
TEST(EdgeCases, ColumnDepthWithEqualPoints)
{
- EarthModel A;
+ DetectorModel A;
unsigned int N_rand = 1000;
for(unsigned int i=0; i sectors = A.GetSectors();
+ std::vector sectors = A.GetSectors();
EXPECT_EQ(layer_names.size(), sectors.size() - 1);
unsigned int n_layers = std::min(layer_names.size(), sectors.size() - 1);
for(unsigned int j=0; j sectors = A.GetSectors();
+ std::vector sectors = A.GetSectors();
EXPECT_EQ(layer_materials.size(), sectors.size() - 1);
unsigned int n_layers = std::min(layer_materials.size(), sectors.size() - 1);
MaterialModel materials = A.GetMaterials();
@@ -248,26 +248,26 @@ TEST_F(FakeLegacyEarthModelTest, LegacyFileLayerMaterials)
}
}
-TEST_F(FakeLegacyEarthModelTest, LegacyFileSectorTypes)
+TEST_F(FakeLegacyDetectorModelTest, LegacyFileSectorTypes)
{
unsigned int N_rand = 1000;
for(unsigned int i=0; i sectors = A.GetSectors();
+ std::vector sectors = A.GetSectors();
unsigned int n_layers = sectors.size()-1;
ASSERT_EQ(n_layers, layer_thicknesses.size());
double max_radius = 0.0;
for(unsigned int j=0; j geo = sector.geo;
Placement placement = geo->GetPlacement();
Sphere const* sphere = dynamic_cast(geo.get());
@@ -308,25 +308,25 @@ TEST_F(FakeLegacyEarthModelTest, LegacyFileSectorTypes)
}
}
-TEST_F(FakeLegacyEarthModelTest, LegacyFileGetMassDensityCachedIntersections)
+TEST_F(FakeLegacyDetectorModelTest, LegacyFileGetMassDensityCachedIntersections)
{
unsigned int N_rand = 1000;
for(unsigned int i=0; i sectors = A.GetSectors();
+ std::vector sectors = A.GetSectors();
ASSERT_EQ(2, sectors.size());
- EarthSector sector = sectors[1];
+ DetectorSector sector = sectors[1];
Sphere const * sphere = dynamic_cast(sector.geo.get());
ASSERT_TRUE(sphere);
double max_radius = sphere->GetRadius();
@@ -417,21 +417,21 @@ TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantIntegralInternal)
}
}
-TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantGetMassDensityInternal)
+TEST_F(FakeLegacyDetectorModelTest, LegacyFileConstantGetMassDensityInternal)
{
unsigned int N_rand = 1000;
for(unsigned int i=0; i sectors = A.GetSectors();
+ std::vector sectors = A.GetSectors();
ASSERT_EQ(2, sectors.size());
- EarthSector sector = sectors[1];
+ DetectorSector sector = sectors[1];
Sphere const * sphere = dynamic_cast(sector.geo.get());
ASSERT_TRUE(sphere);
double max_radius = sphere->GetRadius();
@@ -445,23 +445,23 @@ TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantGetMassDensityInternal)
}
}
-TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantIntegralNested)
+TEST_F(FakeLegacyDetectorModelTest, LegacyFileConstantIntegralNested)
{
unsigned int N_rand = 1000;
for(unsigned int i=0; i sectors = A.GetSectors();
+ std::vector sectors = A.GetSectors();
ASSERT_EQ(3, sectors.size());
- EarthSector sector_0 = sectors[1];
- EarthSector sector_1 = sectors[2];
+ DetectorSector sector_0 = sectors[1];
+ DetectorSector sector_1 = sectors[2];
Sphere const * sphere_0 = dynamic_cast(sector_0.geo.get());
Sphere const * sphere_1 = dynamic_cast(sector_1.geo.get());
ASSERT_TRUE(sphere_0);
@@ -547,23 +547,23 @@ TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantIntegralNested)
}
}
-TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantGetMassDensityNested)
+TEST_F(FakeLegacyDetectorModelTest, LegacyFileConstantGetMassDensityNested)
{
unsigned int N_rand = 1000;
for(unsigned int i=0; i sectors = A.GetSectors();
+ std::vector sectors = A.GetSectors();
ASSERT_EQ(3, sectors.size());
- EarthSector sector_0 = sectors[1];
- EarthSector sector_1 = sectors[2];
+ DetectorSector sector_0 = sectors[1];
+ DetectorSector sector_1 = sectors[2];
Sphere const * sphere_0 = dynamic_cast(sector_0.geo.get());
Sphere const * sphere_1 = dynamic_cast(sector_1.geo.get());
ASSERT_TRUE(sphere_0);
@@ -591,44 +591,44 @@ TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantGetMassDensityNested)
}
}
-TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantIntegralIntersecting)
+TEST_F(FakeLegacyDetectorModelTest, LegacyFileConstantIntegralIntersecting)
{
unsigned int N_rand = 1000;
for(unsigned int i=0; i(FakeLegacyEarthModelFile::RandomDouble()*15).create();
+ upper_sector.density = DensityDistribution1D(FakeLegacyDetectorModelFile::RandomDouble()*15).create();
- EarthSector lower_sector;
+ DetectorSector lower_sector;
Vector3D lower_center(radius/4.0,0,0);
lower_sector.name = "lower";
- lower_sector.material_id = FakeLegacyEarthModelFile::RandomDouble()*material_count;
+ lower_sector.material_id = FakeLegacyDetectorModelFile::RandomDouble()*material_count;
lower_sector.level = -2;
lower_sector.geo = Sphere(lower_center, radius, 0).create();
- lower_sector.density = DensityDistribution1D(FakeLegacyEarthModelFile::RandomDouble()*15).create();
+ lower_sector.density = DensityDistribution1D(FakeLegacyDetectorModelFile::RandomDouble()*15).create();
A.AddSector(lower_sector);
A.AddSector(upper_sector);
- std::vector sectors = A.GetSectors();
+ std::vector sectors = A.GetSectors();
ASSERT_EQ(3, sectors.size());
- EarthSector sector_vacuum = sectors[0];
- EarthSector sector_0 = sectors[1];
- EarthSector sector_1 = sectors[2];
+ DetectorSector sector_vacuum = sectors[0];
+ DetectorSector sector_0 = sectors[1];
+ DetectorSector sector_1 = sectors[2];
ASSERT_EQ(lower_sector.name, sector_0.name);
ASSERT_EQ(upper_sector.name, sector_1.name);
Sphere const * sphere_0 = dynamic_cast(sector_0.geo.get());
@@ -885,44 +885,44 @@ TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantIntegralIntersecting)
}
}
-TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantGetMassDensityIntersecting)
+TEST_F(FakeLegacyDetectorModelTest, LegacyFileConstantGetMassDensityIntersecting)
{
unsigned int N_rand = 1000;
for(unsigned int i=0; i(FakeLegacyEarthModelFile::RandomDouble()*15).create();
+ upper_sector.density = DensityDistribution1D(FakeLegacyDetectorModelFile::RandomDouble()*15).create();
- EarthSector lower_sector;
+ DetectorSector lower_sector;
Vector3D lower_center(radius/4.0,0,0);
lower_sector.name = "lower";
- lower_sector.material_id = FakeLegacyEarthModelFile::RandomDouble()*material_count;
+ lower_sector.material_id = FakeLegacyDetectorModelFile::RandomDouble()*material_count;
lower_sector.level = -2;
lower_sector.geo = Sphere(lower_center, radius, 0).create();
- lower_sector.density = DensityDistribution1D(FakeLegacyEarthModelFile::RandomDouble()*15).create();
+ lower_sector.density = DensityDistribution1D(FakeLegacyDetectorModelFile::RandomDouble()*15).create();
A.AddSector(lower_sector);
A.AddSector(upper_sector);
- std::vector sectors = A.GetSectors();
+ std::vector sectors = A.GetSectors();
ASSERT_EQ(3, sectors.size());
- EarthSector sector_vacuum = sectors[0];
- EarthSector sector_0 = sectors[1];
- EarthSector sector_1 = sectors[2];
+ DetectorSector sector_vacuum = sectors[0];
+ DetectorSector sector_0 = sectors[1];
+ DetectorSector sector_1 = sectors[2];
ASSERT_EQ(lower_sector.name, sector_0.name);
ASSERT_EQ(upper_sector.name, sector_1.name);
Sphere const * sphere_0 = dynamic_cast(sector_0.geo.get());
@@ -956,44 +956,44 @@ TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantGetMassDensityIntersecting)
}
}
-TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantIntegralHidden)
+TEST_F(FakeLegacyDetectorModelTest, LegacyFileConstantIntegralHidden)
{
unsigned int N_rand = 1000;
for(unsigned int i=0; i(FakeLegacyEarthModelFile::RandomDouble()*15).create();
+ upper_sector.density = DensityDistribution1D(FakeLegacyDetectorModelFile::RandomDouble()*15).create();
- EarthSector lower_sector;
+ DetectorSector lower_sector;
Vector3D lower_center(0,0,0);
lower_sector.name = "lower";
- lower_sector.material_id = FakeLegacyEarthModelFile::RandomDouble()*material_count;
+ lower_sector.material_id = FakeLegacyDetectorModelFile::RandomDouble()*material_count;
lower_sector.level = -2;
lower_sector.geo = Sphere(lower_center, radius/2.0, 0).create();
- lower_sector.density = DensityDistribution1D(FakeLegacyEarthModelFile::RandomDouble()*15).create();
+ lower_sector.density = DensityDistribution1D(FakeLegacyDetectorModelFile::RandomDouble()*15).create();
A.AddSector(lower_sector);
A.AddSector(upper_sector);
- std::vector sectors = A.GetSectors();
+ std::vector sectors = A.GetSectors();
ASSERT_EQ(3, sectors.size());
- EarthSector sector_vacuum = sectors[0];
- EarthSector sector_0 = sectors[1];
- EarthSector sector_1 = sectors[2];
+ DetectorSector sector_vacuum = sectors[0];
+ DetectorSector sector_0 = sectors[1];
+ DetectorSector sector_1 = sectors[2];
ASSERT_EQ(lower_sector.name, sector_0.name);
ASSERT_EQ(upper_sector.name, sector_1.name);
Sphere const * sphere_0 = dynamic_cast(sector_0.geo.get());
@@ -1060,44 +1060,44 @@ TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantIntegralHidden)
}
}
-TEST_F(FakeLegacyEarthModelTest, LegacyFileConstantGetMassDensityHidden)
+TEST_F(FakeLegacyDetectorModelTest, LegacyFileConstantGetMassDensityHidden)
{
unsigned int N_rand = 1000;
for(unsigned int i=0; i(FakeLegacyEarthModelFile::RandomDouble()*15).create();
+ upper_sector.density = DensityDistribution1D