CMS 3D CMS Logo

DD4hep2DDDName.cc
Go to the documentation of this file.
2 #include <DD4hep/Filter.h>
3 
4 std::string_view DD4hep2DDDName::nameMatterLV(const std::string& name, bool dd4hep) {
5  return (dd4hep ? (dd4hep::dd::noNamespace(name)) : name);
6 }
7 
9  if (!dd4hep)
10  return name;
11  std::string nam = static_cast<std::string>(dd4hep::dd::noNamespace(name));
12  auto n = nam.find("_shape");
13  if (n != std::string::npos)
14  nam = nam.substr(0, n);
15  if (name.find("_refl") != std::string::npos)
16  nam += "_refl";
17  return nam;
18 }
19 
20 std::string_view DD4hep2DDDName::namePV(const std::string& name, bool dd4hep) {
21  if (!dd4hep)
22  return name;
23  std::string_view nam = (dd4hep::dd::noNamespace(name));
24  auto n = nam.rfind('_');
25  return ((n != std::string::npos) ? nam.substr(0, n) : nam);
26 }
std::string_view namePV(const std::string &name, bool dd4hep)
std::string_view nameMatterLV(const std::string &name, bool dd4hep)
std::string nameSolid(const std::string &name, bool dd4hep)