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) {
33 static const double bigNumber = 1e14;
34 double dR2min = bigNumber;
36 for(
unsigned jm=0; jm<matchedCandCollection.size(); ++jm) {
39 candCollection[
i].
charge() != matchedCandCollection[jm].charge() )
43 matchedCandCollection[jm] );
50 if( (dR2Max>0 && dR2min < dR2Max) || dRMax<=0 ) {
51 matchIndices[
i] = jMin;
60 template<
typename C,
typename M >
62 const M& matchedCandCollection,
63 std::vector<int>& matchIndices,
67 bool matchCharge =
false,
76 matchIndices.resize( candCollection.size(), -1);
78 for(
unsigned i=0;
i<candCollection.size(); ++
i) {
80 static const double bigNumber = 1e14;
81 double dR2min = bigNumber;
83 for(
unsigned jm=0; jm<matchedCandCollection.size(); ++jm) {
85 if ( parameterSet.
getParameter<
bool>(
"slimmedLikeSelection") ) {
86 if ( !( muonMatchedCandCollection[jm].
pt() > parameterSet.
getParameter<
double>(
"ptBase") ||
87 muonMatchedCandCollection[jm].isPFMuon() ||
88 ( muonMatchedCandCollection[jm].pt() > parameterSet.
getParameter<
double>(
"ptNotPF") &&
89 (muonMatchedCandCollection[jm].isGlobalMuon() || muonMatchedCandCollection[jm].isStandAloneMuon() || muonMatchedCandCollection[jm].numberOfMatches() > 0 ||
muon::isGoodMuon(muonMatchedCandCollection[jm],
muon::RPCMuLoose) ) )
95 candCollection[
i].
charge() != matchedCandCollection[jm].charge() )
99 matchedCandCollection[jm] );
106 if( (dR2Max>0 && dR2min < dR2Max) || dRMax<=0 ) {
107 matchIndices[
i] = jMin;
T getParameter(std::string const &) const
void match(const C &candCollection, const M &matchedCandCollection, std::vector< int > &matchIndices, bool matchCharge=false, float dRMax=-1)
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
ParameterSet const & parameterSet(Provenance const &provenance)