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
mps_fire.i
i
Definition: mps_fire.py:428
edm
HLT enums.
Definition: AlignableModifier.h:19
defaultModuleLabel.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MatrixUtil.remove
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:219
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::defaultModuleLabel
std::string defaultModuleLabel(std::string label)
Definition: defaultModuleLabel.cc:6