3 #include "DD4hep/Path.h" 4 #include "DD4hep/Printout.h" 16 m_name = path.filename().substr(0, path.filename().rfind(
'.'));
21 "DD4CMS",
"+++ Current namespace is now: %s",
m_name.c_str());
29 m_name = path.filename().substr( 0, path.filename().rfind(
'.'));
34 "DD4CMS",
"+++ Current namespace is now: %s",
m_name.c_str());
58 "DD4CMS",
"+++ Current namespace is now: %s",
m_name.c_str());
73 while(( idx = val.find(
'[')) != string::npos )
77 idq = val.find(
']', idx );
79 if( idp == string::npos || idp > idq )
81 else if ( idp != string::npos && idp < idq )
92 return nam.substr( 0, idx );
101 return nam.substr( idx + 1 );
114 const string&
v =
val;
115 const string&
n = nam;
117 "DD4CMS",
"+++ Add constant object: %-40s = %s [type:%s]",
118 n.c_str(), v.c_str(), typ.c_str());
119 dd4hep::_toDictionary( n, v, typ );
137 const dd4hep::Rotation3D&
140 static const dd4hep::Rotation3D s_null;
145 else if( nam ==
"NULL" )
147 else if( nam.find(
":NULL") == nam.length() - 5 )
158 cout <<
r.first << endl;
160 throw runtime_error(
"Unknown rotation identifier:"+nam);
166 string n = vol.name();
167 dd4hep::Solid
s = vol.solid();
169 vol->SetName(n.c_str());
172 "+++ Add volume:%-38s Solid:%-26s[%-16s] Material:%s",
173 vol.name(), s.name(), s.type(), m.name());
182 dd4hep::Solid
s = vol.solid();
187 "+++ Add volume:%-38s Solid:%-26s[%-16s] Material:%s",
188 vol.name(), s.name(), s.type(), m.name());
205 throw runtime_error(
"Unknown volume identifier:" + name );
214 "+++ Add shape of type %s : %s", solid->IsA()->GetName(), name.c_str());
244 throw runtime_error(
"Unknown shape identifier:" + nam );
dd4hep::Solid addSolidNS(const std::string &name, dd4hep::Solid solid) const
tbb::concurrent_queue< std::string > namespaces
dd4hep::Volume volume(const std::string &name, bool exc=true) const
dd4hep::Volume addVolumeNS(dd4hep::Volume vol) const
dd4hep::Volume addVolume(dd4hep::Volume vol) const
Add rotation matrix to current namespace.
bool const ns(std::string &result)
dd4hep::Solid solid(const std::string &name) const
std::atomic< dd4hep::Detector * > description
tbb::concurrent_unordered_map< std::string, dd4hep::Rotation3D > rotations
std::string_view name() const
void addConstantNS(const std::string &name, const std::string &value, const std::string &type) const
static std::string nsName(const std::string &)
void addRotation(const std::string &name, const dd4hep::Rotation3D &rot) const
std::string realName(const std::string &) const
static std::string objName(const std::string &)
dd4hep::Material material(const std::string &name) const
DDParsingContext * m_context
std::string prepend(const std::string &) const
tbb::concurrent_unordered_map< std::string, dd4hep::Volume > volumes
Namespace of DDCMS conversion namespace.
dd4hep::Solid addSolid(const std::string &name, dd4hep::Solid solid) const
const dd4hep::Rotation3D & rotation(const std::string &name) const
tbb::concurrent_unordered_map< std::string, dd4hep::Solid > shapes
void addConstant(const std::string &name, const std::string &value, const std::string &type) const