CMS 3D CMS Logo

Functions
DD4hep2DDDName Namespace Reference

Functions

std::string_view nameMatterLV (const std::string &name, bool dd4hep)
 
std::string_view namePV (const std::string &name, bool dd4hep)
 
std::string nameSolid (const std::string &name, bool dd4hep)
 

Function Documentation

◆ nameMatterLV()

std::string_view DD4hep2DDDName::nameMatterLV ( const std::string &  name,
bool  dd4hep 
)

Definition at line 4 of file DD4hep2DDDName.cc.

References Skims_PA_cff::name.

4  {
5  return (dd4hep ? (dd4hep::dd::noNamespace(name)) : name);
6 }

◆ namePV()

std::string_view DD4hep2DDDName::namePV ( const std::string &  name,
bool  dd4hep 
)

Definition at line 20 of file DD4hep2DDDName.cc.

References dqmiodumpmetadata::n, and Skims_PA_cff::name.

20  {
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 }

◆ nameSolid()

std::string DD4hep2DDDName::nameSolid ( const std::string &  name,
bool  dd4hep 
)

Definition at line 8 of file DD4hep2DDDName.cc.

References dqmiodumpmetadata::n, Skims_PA_cff::name, and AlCaHLTBitMon_QueryRunRegistry::string.

8  {
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 }