Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:49

0001 //==============================================================================
0002 //  AIDA Detector description implementation for LHCb
0003 //------------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 //  \author   Markus Frank
0011 //  \date     2018-03-08
0012 //  \version  1.0
0013 //
0014 //==============================================================================
0015 #ifndef DETECTOR_DETECTORELEMENT_INL_H 
0016 #define DETECTOR_DETECTORELEMENT_INL_H 1
0017 
0018 // Framework include files
0019 #include "Detector/DetectorElement.h"
0020 #include "DD4hep/ConditionsMap.h"
0021 #include "DD4hep/Printout.h"
0022 
0023 template<typename T> std::map<dd4hep::DetElement, T*>
0024 gaudi::DeHelpers::getChildConditions(ConditionsMap& m, DetElement de, itemkey_type key, int flags)    {
0025   std::map<dd4hep::DetElement, T*> cache;
0026   auto children = de.children();
0027   for(const auto& c : children)   {
0028     T* p = dynamic_cast<T*>(m.get(c.second, Keys::deKey).ptr());
0029     if ( p )  {
0030       cache.insert(std::make_pair(c.second,p));
0031       continue;
0032     }
0033     if ( 0 != (flags&ALL) )  {
0034       except("DeStatic","fillCache> No such condition:%d for detector element:%s",
0035              key, de.path().c_str());
0036     }
0037   }
0038   return cache;
0039 }
0040 
0041 #endif // DETECTOR_DETECTORELEMENT_INL_H