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)
double deltaR2(double eta1, double phi1, double eta2, double phi2)