File indexing completed on 2024-04-06 12:12:55
0001 #include "FWCore/ParameterSet/interface/defaultModuleLabel.h"
0002
0003 #include <algorithm>
0004
0005 namespace edm {
0006 std::string defaultModuleLabel(std::string label) {
0007
0008 label.erase(std::remove(label.begin(), label.end(), ':'), label.end());
0009
0010
0011 label.erase(std::find(label.begin(), label.end(), '@'), label.end());
0012
0013
0014
0015
0016
0017 unsigned int ups = 0;
0018 for (char c : label)
0019 if (std::isupper(c))
0020 ++ups;
0021 else
0022 break;
0023 if (ups > 1 and ups != label.size())
0024 --ups;
0025 for (unsigned int i = 0; i < ups; ++i)
0026 label[i] = std::tolower(label[i]);
0027
0028 return label;
0029 }
0030 }