File indexing completed on 2023-03-17 11:16:03
0001 #ifndef NanoAOD_MatchingUtils_h
0002 #define NanoAOD_MatchingUtils_h
0003
0004
0005
0006
0007
0008 template <class C1, class C2>
0009 bool matchByCommonSourceCandidatePtr(const C1& c1, const C2& c2) {
0010 for (unsigned int i1 = 0; i1 < c1.numberOfSourceCandidatePtrs(); i1++) {
0011 auto c1s = c1.sourceCandidatePtr(i1);
0012 for (unsigned int i2 = 0; i2 < c2.numberOfSourceCandidatePtrs(); i2++) {
0013 if (c2.sourceCandidatePtr(i2) == c1s)
0014 return true;
0015 }
0016 }
0017 return false;
0018 }
0019
0020 template <class C1, class C2>
0021 bool matchByCommonParentSuperClusterRef(const C1& c1, const C2& c2) {
0022 auto c1s = c1.parentSuperCluster();
0023 auto c2s = c2.parentSuperCluster();
0024 return (c1s == c2s);
0025 }
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 #endif