CMS 3D CMS Logo

ForwardName.cc
Go to the documentation of this file.
2 
3 std::string ForwardName::getName(const G4String& namx) {
4  std::string name = static_cast<std::string>(namx);
5  if (name.find(':') == std::string::npos) {
6  return name;
7  } else {
8  std::size_t first = name.find(':') + 1;
9  std::size_t last = name.rfind('_');
10  std::size_t length = (last != std::string::npos) ? (last - first) : (name.size() - first);
11  return name.substr(first, length);
12  }
13 }
std::string getName(const G4String &)
Definition: ForwardName.cc:3