diff --git a/DDG4/plugins/Geant4SDActions.cpp b/DDG4/plugins/Geant4SDActions.cpp index b2788a182162e2a4b4efb5af036f32497410893c..f4951a86e452ca1e3c678b42ce5803409c7f3a01 100644 --- a/DDG4/plugins/Geant4SDActions.cpp +++ b/DDG4/plugins/Geant4SDActions.cpp @@ -21,7 +21,7 @@ /// Namespace for the AIDA detector description toolkit namespace dd4hep { - + /// Namespace for the Geant4 based simulation part of the AIDA detector description toolkit namespace sim { diff --git a/examples/ClientTests/src/Property_test.cpp b/examples/ClientTests/src/Property_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ded1e1ddbf2396ad6a2f5476a8e30d67cf4ce797 --- /dev/null +++ b/examples/ClientTests/src/Property_test.cpp @@ -0,0 +1,55 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +// Author : M.Frank +// +//========================================================================== + +// Framework include files +#include <DD4hep/ComponentProperties.h> +#include <DD4hep/Factories.h> +#include <iostream> + +using namespace std; +using namespace dd4hep; + +/// Plugin function: Condition program example +/** + * Factory: DD4hep_Conditions_dynamic + * + * \author M.Frank + * \version 1.0 + * \date 01/12/2016 + */ + +template <typename T> T _test_read(const std::string& tag, const std::string& data) { + T value; + Property prop(value); + prop.str(data); + for(const auto& p : value) + std::cout << std::setw(32) << std::left << tag << " " << p.first << " = " << p.second << std::endl; + return value; +} + +static int property_test(Detector& /* description */, int /* argc */, char** /* argv */) { + + _test_read<std::map<std::string, int> > ("map_str_int", "{'a': 10, 'b': 100, 'c': 1000}"); + _test_read<std::map<std::string, double> > ("map_str_double", "{'a': 1.0, 'b': 200.5, 'c': 3000.9}"); + _test_read<std::map<std::string, std::string> >("map_str_str", "{'a': '10', 'b': '100', 'c': '1000'}"); + _test_read<std::map<std::string, std::string> >("map_str_strdouble", "{'a': 1.0, 'b': 200.5, 'c': 3000.9}"); + + //_test_read<std::map<std::string, double> > ("map_str_eval", "{'a': 1.0*GeV, 'b': 200.5*MeV, 'c': 3000.9*TeV}"); + + cout << endl << "Test PASSED" << endl << endl; + // All done. + return 1; +} + +// first argument is the type from the xml file +DECLARE_APPLY(DD4hep_property_test,property_test) diff --git a/examples/Conditions/src/ConditionAnyExampleObjects.cpp b/examples/Conditions/src/ConditionAnyExampleObjects.cpp index c11656b7161ebaf8a20364b5055000900f7a9b10..365af3dcc1538f54fa3a7e98a7e32663e9a7f003 100644 --- a/examples/Conditions/src/ConditionAnyExampleObjects.cpp +++ b/examples/Conditions/src/ConditionAnyExampleObjects.cpp @@ -79,8 +79,6 @@ void ConditionAnyUpdate2::resolve(Condition target, ConditionUpdateContext& cont vector<int>& c1 = cond1.as<vector<int> >(); data.insert(data.end(), c1.begin(), c1.end()); } -<<<<<<< HEAD - /// Interface to client Callback in order to update the condition Condition ConditionAnyUpdate3::operator()(const ConditionKey& key, ConditionUpdateContext&) {