CMS 3D CMS Logo

defaultModuleLabel.cc
Go to the documentation of this file.
2 
3 #include <algorithm>
4 
5 namespace edm {
7  // remove all colons (module type may contain namespace)
8  label.erase(std::remove(label.begin(), label.end(), ':'), label.end());
9 
10  // the following code originates from HLTrigger/HLTcore/interface/defaultModuleLabel.h
11  // if the label is all uppercase, change it to all lowercase
12  // if the label starts with more than one uppercase letter, change n-1 to lowercase
13  // otherwise, change the first letter to lowercase
14  unsigned int ups = 0;
15  for (char c : label)
16  if (std::isupper(c))
17  ++ups;
18  else
19  break;
20  if (ups > 1 and ups != label.size())
21  --ups;
22  for (unsigned int i = 0; i < ups; ++i)
23  label[i] = std::tolower(label[i]);
24 
25  return label;
26  }
27 } // namespace edm
char const * label
std::string defaultModuleLabel(std::string label)
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:223
HLT enums.