4 std::vector<edm::ParameterSet> binnings,
7 std::stringstream pathSpecificSettingsStream(pathSpecificSettings);
9 std::vector<std::string> pathSpecificSettingsSeglist;
10 while (std::getline(pathSpecificSettingsStream, pathSpecificSettingsSegment,
',')) {
11 pathSpecificSettingsSeglist.push_back(pathSpecificSettingsSegment);
14 for (
const auto& pathSpecificSetting : pathSpecificSettingsSeglist) {
16 std::stringstream pathSpecificSettingStream(pathSpecificSetting);
18 std::vector<std::string> pathSpecificSettingSeglist;
19 while (std::getline(pathSpecificSettingStream, pathSpecificSettingSegment,
'=')) {
20 pathSpecificSettingSeglist.push_back(pathSpecificSettingSegment);
22 if (pathSpecificSettingSeglist.size() != 2)
23 throw cms::Exception(
"InputError") <<
"Path-specific cuts could not be parsed. Make sure that each parameter " 24 "contains exactly one equal sign!.\n";
25 const std::string cutVariable = pathSpecificSettingSeglist.at(0);
26 const std::string cutParameter = pathSpecificSettingSeglist.at(1);
29 if (cutVariable ==
"absEtaMax" || cutVariable ==
"absEtaCut") {
31 rangeCutConfig.
addParameter<std::vector<std::string>>(
"allowedRanges", {
"-" + cutParameter +
":" + cutParameter});
32 }
else if (cutVariable ==
"absEtaMin") {
34 rangeCutConfig.
addParameter<std::vector<std::string>>(
"allowedRanges",
35 {
"-999:" + cutParameter, cutParameter +
":999"});
36 }
else if (cutVariable ==
"ptMax") {
38 rangeCutConfig.
addParameter<std::vector<std::string>>(
"allowedRanges", {
"0:" + cutParameter});
39 }
else if (cutVariable ==
"ptMin" || cutVariable ==
"ptCut") {
41 rangeCutConfig.
addParameter<std::vector<std::string>>(
"allowedRanges", {cutParameter +
":999999"});
42 }
else if (cutVariable ==
"etMax") {
44 rangeCutConfig.
addParameter<std::vector<std::string>>(
"allowedRanges", {
"0:" + cutParameter});
45 }
else if (cutVariable ==
"etMin" || cutVariable ==
"etCut") {
47 rangeCutConfig.
addParameter<std::vector<std::string>>(
"allowedRanges", {cutParameter +
":999999"});
48 }
else if (cutVariable ==
"region") {
53 std::stringstream cutParameterStream(cutParameter);
55 std::vector<std::string> cutParameterSeglist;
56 while (std::getline(cutParameterStream, cutParameterSegment,
'+')) {
57 cutParameterSeglist.push_back(cutParameterSegment);
60 for (
const auto&
region : cutParameterSeglist) {
62 rangeCutConfig.
addParameter<std::vector<std::string>>(
"allowedRanges", {
"-1.4442:1.4442"});
63 }
else if (
region ==
"EE") {
64 rangeCutConfig.
addParameter<std::vector<std::string>>(
"allowedRanges", {
"-999:-1.5660",
"1.5660:999"});
70 }
else if (cutVariable ==
"bins") {
73 bool binningFound =
false;
74 bool binningUsed =
false;
75 for (
const auto&
binning : binnings) {
80 <<
"Multiple different binnings set for a path, this does not make sense!.\n";
89 <<
"Binning " << cutParameter <<
" not recognized! Please pass the definition to the module.\n";
91 }
else if (cutVariable ==
"tag") {
93 }
else if (cutVariable ==
"autotag") {
99 <<
"Path-specific cut " + cutVariable +
100 " not recognized. The following options can be user: absEtaMax, absEtaCut, absEtaMin, ptMax, ptMin, " 101 "ptCut, etMax, etMin, etCut, region, bins and tag.\n";
104 if (!rangeCutConfig.
empty())
std::vector< double > pathSpecificBins_
std::vector< edm::ParameterSet > pathSpecificCutsVector_
void addParameter(std::string const &name, T const &value)
HLTGenValPathSpecificSettingParser(std::string pathSpecificSettings, std::vector< edm::ParameterSet > binnings, std::string vsVar)