diff --git a/DDCore/src/Plugins.cpp b/DDCore/src/Plugins.cpp index 92b242452192c8f533a3a8cf8e615658f92fe894..e50412325930e8fa166ed5f5ea0bc52c83ee334a 100644 --- a/DDCore/src/Plugins.cpp +++ b/DDCore/src/Plugins.cpp @@ -9,6 +9,7 @@ #include "DD4hep/LCDD.h" #include "DD4hep/Handle.h" #include "DD4hep/Plugins.inl" +#include "DD4hep/GeoHandler.h" #include "XML/XMLElements.h" using namespace std; @@ -83,6 +84,7 @@ DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (Geometry::LCDD*,XML::Handle_t*)) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (Geometry::LCDD*,XML::Handle_t const*)) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (Geometry::LCDD*, int, char**)) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (Geometry::LCDD*)) +DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (Geometry::LCDD*, const Geometry::GeoHandler*, const std::map<std::string,std::string>*)) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, ()) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(void*, (const char*)) diff --git a/DDCore/src/plugins/LCDDConverter.cpp b/DDCore/src/plugins/LCDDConverter.cpp index 6a1457f23fc770be459f0ec9db1fe863ec536fb1..11da819ea36525181825c43c711e3c6948bd095e 100644 --- a/DDCore/src/plugins/LCDDConverter.cpp +++ b/DDCore/src/plugins/LCDDConverter.cpp @@ -984,7 +984,7 @@ void LCDDConverter::handleProperties(LCDD::Properties& prp) const { } } for (map<string, string>::const_iterator i = processors.begin(); i != processors.end(); ++i) { - const LCDDConverter* ptr = this; + const GeoHandler* ptr = this; string nam = (*i).second; const LCDD::PropertyValues& vals = prp[nam]; string type = vals.find("type")->second; diff --git a/DDG4/include/DDG4/Factories.h b/DDG4/include/DDG4/Factories.h index e5d85e372bb37fe2e7eb442d429dce2f74f0872e..944a46b69a75b19e14ca20b895b946bde66dd855 100644 --- a/DDG4/include/DDG4/Factories.h +++ b/DDG4/include/DDG4/Factories.h @@ -34,6 +34,7 @@ class G4VProcess; namespace DD4hep { namespace Geometry { + class GeoHandler; class DetElement; class LCDD; } @@ -49,7 +50,7 @@ namespace DD4hep { /// Templated factory method to invoke setup action template <typename T> class Geant4SetupAction { public: - static long create(Geometry::LCDD& lcdd, const Geant4Converter& cnv, const std::map<std::string, std::string>& attrs); + static long create(Geometry::LCDD& lcdd, const Geometry::GeoHandler& cnv, const std::map<std::string, std::string>& attrs); }; /// Deprecated: Templated factory method to create sensitive detector template <typename T> class Geant4SensitiveDetectorFactory { @@ -63,6 +64,7 @@ namespace { namespace DS = DD4hep::Simulation; typedef DD4hep::Geometry::LCDD LCDD; + typedef DD4hep::Geometry::GeoHandler GeoHandler; typedef DD4hep::Geometry::DetElement DE; typedef DS::Geant4Action GA; typedef DS::Geant4Context CT; @@ -70,9 +72,9 @@ namespace { typedef const std::vector<void*>& ARGS; template <typename P, typename S> class Factory; - template <typename P> class Factory<P, long(LCDD*, const DS::Geant4Converter*, const std::map<STR, STR>*)> { + template <typename P> class Factory<P, long(LCDD*, const GeoHandler*, const std::map<STR, STR>*)> { public: - typedef DS::Geant4Converter cnv_t; + typedef GeoHandler cnv_t; typedef std::map<STR, STR> attrs_t; static void Func(void *ret, void*, ARGS arg, void*) { long r = DS::Geant4SetupAction<P>::create(*(LCDD*) arg[0], *(cnv_t*) arg[1], *(attrs_t*) arg[2]); @@ -211,8 +213,8 @@ namespace { #define DECLARE_GEANT4_SETUP(name,func) \ namespace DD4hep { namespace Simulation { struct xml_g4_setup_##name {}; \ - template <> long Geant4SetupAction<DD4hep::Simulation::xml_g4_setup_##name>::create(LCDD& l,const DD4hep::Simulation::Geant4Converter& e, const std::map<std::string,std::string>& a) {return func(l,e,a);} }} \ - DD4HEP_PLUGINSVC_FACTORY(xml_g4_setup_##name,name "_Geant4_action",long(DD4hep::Geometry::LCDD*,const DD4hep::Simulation::Geant4Converter*,const std::map<std::string,std::string>*),__LINE__) + template <> long Geant4SetupAction<DD4hep::Simulation::xml_g4_setup_##name>::create(LCDD& l,const DD4hep::Geometry::GeoHandler& e, const std::map<std::string,std::string>& a) {return func(l,e,a);} }} \ + DD4HEP_PLUGINSVC_FACTORY(xml_g4_setup_##name,name "_Geant4_action",long(DD4hep::Geometry::LCDD*,const DD4hep::Geometry::GeoHandler*,const std::map<std::string,std::string>*),__LINE__) /// Plugin defintion to create event reader objects #define DECLARE_GEANT4_EVENT_READER(name) \ diff --git a/DDG4/plugins/Geant4FieldTrackingSetup.cpp b/DDG4/plugins/Geant4FieldTrackingSetup.cpp index 78c5e6e837de8141975f6539e5e5003ff9d1a649..ba72fb9714a6d4a69b1f6558d4b1cfef0d7d5b08 100644 --- a/DDG4/plugins/Geant4FieldTrackingSetup.cpp +++ b/DDG4/plugins/Geant4FieldTrackingSetup.cpp @@ -180,7 +180,7 @@ int Geant4FieldTrackingSetup::execute(Geometry::LCDD& lcdd) { return 1; } -static long setup_fields(lcdd_t& lcdd, const DD4hep::Simulation::Geant4Converter& /* cnv */, const map<string,string>& vals) { +static long setup_fields(lcdd_t& lcdd, const DD4hep::Geometry::GeoHandler& /* cnv */, const map<string,string>& vals) { struct XMLFieldTrackingSetup : public Geant4FieldTrackingSetup { XMLFieldTrackingSetup(const map<string,string>& vals) : Geant4FieldTrackingSetup() { Geant4SetupPropertyMap pm(vals); diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp index 3619bc25ba9a9b2b007fb170189bae981423e311..bcb736fdd97abf4ade3285d11c05975e0efcc01f 100644 --- a/DDG4/src/Geant4Converter.cpp +++ b/DDG4/src/Geant4Converter.cpp @@ -890,7 +890,7 @@ void Geant4Converter::handleProperties(LCDD::Properties& prp) const { } } for (map<string, string>::const_iterator i = processors.begin(); i != processors.end(); ++i) { - const Geant4Converter* ptr = this; + const Geometry::GeoHandler* ptr = this; string nam = (*i).second; const LCDD::PropertyValues& vals = prp[nam]; string type = vals.find("type")->second; diff --git a/DDG4/src/Geant4Plugins.cpp b/DDG4/src/Geant4Plugins.cpp index 2a53f74e2b2406fa553d1e2da93343ee94662a57..31c386753c77f0e9583946cd0a79d455c9e2a216 100644 --- a/DDG4/src/Geant4Plugins.cpp +++ b/DDG4/src/Geant4Plugins.cpp @@ -34,5 +34,4 @@ DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4VProcess*, ()) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4VPhysicsConstructor*, ()) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4ParticleDefinition*, ()) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4VUserPhysicsList*, (DD4hep::Simulation::Geant4PhysicsListActionSequence*,int)) -DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (DD4hep::Geometry::LCDD*,const DD4hep::Simulation::Geant4Converter*,const std::map<std::string,std::string>*)) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(DD4hep::Simulation::Geant4EventReader*, (std::string))