diff --git a/DDCond/src/ConditionsAccess.cpp b/DDCond/src/ConditionsAccess.cpp index f13737504038043a98b95c612c8a527ddc3dc0a3..2a1d5ac420f0407fc5aee58d75744697d3283d04 100644 --- a/DDCond/src/ConditionsAccess.cpp +++ b/DDCond/src/ConditionsAccess.cpp @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -13,11 +12,7 @@ //========================================================================== // Framework include files -#include "DD4hep/LCDD.h" -#include "DD4hep/Errors.h" -#include "DD4hep/Printout.h" -#include "DD4hep/DetectorTools.h" - +#include "DD4hep/Conditions.h" #include "DDCond/ConditionsInterna.h" #include "DDCond/ConditionsAccess.h" @@ -39,8 +34,8 @@ const vector<const IOVType*> ConditionsAccess::iovTypesUsed() const { Object* obj = access(); vector<const IOVType*> result; const Object::IOVTypes& types = obj->iovTypes(); - for(Object::IOVTypes::const_iterator i=types.begin(); i!=types.end(); ++i) - if ( int((*i).type) != IOVType::UNKNOWN_IOV ) result.push_back(&(*i)); + for(const auto& i : types ) + if ( int(i.type) != IOVType::UNKNOWN_IOV ) result.push_back(&i); return result; } diff --git a/DDCond/src/ConditionsInterna.cpp b/DDCond/src/ConditionsInterna.cpp index 32150b794a0a4cda4fb530ed89b3837724474202..dcd9976cbc720e63a3fcb470e5f71bf552330b8a 100644 --- a/DDCond/src/ConditionsInterna.cpp +++ b/DDCond/src/ConditionsInterna.cpp @@ -110,8 +110,8 @@ namespace { // The range may be returned unordered. Hence, // we have to try to match at most conditions.size() times until we really know for(size_t j = 0; j < conditions.size(); ++j ) { - for(RC::const_iterator i=conditions.begin(); i!=conditions.end(); ++i) { - const IOV::Key& k = (*i)->iov->key(); + for(const auto& cond : conditions ) { + const IOV::Key& k = cond->iov->key(); if ( k.first <= test.first+1 && k.second >= test.first ) test.first = k.second; if ( k.first+1 <= test.second && k.second >= test.second ) test.second = k.first; //printout(INFO,"Test","IOV: %ld,%ld --> %ld,%ld",k.first,k.second, test.first, test.second); @@ -125,10 +125,8 @@ namespace { template <typename PMF> void __callListeners(const ConditionsManagerObject::Listeners& listeners, PMF pmf, Condition& cond) { - for(ConditionsManagerObject::Listeners::const_iterator i=listeners.begin(); i!=listeners.end(); ++i) { - const ConditionsManagerObject::Listener& listener = *i; + for(const auto& listener : listeners ) (listener.first->*pmf)(cond, listener.second); - } } } @@ -248,8 +246,8 @@ const IOVType* ConditionsManagerObject::iovType (size_t iov_type) const { /// Access IOV by its name const IOVType* ConditionsManagerObject::iovType (const string& iov_name) const { - for( IOVTypes::const_iterator i=m_iovTypes.begin(); i != m_iovTypes.end(); ++i) - if ( (*i).name == iov_name ) return &(*i); + for( const auto& i : m_iovTypes ) + if ( i.name == iov_name ) return &i; except("ConditionsManager","Request to access an unregistered IOV type: %s.", iov_name.c_str()); return 0; } @@ -397,55 +395,16 @@ void ConditionsManagerObject::pushUpdates() { // Lock global pool so that no other updates happen in the meanwhile // which could kill the pool's containers dd4hep_lock_t lock(m_poolLock); - for(Updates::const_iterator iov_iter=entries.begin(); iov_iter!=entries.end(); ++iov_iter) { - typedef UpdatePool::ConditionEntries _E; - const _E& ents = (*iov_iter).second; + for(const auto& iov_iter : entries ) { + const UpdatePool::ConditionEntries& ents = iov_iter.second; if ( !ents.empty() ) { - for(_E::const_iterator j=ents.begin(); j != ents.end(); ++j) { - Condition c = *j; + for(Condition c : ents ) { c->setFlag(Condition::ACTIVE); c->pool->insert(c); } } } } -#if 0 -/// Prepare all updates to the clients with the defined IOV -long ConditionsManagerObject::prepare(const Condition::iov_type& required_validity, - dd4hep_ptr<UserPool>& up) -{ - const IOVType* typ = check_iov_type<Discrete>(this, &required_validity); - if ( typ ) { - RC valid, expired; - ConditionsIOVPool* pool = m_rawPool[typ->type]; - if ( 0 == up.get() || up->pool_type != ConditionsPool::USER_POOL_TYPE ) { - const void* argv_pool[] = {this, 0}; - UserPool* cp = createPlugin<UserPool>(m_userType,m_lcdd,1,argv_pool); - up.adopt(cp); - } - UserPool *user_pool = up.get(); - /// First push any pending updates and register them to pending pools... - Condition::iov_type pool_iov(typ); - pool_iov.reset().invert(); - - pushUpdates(); - pool->select(required_validity, valid, expired, pool_iov); - user_pool->clear(); - user_pool->insert(valid); - long num_expired = (long)expired.size(); - if ( num_expired > 0 ) { - m_loader->update(required_validity, expired, pool_iov); - user_pool->insert(expired); - } - user_pool->setValidity(pool_iov); - user_pool->setReqValidity(required_validity); - return num_expired; - } - except("ConditionsManager","+++ Unknown IOV type requested to enable conditions. [%s]", - Errors::invalidArg().c_str()); - return -1; -} -#endif /// Helper to check iov and user pool and create user pool if not present void ConditionsManagerObject::__get_checked_pool(const IOV& req_iov, diff --git a/DDCore/src/Evaluator/Evaluator.cpp b/DDCore/src/Evaluator/Evaluator.cpp index 28656381297ec424c1c3c09c798432a84accfe68..0342020960cdba8165a22b9e57dd32fe5ca30ba2 100644 --- a/DDCore/src/Evaluator/Evaluator.cpp +++ b/DDCore/src/Evaluator/Evaluator.cpp @@ -14,7 +14,7 @@ #include <stdlib.h> // for strtod() // Disable some diagnostics, which we know, but need to ignore -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__APPLE__) /* This is OK: ../DDCore/src/Evaluator/Evaluator.cpp: In function 'int engine(pchar, pchar, double&, char*&, const dic_type&)': ../DDCore/src/Evaluator/Evaluator.cpp:164:23: warning: 'pp[3]' may be used uninitialized in this function [-Wmaybe-uninitialized] diff --git a/DDCore/src/OpaqueDataBinder.cpp b/DDCore/src/OpaqueDataBinder.cpp index 808577d4e1a56773280f1f35f191a0384f62fd2a..10759fc862334f857016aeec49fb157ed8c5303f 100644 --- a/DDCore/src/OpaqueDataBinder.cpp +++ b/DDCore/src/OpaqueDataBinder.cpp @@ -110,6 +110,23 @@ namespace DD4hep { printout(INFO,"OpaqueDataBinder","++ Unknown conditions parameter type:%s val:%s",typ.c_str(),val.c_str()); return __bind__(b,object,val,_string()); } + template bool OpaqueDataBinder::bind<ValueBinder,OpaqueDataBlock>( const ValueBinder& b, OpaqueDataBlock& object, + const string& typ, const string& val); + template bool OpaqueDataBinder::bind<VectorBinder,OpaqueDataBlock>( const VectorBinder& b, OpaqueDataBlock& object, + const string& typ, const string& val); + template bool OpaqueDataBinder::bind<ListBinder,OpaqueDataBlock>( const ListBinder& b, OpaqueDataBlock& object, + const string& typ, const string& val); + template bool OpaqueDataBinder::bind<SetBinder,OpaqueDataBlock>( const SetBinder& b, OpaqueDataBlock& object, + const string& typ, const string& val); + + template bool OpaqueDataBinder::bind<ValueBinder,Conditions::Condition>( const ValueBinder& b, Conditions::Condition& object, + const string& typ, const string& val); + template bool OpaqueDataBinder::bind<VectorBinder,Conditions::Condition>( const VectorBinder& b, Conditions::Condition& object, + const string& typ, const string& val); + template bool OpaqueDataBinder::bind<ListBinder,Conditions::Condition>( const ListBinder& b, Conditions::Condition& object, + const string& typ, const string& val); + template bool OpaqueDataBinder::bind<SetBinder,Conditions::Condition>( const SetBinder& b, Conditions::Condition& object, + const string& typ, const string& val); /// Binding function for sequences (unmapped STL containers) template <typename T> @@ -359,17 +376,19 @@ namespace DD4hep { return true; } - /// Instantiate the data binder for OpaqueData template bool OpaqueDataBinder::bind_sequence<OpaqueDataBlock>(OpaqueDataBlock& object,const string& typ,const string& val); - template bool OpaqueDataBinder::bind_map<MapBinder,OpaqueDataBlock>( const MapBinder& b, OpaqueDataBlock& object, - const string& typ,const string& val); - template bool OpaqueDataBinder::insert_map<MapBinder,OpaqueDataBlock>(const MapBinder& b, OpaqueDataBlock& object, - const string& key_type, const string& key, - const string& val_type, const string& val); - template bool OpaqueDataBinder::insert_map<MapBinder,OpaqueDataBlock>(const MapBinder& b, OpaqueDataBlock& object, - const string& key_type, const string& val_type, - const string& pair_data); + template bool OpaqueDataBinder::bind_map<MapBinder,OpaqueDataBlock>( const MapBinder& b, OpaqueDataBlock& object, + const string& typ,const string& val); + template bool OpaqueDataBinder::insert_map<MapBinder,OpaqueDataBlock>( const MapBinder& b, OpaqueDataBlock& object, + const string& key_type, const string& key, + const string& val_type, const string& val); + template bool OpaqueDataBinder::insert_map<MapBinder,OpaqueDataBlock>( const MapBinder& b, OpaqueDataBlock& object, + const string& key_type, const string& val_type, + const string& pair_data); + /// Instantiation for Conditions: + template bool OpaqueDataBinder::bind_sequence<Conditions::Condition>( Conditions::Condition& object, + const string& typ,const string& val); /// Conditions binding function for STL maps template <> bool OpaqueDataBinder::bind_map(const MapBinder& b, Conditions::Condition& object, const string& key_type, const string& val_type) @@ -384,10 +403,5 @@ namespace DD4hep { /// Conditions: Filling function for STL maps. template <> bool OpaqueDataBinder::insert_map(const MapBinder& b, Conditions::Condition& object, const string& key_type, const string& val_type, const string& pair_data) - { return insert_map(b, object->data, key_type, val_type, pair_data); } - - /// Instantiation for Conditions: - template bool - OpaqueDataBinder::bind_sequence<Conditions::Condition>(Conditions::Condition& object,const string& typ,const string& val); - + { return insert_map(b, object->data, key_type, val_type, pair_data); } } diff --git a/DDDB/src/DDDBPlugins.cpp b/DDDB/src/DDDBPlugins.cpp index 785559e03c7342afe6f257fc00c545e55e85d628..29ac0eb395497257aab4d4732242dd0e319fdfaa 100644 --- a/DDDB/src/DDDBPlugins.cpp +++ b/DDDB/src/DDDBPlugins.cpp @@ -55,7 +55,6 @@ namespace { */ long dddb_map_condition_keys2detelements(LCDD& lcdd, int /* argc */, char** /* argv */) { - typedef DDDB::Named::StringMap StringMap; using DDDB::Catalog; using Geometry::DetElement; @@ -80,16 +79,16 @@ namespace { conditions->addKey(cat->condition); conditions->addKey("Alignment", cat->condition); } - for(StringMap::const_iterator i=cat->conditioninfo.begin(); i!=cat->conditioninfo.end(); ++i) { - const string& cond_name = (*i).second; + for(const auto& i : cat->conditioninfo ) { + const string& cond_name = i.second; conditions->addKey(cond_name); - conditions->addKey((*i).first, cond_name); + conditions->addKey(i.first, cond_name); } } catch(...) { } - for (DetElement::Children::const_iterator i=c.begin(); i != c.end(); ++i) - (*this)((*i).second); + for (const auto& i : c ) + (*this)(i.second); return 1; } }; @@ -134,10 +133,8 @@ namespace { * @date 01/04/2014 */ struct Actor { - /// Defintion of the container with all known conditions - typedef vector<pair<int,Condition> > _RC; /// Container with all known conditions - _RC m_allConditions; + vector<pair<int,Condition> > m_allConditions; Counters m_counters; bool m_sensitivesOnly; bool m_dumpConditions; @@ -160,16 +157,16 @@ namespace { } #if 0 printout(INFO,m_name,"**************** DDDB Detector dump: Conditions Usage ***************************"); - for(_RC::const_iterator ic=m_allConditions.begin(); ic!=m_allConditions.end(); ++ic) { - Condition cond = (*ic).second; + for(const auto& ic : m_allConditions ) { + Condition cond = ic.second; const AbstractMap& data = cond.get<AbstractMap>(); const DDDB::Document* doc = data.option<DDDB::Document>(); if ( doc ) printout(INFO,m_name,"++ Usage: %d Cond: %s/%s -> %s [%08X]", - (*ic).first, doc->name.c_str(), cond->name.c_str(), cond->value.c_str(), cond->hash); + ic.first, doc->name.c_str(), cond->name.c_str(), cond->value.c_str(), cond->hash); else printout(INFO,m_name,"++ Usage: %d Cond: ---/%s -> %s [%08X]", - (*ic).first, cond->name.c_str(), cond->value.c_str(), cond->hash); + ic.first, cond->name.c_str(), cond->value.c_str(), cond->hash); } #endif printout(INFO,m_name,"*********************************************************************************"); @@ -185,8 +182,7 @@ namespace { Conditions::Operators::collectAllConditions(m_lcdd, rc); m_iov.reset().invert(); m_iov.iovType = 0; - for(RangeConditions::const_iterator ic=rc.begin(); ic!=rc.end(); ++ic) { - Condition cond = *ic; + for ( Condition cond : rc ) { m_allConditions.push_back(make_pair(0,cond)); if ( !m_iov.iovType ) m_iov = cond.iov(); else m_iov.iov_intersection(cond.iov()); @@ -195,8 +191,7 @@ namespace { if ( m_dumpConditions ) { DDDB::ConditionPrinter prt; printout(INFO,m_name,"**************** DDDB Detector dump: ALL Conditions *****************************"); - for(RangeConditions::const_iterator ic=rc.begin(); ic!=rc.end(); ++ic) - prt(*ic); + for(Condition cond : rc ) prt(cond); printout(INFO,m_name,"*********************************************************************************"); } } @@ -207,18 +202,18 @@ namespace { RangeConditions findCond(const string& match) { RangeConditions result; if ( !match.empty() ) { - for(_RC::iterator ic=m_allConditions.begin(); ic!=m_allConditions.end(); ++ic) { - Condition cond = (*ic).second; + for ( auto& ic : m_allConditions ) { + Condition cond = ic.second; size_t idx = cond->value.find(match); if ( idx == 0 ) { if (cond->value.length() == match.length() ) { - (*ic).first++; + ic.first++; result.push_back(cond); } else if ( cond->value[match.length()] == '/' ) { size_t idq = cond->value.find('/',match.length()+1); if ( idq == string::npos ) { - (*ic).first++; + ic.first++; result.push_back(cond); } } @@ -234,7 +229,6 @@ namespace { bool with_keys=false, bool with_values=false) { - typedef Conditions::Container::Object::Keys _K; char fmt[128]; const DetElement::Children& c = de.children(); ::sprintf(fmt,"%03d %%-%ds Detector: %%s #Dau:%%d VolID:%%p Place:%%p",level+1,2*level+1); @@ -247,14 +241,13 @@ namespace { if ( (with_keys || with_values) && de.hasConditions() ) { Conditions::DetConditions dc(de); Conditions::Container cont = dc.conditions(); - const _K& keys = cont->keys; ::sprintf(fmt,"%03d %%-%ds Key: %%08X -> %%08X -> %%s",level+1,2*level+3); - for(_K::const_iterator i=keys.begin(); i!=keys.end(); ++i) { + for(const auto& i : cont->keys ) { if ( with_keys ) { - printout(INFO,m_name,fmt,"",(*i).first,(*i).second.first, (*i).second.second.c_str()); + printout(INFO,m_name,fmt,"",i.first,i.second.first, i.second.second.c_str()); } if ( with_values ) { - Condition::key_type key = (*i).second.first; + Condition::key_type key = i.second.first; Condition cond = dc.get(key, m_iov); prt(cond); } @@ -266,18 +259,17 @@ namespace { if ( cat && !cat->conditioninfo.empty() ) { char fmt[128]; ::sprintf(fmt,"%03d %%-%ds Cond:%%-20s -> %%s",level+1,2*level+3); - for(DDDB::Named::StringMap::const_iterator i=cat->conditioninfo.begin(); i!=cat->conditioninfo.end(); ++i) { - const string& cond_name = (*i).second; + for(const auto& i : cat->conditioninfo ) { + const string& cond_name = i.second; ++m_counters.numConditions; if ( with_elements ) { RangeConditions rc = findCond(cond_name); - printout(INFO,m_name,fmt,"",(*i).first.c_str(), + printout(INFO,m_name,fmt,"",i.first.c_str(), rc.empty() ? (cond_name+" !!!UNRESOLVED!!!").c_str() : cond_name.c_str()); - for(RangeConditions::const_iterator ic=rc.begin(); ic!=rc.end(); ++ic) - prt(*ic); + for(Condition cond : rc ) prt(cond); continue; } - printout(INFO,m_name,fmt,"",(*i).first.c_str(),cond_name.c_str()); + printout(INFO,m_name,fmt,"",i.first.c_str(),cond_name.c_str()); } } } @@ -291,8 +283,8 @@ namespace { RangeConditions rc = findCond(cat->condition); printout(INFO,m_name,fmt,"","Alignment:", rc.empty() ? (cat->condition+" !!!UNRESOLVED!!!").c_str() : cat->condition.c_str()); - for(RangeConditions::const_iterator ic=rc.begin(); ic!=rc.end(); ++ic) - prt(*ic); + for(const auto& i : rc) + prt(i); return; } printout(INFO,m_name,fmt,"","Alignment:",cat->condition.c_str()); @@ -349,8 +341,8 @@ namespace { printout(INFO,m_name, fmt, "", de.path().c_str(), "NO CATALOG availible!", ""); ++m_counters.numNoCatalogs; } - for (DetElement::Children::const_iterator i = c.begin(); i != c.end(); ++i) - dump((*i).second,level+1); + for (const auto& i : c) + dump(i.second,level+1); return 1; } }; diff --git a/DDTest/include/DD4hep/DDTest.h b/DDTest/include/DD4hep/DDTest.h index 236ad1d87770ba3c9231ec2866a982538bcf9d09..bff921f0e3cb581ec02b9ec173750929fdbc55a3 100644 --- a/DDTest/include/DD4hep/DDTest.h +++ b/DDTest/include/DD4hep/DDTest.h @@ -17,10 +17,16 @@ namespace DD4hep{ */ class DDTest{ - DDTest() : _out(std::cout) {} - public: + /// Default constructor + DDTest() = delete; + + /// Copy constructor + DDTest(const DDTest& copy) = delete; + /// Assignment operator + DDTest& operator=(const DDTest& copy) = delete; + /** Only constructor */ @@ -69,17 +75,17 @@ namespace DD4hep{ if ( ! (v1 == v2) ) { - std::stringstream sstr ; - sstr << " " << name<< " : [" << v1 << "] != [" << v2 <<"]" ; + std::stringstream sstr ; + sstr << " " << name<< " : [" << v1 << "] != [" << v2 <<"]" ; - error( sstr.str() ) ; + error( sstr.str() ) ; } else { - std::stringstream sstr ; - sstr << " " << name<< " : [" << v1 << "] == [" << v2 <<"]" ; + std::stringstream sstr ; + sstr << " " << name<< " : [" << v1 << "] == [" << v2 <<"]" ; - pass( sstr.str() ) ; + pass( sstr.str() ) ; } return ; @@ -92,17 +98,17 @@ namespace DD4hep{ if ( ! (c) ) { - std::stringstream sstr ; - sstr << " " << name<< " : [" << c << "] " ; + std::stringstream sstr ; + sstr << " " << name<< " : [" << c << "] " ; - error( sstr.str() ) ; + error( sstr.str() ) ; } else { - std::stringstream sstr ; - sstr << " " << name<< " : [" << c << "] " ; + std::stringstream sstr ; + sstr << " " << name<< " : [" << c << "] " ; - pass( sstr.str() ) ; + pass( sstr.str() ) ; } return ; } @@ -144,8 +150,6 @@ namespace DD4hep{ //std::cerr << errmsg.str(); } - - /** Fatal error ...*/ void fatal_error( const std::string& msg ){ error( msg ); @@ -153,23 +157,19 @@ namespace DD4hep{ exit(1); } - - /** Return the status from the last test - either PASSED or FAILED */ const char* last_test_status(){ return ( _last_test_status ? "PASSED" : "FAILED" ) ; } - - private: std::string _testname ; - std::ostream& _out ; + std::ostream& _out = std::cout; - unsigned int _failed ; // number of failed tests - unsigned int _passed ; // number of passed tests - bool _last_test_status ; // true if last test succeeded, false otherwise + unsigned int _failed = 0; // number of failed tests + unsigned int _passed = 0; // number of passed tests + bool _last_test_status = false; // true if last test succeeded, false otherwise }; diff --git a/DDTest/src/STR.h b/DDTest/src/STR.h index 8c93e829b8b4d0497c98e0b1440d0e556eb4e7c4..60abf168b36c82bf91df1f9ad3388f2fbe84f3b3 100644 --- a/DDTest/src/STR.h +++ b/DDTest/src/STR.h @@ -40,6 +40,7 @@ namespace { public: STR ( float val ) : _val(val), _str(_to_string(val)) { } std::string str() const { return _str ; } + float value() const { return _val; } bool operator==( const STR& s2) const { return this->str() == s2.str() ; } diff --git a/DDTest/src/test_DetType.cc b/DDTest/src/test_DetType.cc index 61e10be350793b20877505bd4291c531c5f95ae5..cb6bbeea247271ae6ad42248bb7fa26e52582ee4 100644 --- a/DDTest/src/test_DetType.cc +++ b/DDTest/src/test_DetType.cc @@ -11,7 +11,7 @@ using namespace std ; using namespace DD4hep ; // this should be the first line in your test -DDTest test = DDTest( "bitfield64" ) ; +static DDTest test( "bitfield64" ) ; //============================================================================= diff --git a/DDTest/src/test_EventReaders.cc b/DDTest/src/test_EventReaders.cc index a7bef79eb5cbf43d1c7c44593c8d4d10466251d3..c8a43f8fd0d026360762a62dd88d8e45f860b754 100644 --- a/DDTest/src/test_EventReaders.cc +++ b/DDTest/src/test_EventReaders.cc @@ -16,7 +16,7 @@ typedef DD4hep::Simulation::Geant4Vertex Vertex; typedef DD4hep::Simulation::Geant4Particle Particle; -DD4hep::DDTest test = DD4hep::DDTest( "EventReader" ) ; +static DD4hep::DDTest test( "EventReader" ) ; class TestTuple { public: diff --git a/DDTest/src/test_PolarGridRPhi2.cc b/DDTest/src/test_PolarGridRPhi2.cc index dbf77a5d0b8ebc782926bdfdcaf72ac6605995da..3a3951b7b76c455f8b1ea1591293bba85c3f8dfc 100644 --- a/DDTest/src/test_PolarGridRPhi2.cc +++ b/DDTest/src/test_PolarGridRPhi2.cc @@ -8,7 +8,7 @@ #include <exception> -DD4hep::DDTest test = DD4hep::DDTest( "PolarGridRPhi2" ) ; +static DD4hep::DDTest test( "PolarGridRPhi2" ) ; class TestTuple { public: diff --git a/DDTest/src/test_bitfield64.cc b/DDTest/src/test_bitfield64.cc index e65b84b9d2050b4f426cf890eced6432fa1ad653..ab4f82b2acaeb036842f2ac172393010af2d0d86 100644 --- a/DDTest/src/test_bitfield64.cc +++ b/DDTest/src/test_bitfield64.cc @@ -12,7 +12,7 @@ using namespace DD4hep ; using namespace DDSegmentation ; // this should be the first line in your test -DDTest test = DDTest( "bitfield64" ) ; +static DDTest test( "bitfield64" ) ; //============================================================================= diff --git a/DDTest/src/test_cellDimensions.cc b/DDTest/src/test_cellDimensions.cc index 5d4412d402b1be69ed30f892ff207ccbf069ec1e..a55b98aeaa8cf6dae8d176efc8848a6b6064e5b9 100644 --- a/DDTest/src/test_cellDimensions.cc +++ b/DDTest/src/test_cellDimensions.cc @@ -13,7 +13,7 @@ #include <cmath> -DD4hep::DDTest test = DD4hep::DDTest( "CellDimensions" ) ; +static DD4hep::DDTest test( "CellDimensions" ) ; int main() { diff --git a/DDTest/src/test_cellDimensionsRPhi2.cc b/DDTest/src/test_cellDimensionsRPhi2.cc index 8ad906bfbfd96d07a557452ab93e218e48af4a1d..cb50c2a2ac122525b49a292d9010bdc86c082c1f 100644 --- a/DDTest/src/test_cellDimensionsRPhi2.cc +++ b/DDTest/src/test_cellDimensionsRPhi2.cc @@ -10,7 +10,7 @@ #include <exception> #include <cmath> -DD4hep::DDTest test = DD4hep::DDTest( "CellDimensions" ) ; +static DD4hep::DDTest test( "CellDimensions" ) ; using DD4hep::DDSegmentation::Segmentation; using DD4hep::DDSegmentation::CellID; diff --git a/DDTest/src/test_example.cc b/DDTest/src/test_example.cc index f21046004e266e69237ba6d9b17e5a20284f6b71..bc9910445c1d5119ca1d000bc4e9d24353059b25 100644 --- a/DDTest/src/test_example.cc +++ b/DDTest/src/test_example.cc @@ -8,7 +8,7 @@ using namespace std ; using namespace DD4hep ; // this should be the first line in your test -DDTest test = DDTest( "example" ) ; +static DDTest test( "example" ) ; //============================================================================= diff --git a/DDTest/src/test_segmentationHandles.cc b/DDTest/src/test_segmentationHandles.cc index a281589a7781ecf0f2e0a1f10d6c5eaf7086007a..b1d7a2c50c4ca800c9c0db2be0bc98ec69f37def 100644 --- a/DDTest/src/test_segmentationHandles.cc +++ b/DDTest/src/test_segmentationHandles.cc @@ -13,7 +13,7 @@ #include <cmath> -DD4hep::DDTest test = DD4hep::DDTest( "CellDimensions" ) ; +static DD4hep::DDTest test( "CellDimensions" ) ; using namespace DD4hep; using namespace DD4hep::Geometry; diff --git a/DDTest/src/test_surface.cc b/DDTest/src/test_surface.cc index bbd645e414d3077df65df8e3888cf732b94e0adc..4b02c228533c0f57767aea30aba4dd89f89f6a7f 100644 --- a/DDTest/src/test_surface.cc +++ b/DDTest/src/test_surface.cc @@ -21,7 +21,7 @@ using namespace DDSurfaces ; // this should be the first line in your test -DDTest test = DDTest( "surface" ) ; +static DDTest test( "surface" ) ; //============================================================================= int main(int argc, char** argv ){ diff --git a/DDTest/src/test_units.cc b/DDTest/src/test_units.cc index a3b81bfc1e023d84a3030e15cc7f2aa72c3d4152..9af5e4663476794a3f273237ae0ef0ddbde0cc63 100644 --- a/DDTest/src/test_units.cc +++ b/DDTest/src/test_units.cc @@ -15,7 +15,7 @@ using namespace Geometry; using namespace dd4hep ; // this should be the first line in your test -DDTest test = DDTest( "units" ) ; +static DDTest test( "units" ) ; //============================================================================= //============================================================================= diff --git a/UtilityApps/src/EvNavHandler.h b/UtilityApps/src/EvNavHandler.h index e348e53848ac5109c46ef81d87a83db2ecb42239..b54b38291c4027daf013eb14460e719e1555b5b3 100644 --- a/UtilityApps/src/EvNavHandler.h +++ b/UtilityApps/src/EvNavHandler.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/UtilityApps/src/LinkDef.h b/UtilityApps/src/LinkDef.h index c843552a741e1c8a18425141f1618494f17068d2..1b4825845f3cbdc45c9c6fc7c2c3343f3d3145bb 100644 --- a/UtilityApps/src/LinkDef.h +++ b/UtilityApps/src/LinkDef.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/UtilityApps/src/MultiView.h b/UtilityApps/src/MultiView.h index 8dc7978884fea89ca91ce9abc4b71bdd99e53e68..2ea61d13c8134027995bbde28db6db3d033c0ff4 100644 --- a/UtilityApps/src/MultiView.h +++ b/UtilityApps/src/MultiView.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/UtilityApps/src/converter.cpp b/UtilityApps/src/converter.cpp index 52b85870044be554bb1cb747e4df5cc6202b5ee9..649a15f5d8b4f90d8e28a5855cadc057c4ce87fd 100644 --- a/UtilityApps/src/converter.cpp +++ b/UtilityApps/src/converter.cpp @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/UtilityApps/src/display.cpp b/UtilityApps/src/display.cpp index 9fe8dff95c56edd1b195b3682864f3c69de2abeb..834688e9b7f8edfbf493cd3caeada8c59b87026a 100644 --- a/UtilityApps/src/display.cpp +++ b/UtilityApps/src/display.cpp @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/UtilityApps/src/dumpdetector.cpp b/UtilityApps/src/dumpdetector.cpp index 621a9b3ec2dc74f934338995b62c4201e54b89b3..de5e1785b686698218ddcf138f175d3fdfc76347 100644 --- a/UtilityApps/src/dumpdetector.cpp +++ b/UtilityApps/src/dumpdetector.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/UtilityApps/src/materialScan.cpp b/UtilityApps/src/materialScan.cpp index db7841085d5069226d9ff4017486c1711035707f..9a33bbd3a51902e1f23371a12d9e6ba47640cbec 100644 --- a/UtilityApps/src/materialScan.cpp +++ b/UtilityApps/src/materialScan.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/UtilityApps/src/next_event_dummy.cpp b/UtilityApps/src/next_event_dummy.cpp index c8f8fd09b4b723e40fe141d29e538ac5269937fb..4d6e839e33575185a7e0e894c2c75217bc7e7bd1 100644 --- a/UtilityApps/src/next_event_dummy.cpp +++ b/UtilityApps/src/next_event_dummy.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/UtilityApps/src/next_event_lcio.cpp b/UtilityApps/src/next_event_lcio.cpp index 27413628d6d3782833acacdd92bfac54f152bb13..dc6cd77a742dd58e38aa142cdaa37ab6f0435481 100644 --- a/UtilityApps/src/next_event_lcio.cpp +++ b/UtilityApps/src/next_event_lcio.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/UtilityApps/src/plugin_runner.cpp b/UtilityApps/src/plugin_runner.cpp index 447f92a7d2be605a422a8f5a5bbcff786e1e1f95..d94e03923b995f7d80a508be9de9cee91fc09989 100644 --- a/UtilityApps/src/plugin_runner.cpp +++ b/UtilityApps/src/plugin_runner.cpp @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/UtilityApps/src/print_materials.cpp b/UtilityApps/src/print_materials.cpp index 9a424ad6562461afe935b601622a38955be0aed4..f60764a92706f68229376b142d065f215060baf9 100644 --- a/UtilityApps/src/print_materials.cpp +++ b/UtilityApps/src/print_materials.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/UtilityApps/src/test_surfaces.cpp b/UtilityApps/src/test_surfaces.cpp index 2db3a5efbe989f6a774ef689ee4efbd7f9cad337..59e3c6afd427c59dfa96ef5ec28c2df241a708ac 100644 --- a/UtilityApps/src/test_surfaces.cpp +++ b/UtilityApps/src/test_surfaces.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -40,7 +39,7 @@ using namespace DDSurfaces ; using namespace lcio; -DDTest test = DDTest( "surfaces" ) ; +static DDTest test( "surfaces" ) ; //============================================================================= diff --git a/UtilityApps/src/teve_display.cpp b/UtilityApps/src/teve_display.cpp index deb32b98382b0ee57b59522385de0b882300d085..b0c991ad91edc02a1640a09d9b3b1708020d7b41 100644 --- a/UtilityApps/src/teve_display.cpp +++ b/UtilityApps/src/teve_display.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake index 551d143a4c88960e078d3df8f6aa3c0a6132592a..ff006d03c2cf0211f8c4e99cfa526e9b8d3a321d 100644 --- a/cmake/DD4hepBuild.cmake +++ b/cmake/DD4hepBuild.cmake @@ -56,6 +56,16 @@ macro(dd4hep_set_compiler_flags) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND APPLE) set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -undefined dynamic_lookup") +# All this simply does not work! +# if ( APPLE ) +# set(CMAKE_SKIP_BUILD_RPATH FALSE) +# set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) +# set(CMAKE_INSTALL_RPATH "${CMAKE_BINARY_DIR}/lib") +# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath ${CMAKE_BINARY_DIR}/lib") +# message( STATUS "Apple settings: CMAKE_INSTALL_RPATH: ${CMAKE_INSTALL_RPATH}" ) +# message( STATUS "Apple settings: CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}" ) +# endif() endif() endmacro(dd4hep_set_compiler_flags)