diff --git a/src/global/pid/IrtParticleID_factory.cc b/src/global/pid/IrtParticleID_factory.cc index 8a72c90dd2..63f95d5f06 100644 --- a/src/global/pid/IrtParticleID_factory.cc +++ b/src/global/pid/IrtParticleID_factory.cc @@ -41,7 +41,7 @@ void eicrecon::IrtParticleID_factory::Process(const std::shared_ptrGet(m_detector_name+"Hits"); // loop over photoelectrons - // FIXME: at the moment, we do nothing; the current version of this factory is only meant to test the `rich` service + // FIXME: at the moment, we do nothing; the current version of this factory is only meant to test the `richgeo` service std::vector output_pid; // for( const auto& photoelectron : photoelectrons ) { // auto pid = new edm4hep::ParticleID( diff --git a/src/global/pid/IrtParticleID_factory.h b/src/global/pid/IrtParticleID_factory.h index 2d1c3a5caf..1c1cb92e2e 100644 --- a/src/global/pid/IrtParticleID_factory.h +++ b/src/global/pid/IrtParticleID_factory.h @@ -19,7 +19,7 @@ #include // services -#include +#include #include #include diff --git a/src/global/pid/RichTrack_factory.cc b/src/global/pid/RichTrack_factory.cc index 5266b08eb5..4749c372d3 100644 --- a/src/global/pid/RichTrack_factory.cc +++ b/src/global/pid/RichTrack_factory.cc @@ -13,7 +13,7 @@ void eicrecon::RichTrack_factory::Init() { auto detector_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); auto param_prefix = detector_name + ":" + GetTag(); InitDataTags(param_prefix); - m_radiatorID = rich::ParseRadiatorName(GetTag()); + m_radiatorID = richgeo::ParseRadiatorName(GetTag()); // services m_richGeoSvc = app->GetService(); diff --git a/src/global/pid/RichTrack_factory.h b/src/global/pid/RichTrack_factory.h index 7c3ad663ed..af4cd97864 100644 --- a/src/global/pid/RichTrack_factory.h +++ b/src/global/pid/RichTrack_factory.h @@ -14,7 +14,7 @@ #include // services -#include +#include #include #include #include @@ -44,7 +44,7 @@ namespace eicrecon { std::string m_detector_name; std::shared_ptr m_richGeoSvc; std::shared_ptr m_actsSvc; - rich::ActsGeo *m_actsGeo; + richgeo::ActsGeo *m_actsGeo; std::vector> m_trackingPlanes; int m_numPlanes; int m_radiatorID; diff --git a/src/services/CMakeLists.txt b/src/services/CMakeLists.txt index db7d30b8b2..8efbe89e1e 100644 --- a/src/services/CMakeLists.txt +++ b/src/services/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(geometry/dd4hep) add_subdirectory(geometry/acts) -add_subdirectory(geometry/rich) +add_subdirectory(geometry/richgeo) add_subdirectory(io/podio) add_subdirectory(randomgenerator) add_subdirectory(log) diff --git a/src/services/geometry/rich/CMakeLists.txt b/src/services/geometry/rich/CMakeLists.txt deleted file mode 100644 index 30ca83d562..0000000000 --- a/src/services/geometry/rich/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 3.16) - -# include geometry binding plugins -add_subdirectory(richgeo) - -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name -get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) - -print_header(">>>> P L U G I N : ${PLUGIN_NAME} <<<<") # Fancy printing - -# Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets -# Setting default includes, libraries and installation paths -plugin_add(${PLUGIN_NAME}) - -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory -plugin_glob_all(${PLUGIN_NAME}) - -# Find dependencies -plugin_add_dd4hep(${PLUGIN_NAME}) -plugin_add_irt(${PLUGIN_NAME}) -plugin_add_acts(${PLUGIN_NAME}) diff --git a/src/services/geometry/rich/README.md b/src/services/geometry/rich/README.md deleted file mode 100644 index 1b84cabcac..0000000000 --- a/src/services/geometry/rich/README.md +++ /dev/null @@ -1,12 +0,0 @@ -RICH Geometry Service -===================== - -A common place for bindings between RICH geometry forms: -- `DD4hep`: simulation geometry -- `ACTS`: track-projection planes -- `IRT`: optical surfaces for Indirect Ray Tracing - -`RichGeo_service` provides a JANA service for these bindings. The -JANA-independent code is contained in `richgeo/`, which can either be built as -an `EICrecon` plugin (using `richgeo/CMakeLists.txt`) or built as a standalone -library for external usage (using your own build configuration). diff --git a/src/services/geometry/rich/richgeo/ActsGeo.cc b/src/services/geometry/richgeo/ActsGeo.cc similarity index 96% rename from src/services/geometry/rich/richgeo/ActsGeo.cc rename to src/services/geometry/richgeo/ActsGeo.cc index 3aec66f806..a7eac79714 100644 --- a/src/services/geometry/rich/richgeo/ActsGeo.cc +++ b/src/services/geometry/richgeo/ActsGeo.cc @@ -5,7 +5,7 @@ #include "ActsGeo.h" -std::vector> rich::ActsGeo::TrackingPlanes(int radiator, int numPlanes) { +std::vector> richgeo::ActsGeo::TrackingPlanes(int radiator, int numPlanes) { // output list of surfaces std::vector> discs; diff --git a/src/services/geometry/rich/richgeo/ActsGeo.h b/src/services/geometry/richgeo/ActsGeo.h similarity index 98% rename from src/services/geometry/rich/richgeo/ActsGeo.h rename to src/services/geometry/richgeo/ActsGeo.h index 8193360cf3..29289c70dd 100644 --- a/src/services/geometry/rich/richgeo/ActsGeo.h +++ b/src/services/geometry/richgeo/ActsGeo.h @@ -21,7 +21,7 @@ // local #include "RichGeo.h" -namespace rich { +namespace richgeo { class ActsGeo { public: diff --git a/src/services/geometry/rich/richgeo/CMakeLists.txt b/src/services/geometry/richgeo/CMakeLists.txt similarity index 94% rename from src/services/geometry/rich/richgeo/CMakeLists.txt rename to src/services/geometry/richgeo/CMakeLists.txt index 9d229b552a..d0cfdec910 100644 --- a/src/services/geometry/rich/richgeo/CMakeLists.txt +++ b/src/services/geometry/richgeo/CMakeLists.txt @@ -1,9 +1,9 @@ -# cmake configuration for an `EICrecon` plugin cmake_minimum_required(VERSION 3.16) # Automatically set plugin name the same as the directory name # Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) + print_header(">>>> P L U G I N : ${PLUGIN_NAME} <<<<") # Fancy printing # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets diff --git a/src/services/geometry/rich/richgeo/IrtGeo.cc b/src/services/geometry/richgeo/IrtGeo.cc similarity index 87% rename from src/services/geometry/rich/richgeo/IrtGeo.cc rename to src/services/geometry/richgeo/IrtGeo.cc index 562246f76f..3decf1af46 100644 --- a/src/services/geometry/rich/richgeo/IrtGeo.cc +++ b/src/services/geometry/richgeo/IrtGeo.cc @@ -6,14 +6,14 @@ #include "IrtGeo.h" // constructor: creates IRT-DD4hep bindings using main `Detector` handle `*det_` -rich::IrtGeo::IrtGeo(std::string detName_, dd4hep::Detector *det_, bool verbose_) : +richgeo::IrtGeo::IrtGeo(std::string detName_, dd4hep::Detector *det_, bool verbose_) : m_detName(detName_), m_det(det_), m_log(Logger::Instance(verbose_)) { Bind(); } // alternate constructor: use compact file for DD4hep geometry (backward compatibility) -rich::IrtGeo::IrtGeo(std::string detName_, std::string compactFile_, bool verbose_) : +richgeo::IrtGeo::IrtGeo(std::string detName_, std::string compactFile_, bool verbose_) : m_detName(detName_), m_log(Logger::Instance(verbose_)) { // compact file name; if it's not been specified, try to find the default one @@ -37,7 +37,7 @@ rich::IrtGeo::IrtGeo(std::string detName_, std::string compactFile_, bool verbos } // set IRT and DD4hep geometry handles -void rich::IrtGeo::Bind() { +void richgeo::IrtGeo::Bind() { // DD4hep geometry handles m_detRich = m_det->detector(m_detName); m_posRich = m_detRich.placement().position(); @@ -46,7 +46,7 @@ void rich::IrtGeo::Bind() { m_irtDetector = m_irtDetectorCollection->AddNewDetector(m_detName.c_str()); } -rich::IrtGeo::~IrtGeo() { +richgeo::IrtGeo::~IrtGeo() { if(m_irtDetector) delete m_irtDetector; if(m_irtDetectorCollection) delete m_irtDetectorCollection; } diff --git a/src/services/geometry/rich/richgeo/IrtGeo.h b/src/services/geometry/richgeo/IrtGeo.h similarity index 98% rename from src/services/geometry/rich/richgeo/IrtGeo.h rename to src/services/geometry/richgeo/IrtGeo.h index d0f038710d..b52b37b442 100644 --- a/src/services/geometry/rich/richgeo/IrtGeo.h +++ b/src/services/geometry/richgeo/IrtGeo.h @@ -24,7 +24,7 @@ // local #include "RichGeo.h" -namespace rich { +namespace richgeo { class IrtGeo { public: diff --git a/src/services/geometry/rich/richgeo/IrtGeoDRICH.cc b/src/services/geometry/richgeo/IrtGeoDRICH.cc similarity index 99% rename from src/services/geometry/rich/richgeo/IrtGeoDRICH.cc rename to src/services/geometry/richgeo/IrtGeoDRICH.cc index c78ff9555d..97e6c250be 100644 --- a/src/services/geometry/rich/richgeo/IrtGeoDRICH.cc +++ b/src/services/geometry/richgeo/IrtGeoDRICH.cc @@ -5,7 +5,7 @@ #include "IrtGeoDRICH.h" -void rich::IrtGeoDRICH::DD4hep_to_IRT() { +void richgeo::IrtGeoDRICH::DD4hep_to_IRT() { // begin envelope /* FIXME: have no connection to GEANT G4LogicalVolume pointers; however all is needed diff --git a/src/services/geometry/rich/richgeo/IrtGeoDRICH.h b/src/services/geometry/richgeo/IrtGeoDRICH.h similarity index 96% rename from src/services/geometry/rich/richgeo/IrtGeoDRICH.h rename to src/services/geometry/richgeo/IrtGeoDRICH.h index ddcf4040a2..f1b35bbfda 100644 --- a/src/services/geometry/rich/richgeo/IrtGeoDRICH.h +++ b/src/services/geometry/richgeo/IrtGeoDRICH.h @@ -8,7 +8,7 @@ #include "IrtGeo.h" -namespace rich { +namespace richgeo { class IrtGeoDRICH : public IrtGeo { public: diff --git a/src/services/geometry/rich/richgeo/IrtGeoPFRICH.cc b/src/services/geometry/richgeo/IrtGeoPFRICH.cc similarity index 99% rename from src/services/geometry/rich/richgeo/IrtGeoPFRICH.cc rename to src/services/geometry/richgeo/IrtGeoPFRICH.cc index 7171d164b9..74aed5c06d 100644 --- a/src/services/geometry/rich/richgeo/IrtGeoPFRICH.cc +++ b/src/services/geometry/richgeo/IrtGeoPFRICH.cc @@ -5,7 +5,7 @@ #include "IrtGeoPFRICH.h" -void rich::IrtGeoPFRICH::DD4hep_to_IRT() { +void richgeo::IrtGeoPFRICH::DD4hep_to_IRT() { // begin envelope /* FIXME: have no connection to GEANT G4LogicalVolume pointers; however all is needed diff --git a/src/services/geometry/rich/richgeo/IrtGeoPFRICH.h b/src/services/geometry/richgeo/IrtGeoPFRICH.h similarity index 96% rename from src/services/geometry/rich/richgeo/IrtGeoPFRICH.h rename to src/services/geometry/richgeo/IrtGeoPFRICH.h index 5d5f2c2be7..d9948741f4 100644 --- a/src/services/geometry/rich/richgeo/IrtGeoPFRICH.h +++ b/src/services/geometry/richgeo/IrtGeoPFRICH.h @@ -8,7 +8,7 @@ #include "IrtGeo.h" -namespace rich { +namespace richgeo { class IrtGeoPFRICH : public IrtGeo { public: diff --git a/src/services/geometry/richgeo/README.md b/src/services/geometry/richgeo/README.md new file mode 100644 index 0000000000..5f08d5d6bd --- /dev/null +++ b/src/services/geometry/richgeo/README.md @@ -0,0 +1,13 @@ +RICH Geometry Service +===================== + +A common place for bindings between RICH geometry forms: +- `DD4hep`: simulation geometry +- `ACTS`: track-projection planes +- `IRT`: optical surfaces for Indirect Ray Tracing + +`RichGeo_service` provides a JANA service for these bindings, with `richgeo.cc` +to define the plugin. All other source files are meant to be JANA-independent, +and can either be built with this `richgeo` plugin or as a standalone library +for external usage (using your own build configuration). The standalone +capability is currently used for legacy Juggler support. diff --git a/src/services/geometry/rich/richgeo/RichGeo.h b/src/services/geometry/richgeo/RichGeo.h similarity index 99% rename from src/services/geometry/rich/richgeo/RichGeo.h rename to src/services/geometry/richgeo/RichGeo.h index 33fd8bb4b7..8817c46201 100644 --- a/src/services/geometry/rich/richgeo/RichGeo.h +++ b/src/services/geometry/richgeo/RichGeo.h @@ -8,7 +8,7 @@ #include #include -namespace rich { +namespace richgeo { // local logging singleton /* NOTE: EICrecon uses `spdlog` with a logging service; since `RichGeo` is meant diff --git a/src/services/geometry/rich/RichGeo_service.cc b/src/services/geometry/richgeo/RichGeo_service.cc similarity index 80% rename from src/services/geometry/rich/RichGeo_service.cc rename to src/services/geometry/richgeo/RichGeo_service.cc index ff104bde87..bef5b03c8e 100644 --- a/src/services/geometry/rich/RichGeo_service.cc +++ b/src/services/geometry/richgeo/RichGeo_service.cc @@ -10,9 +10,9 @@ void RichGeo_service::acquire_services(JServiceLocator *srv_locator) { // logging service auto log_service = srv_locator->get(); - m_log = log_service->logger("rich"); + m_log = log_service->logger("richgeo"); std::string log_level_str = "info"; - m_app->SetDefaultParameter("rich:LogLevel", log_level_str, "Log level for RichGeo_service"); + m_app->SetDefaultParameter("richgeo:LogLevel", log_level_str, "Log level for RichGeo_service"); m_log->set_level(eicrecon::ParseLogLevel(log_level_str)); m_log->debug("RichGeo log level is set to {} ({})", log_level_str, m_log->level()); @@ -25,7 +25,7 @@ void RichGeo_service::acquire_services(JServiceLocator *srv_locator) { } // IrtGeo ----------------------------------------------------------- -rich::IrtGeo *RichGeo_service::GetIrtGeo(std::string detector_name) { +richgeo::IrtGeo *RichGeo_service::GetIrtGeo(std::string detector_name) { // initialize, if not yet initialized try { @@ -35,8 +35,8 @@ rich::IrtGeo *RichGeo_service::GetIrtGeo(std::string detector_name) { // instantiate IrtGeo-derived object, depending on detector auto which_rich = detector_name; std::transform(which_rich.begin(), which_rich.end(), which_rich.begin(), ::toupper); - if ( which_rich=="DRICH" ) m_irtGeo = new rich::IrtGeoDRICH(m_dd4hepGeo, m_verbose); - else if( which_rich=="PFRICH" ) m_irtGeo = new rich::IrtGeoPFRICH(m_dd4hepGeo, m_verbose); + if ( which_rich=="DRICH" ) m_irtGeo = new richgeo::IrtGeoDRICH(m_dd4hepGeo, m_verbose); + else if( which_rich=="PFRICH" ) m_irtGeo = new richgeo::IrtGeoPFRICH(m_dd4hepGeo, m_verbose); else throw JException(fmt::format("IrtGeo is not defined for detector '{}'",detector_name)); }; std::call_once(m_init_irt, initialize); @@ -49,13 +49,13 @@ rich::IrtGeo *RichGeo_service::GetIrtGeo(std::string detector_name) { } // ActsGeo ----------------------------------------------------------- -rich::ActsGeo *RichGeo_service::GetActsGeo(std::string detector_name) { +richgeo::ActsGeo *RichGeo_service::GetActsGeo(std::string detector_name) { // initialize, if not yet initialized try { m_log->debug("Call RichGeo_service::GetActsGeo initializer"); auto initialize = [this,&detector_name] () { if(!m_dd4hepGeo) throw JException("RichGeo_service m_dd4hepGeo==null which should never be!"); - m_actsGeo = new rich::ActsGeo(detector_name, m_dd4hepGeo, m_verbose); + m_actsGeo = new richgeo::ActsGeo(detector_name, m_dd4hepGeo, m_verbose); }; std::call_once(m_init_acts, initialize); } diff --git a/src/services/geometry/rich/RichGeo_service.h b/src/services/geometry/richgeo/RichGeo_service.h similarity index 73% rename from src/services/geometry/rich/RichGeo_service.h rename to src/services/geometry/richgeo/RichGeo_service.h index 60cb0baaca..ee3a0c5b4c 100644 --- a/src/services/geometry/rich/RichGeo_service.h +++ b/src/services/geometry/richgeo/RichGeo_service.h @@ -19,11 +19,11 @@ #include // richgeo -#include "richgeo/RichGeo.h" -#include "richgeo/IrtGeo.h" -#include "richgeo/IrtGeoDRICH.h" -#include "richgeo/IrtGeoPFRICH.h" -#include "richgeo/ActsGeo.h" +#include "RichGeo.h" +#include "IrtGeo.h" +#include "IrtGeoDRICH.h" +#include "IrtGeoPFRICH.h" +#include "ActsGeo.h" class RichGeo_service : public JService { public: @@ -31,8 +31,8 @@ class RichGeo_service : public JService { ~RichGeo_service(); // return pointers to geometry bindings; initializes the bindings upon the first time called - rich::IrtGeo *GetIrtGeo(std::string detector_name); - rich::ActsGeo *GetActsGeo(std::string detector_name); + richgeo::IrtGeo *GetIrtGeo(std::string detector_name); + richgeo::ActsGeo *GetActsGeo(std::string detector_name); private: RichGeo_service() = default; @@ -42,8 +42,8 @@ class RichGeo_service : public JService { std::once_flag m_init_acts; JApplication *m_app = nullptr; dd4hep::Detector *m_dd4hepGeo = nullptr; - rich::IrtGeo *m_irtGeo = nullptr; - rich::ActsGeo *m_actsGeo = nullptr; + richgeo::IrtGeo *m_irtGeo = nullptr; + richgeo::ActsGeo *m_actsGeo = nullptr; std::shared_ptr m_log; bool m_verbose; diff --git a/src/services/geometry/rich/rich.cc b/src/services/geometry/richgeo/richgeo.cc similarity index 100% rename from src/services/geometry/rich/rich.cc rename to src/services/geometry/richgeo/richgeo.cc diff --git a/src/utilities/eicrecon/eicrecon.cc b/src/utilities/eicrecon/eicrecon.cc index 88c19a2b1c..579f6f35fb 100644 --- a/src/utilities/eicrecon/eicrecon.cc +++ b/src/utilities/eicrecon/eicrecon.cc @@ -17,7 +17,6 @@ std::vector EICRECON_DEFAULT_PLUGINS = { "dd4hep", "acts", "richgeo", - "rich", "rootfile", "algorithms_calorimetry", "algorithms_tracking",