From 3c212b1a549daf2b237146e221c1b603d3da8f43 Mon Sep 17 00:00:00 2001 From: Markus Frank <markus.frank@cern.ch> Date: Tue, 10 Mar 2015 13:22:51 +0000 Subject: [PATCH] Fix linker errors --- DDCore/src/Plugins.cpp | 2 ++ DDCore/src/plugins/LCDDConverter.cpp | 2 +- DDG4/include/DDG4/Factories.h | 12 +++++++----- DDG4/plugins/Geant4FieldTrackingSetup.cpp | 2 +- DDG4/src/Geant4Converter.cpp | 2 +- DDG4/src/Geant4Plugins.cpp | 1 - 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/DDCore/src/Plugins.cpp b/DDCore/src/Plugins.cpp index 92b242452..e50412325 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 6a1457f23..11da819ea 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 e5d85e372..944a46b69 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 78c5e6e83..ba72fb971 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 3619bc25b..bcb736fdd 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 2a53f74e2..31c386753 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)) -- GitLab