31 static const std::regex re(
"^[+-]?(\\d+\\.?|\\d*\\.\\d*)$");
32 return regex_match(
str.c_str(), re);
38 deltaR_(iConfig.getParameter<double>(
"deltaR")),
39 weightExpr_(iConfig.getParameter<
std::
string>(
"weight")),
40 skipDefaultVeto_(iConfig.getParameter<
bool>(
"skipDefaultVeto"))
46 else if (
mode ==
"sumRelative")
48 else if (
mode ==
"sum2")
50 else if (
mode ==
"sum2Relative")
52 else if (
mode ==
"max")
54 else if (
mode ==
"maxRelative")
56 else if (
mode ==
"nearestDR")
58 else if (
mode ==
"count")
60 else if (
mode ==
"meanDR")
62 else if (
mode ==
"sumDR")
66 <<
"Supported modes are 'sum', 'sumRelative', 'count'." <<
68 "New methods can be easily implemented if requested.";
69 typedef std::vector<std::string>
vstring;
72 for (vstring::const_iterator it =
vetos.begin(), ed =
vetos.end(); it != ed; ++it) {
89 for (AbsVetos::iterator it = vetos_.begin(), ed = vetos_.end(); it != ed; ++it) {
97 iEvent.getByToken(srcToken_, hDeps_);
98 for (EventDependentAbsVetos::iterator it = evdepVetos_.begin(), ed = evdepVetos_.end(); it != ed; ++it) {
99 (*it)->setEvent(
iEvent, iSetup);
107 for (AbsVetos::iterator it = vetos_.begin(), ed = vetos_.end(); it != ed; ++it) {
108 (*it)->centerOn(
eta,
phi);
110 double weight = (usesFunction_ ? weightExpr_(*
cand) : weight_);
133 throw cms::Exception(
"Logic error") <<
"Should not happen at " << __FILE__ <<
", line "
139 typedef std::vector<edm::ParameterSet>
VPSet;
141 for (VPSet::const_iterator it = depPSets.begin(), ed = depPSets.end(); it != ed; ++it) {
145 throw cms::Exception(
"Configuration Error") <<
"Please specify at least one deposit!";
146 produces<CandDoubleMap>();
152 for (it = begin; it !=
end; ++it)
159 for (it = begin; it !=
end; ++it)
160 it->open(
event, eventSetup);
165 event.put(std::make_unique<CandDoubleMap>());
168 auto ret = std::make_unique<CandDoubleMap>();
173 iterator_i depI =
map.begin();
174 iterator_i depIEnd =
map.end();
175 for (; depI != depIEnd; ++depI) {
176 std::vector<double> retV(depI.size(), 0);
178 event.get(depI.id(), candH);
181 iterator_ii depII = depI.
begin();
182 iterator_ii depIIEnd = depI.end();
184 for (; depII != depIIEnd; ++depII, ++iRet) {
186 for (it = begin; it !=
end; ++it)
187 sum += it->compute(candV.
refAt(iRet));
190 filler.insert(candH, retV.begin(), retV.end());