FWCore
ParameterSet
src
defaultModuleLabel.cc
Go to the documentation of this file.
1
#include "
FWCore/ParameterSet/interface/defaultModuleLabel.h
"
2
3
#include <algorithm>
4
5
namespace
edm
{
6
std::string
defaultModuleLabel
(
std::string
label
) {
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
Generated for CMSSW Reference Manual by
1.8.16