1 #ifndef __RecoParticleFlow_Benchmark_Matchers__ 2 #define __RecoParticleFlow_Benchmark_Matchers__ 17 template<
typename C,
typename M >
19 const M& matchedCandCollection,
20 std::vector<int>& matchIndices,
21 bool matchCharge =
false,
30 matchIndices.resize( candCollection.size(), -1);
32 for(
unsigned i=0;
i<candCollection.size(); ++
i) {
34 static const double bigNumber = 1e14;
35 double dR2min = bigNumber;
37 for(
unsigned jm=0; jm<matchedCandCollection.size(); ++jm) {
40 candCollection[
i].
charge() != matchedCandCollection[jm].charge() )
44 matchedCandCollection[jm] );
51 if( (dR2Max>0 && dR2min < dR2Max) || dRMax<=0 ) {
52 matchIndices[
i] = jMin;
61 template<
typename C,
typename M >
63 const M& matchedCandCollection,
64 std::vector<int>& matchIndices,
68 bool matchCharge =
false,
77 matchIndices.resize( candCollection.size(), -1);
79 for(
unsigned i=0;
i<candCollection.size(); ++
i) {
81 static const double bigNumber = 1e14;
82 double dR2min = bigNumber;
84 for(
unsigned jm=0; jm<matchedCandCollection.size(); ++jm) {
86 if ( parameterSet.
getParameter<
bool>(
"slimmedLikeSelection") ) {
87 if ( !( muonMatchedCandCollection[jm].
pt() > parameterSet.
getParameter<
double>(
"ptBase") ||
88 muonMatchedCandCollection[jm].isPFMuon() ||
89 ( muonMatchedCandCollection[jm].pt() > parameterSet.
getParameter<
double>(
"ptNotPF") &&
90 (muonMatchedCandCollection[jm].isGlobalMuon() || muonMatchedCandCollection[jm].isStandAloneMuon() || muonMatchedCandCollection[jm].numberOfMatches() > 0 ||
muon::isGoodMuon(muonMatchedCandCollection[jm],
muon::RPCMuLoose) ) )
96 candCollection[
i].
charge() != matchedCandCollection[jm].charge() )
100 matchedCandCollection[jm] );
107 if( (dR2Max>0 && dR2min < dR2Max) || dRMax<=0 ) {
108 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)