1 #ifndef __RecoParticleFlow_Benchmark_Matchers__
2 #define __RecoParticleFlow_Benchmark_Matchers__
12 template<
typename C,
typename M>
14 const M& matchedCandCollection,
15 std::vector<int>& matchIndices,
16 bool matchCharge =
false,
22 if(dRMax>0) dR2Max = dRMax*dRMax;
25 matchIndices.resize( candCollection.size(), -1);
27 for(
unsigned i=0;
i<candCollection.size(); ++
i) {
29 static const double bigNumber = 1e14;
30 double dR2min = bigNumber;
32 for(
unsigned jm=0; jm<matchedCandCollection.size(); ++jm) {
35 candCollection[
i].
charge()!=matchedCandCollection[jm].charge() )
39 matchedCandCollection[jm] );
47 if( (dR2Max>0 && dR2min < dR2Max) || dRMax<=0 ) {
48 matchIndices[
i] = jMin;
void match(const C &candCollection, const M &matchedCandCollection, std::vector< int > &matchIndices, bool matchCharge=false, float dRMax=-1)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)