1 #ifndef __RecoParticleFlow_Benchmark_Matchers__
2 #define __RecoParticleFlow_Benchmark_Matchers__
16 template <
typename C,
typename M>
18 const M &matchedCandCollection,
19 std::vector<int> &matchIndices,
20 bool matchCharge =
false,
29 matchIndices.resize(candCollection.size(), -1);
31 for (
unsigned i = 0;
i < candCollection.size(); ++
i) {
32 static const double bigNumber = 1e14;
33 double dR2min = bigNumber;
35 for (
unsigned jm = 0; jm < matchedCandCollection.size(); ++jm) {
36 if (matchCharge && candCollection[
i].
charge() != matchedCandCollection[jm].charge())
39 double dR2 =
reco::deltaR2(candCollection[
i], matchedCandCollection[jm]);
46 if ((dR2Max > 0 && dR2min < dR2Max) || dRMax <= 0) {
47 matchIndices[
i] = jMin;
56 template <
typename C,
typename M>
58 const M &matchedCandCollection,
59 std::vector<int> &matchIndices,
63 bool matchCharge =
false,
72 matchIndices.resize(candCollection.size(), -1);
74 for (
unsigned i = 0;
i < candCollection.size(); ++
i) {
75 static const double bigNumber = 1e14;
76 double dR2min = bigNumber;
78 for (
unsigned jm = 0; jm < matchedCandCollection.size(); ++jm) {
79 if (parameterSet.
getParameter<
bool>(
"slimmedLikeSelection")) {
80 if (!(muonMatchedCandCollection[jm].
pt() > parameterSet.
getParameter<
double>(
"ptBase") ||
81 muonMatchedCandCollection[jm].isPFMuon() ||
82 (muonMatchedCandCollection[jm].pt() > parameterSet.
getParameter<
double>(
"ptNotPF") &&
83 (muonMatchedCandCollection[jm].isGlobalMuon() || muonMatchedCandCollection[jm].isStandAloneMuon() ||
84 muonMatchedCandCollection[jm].numberOfMatches() > 0 ||
89 if (matchCharge && candCollection[
i].
charge() != matchedCandCollection[jm].charge())
92 double dR2 =
reco::deltaR2(candCollection[
i], matchedCandCollection[jm]);
99 if ((dR2Max > 0 && dR2min < dR2Max) || dRMax <= 0) {
100 matchIndices[
i] = jMin;
void match(const C &candCollection, const M &matchedCandCollection, std::vector< int > &matchIndices, bool matchCharge=false, float dRMax=-1)
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
T getParameter(std::string const &) const