20 class DistanceProvider;
38 template<
class ClusterType>
41 const std::vector<ClusterType*>&
clusters)
const;
42 template<
class ClusterType>
46 double energyThreshold)
const;
47 template<
class ClusterType>
63 template<
class ClusterType>
65 ClusterType* bestCluster =
nullptr;
67 unsigned int nClusters(
clusters.size());
68 for (
unsigned int iCluster = 0; iCluster < nClusters; ++iCluster){
70 ClusterType* thisCluster =
clusters[iCluster];
74 if (thisDistance < mybestdistance){
75 if (thisDistance < bestDistance) {
76 bestDistance = thisDistance;
77 bestCluster = thisCluster;
85 template<
class ClusterType>
88 std::vector<MatchDistance>
result;
89 unsigned const nClusters(
clusters.size());
92 for (
unsigned int iCluster = 0; iCluster < nClusters; ++iCluster) {
93 ClusterType* thisCluster =
clusters[iCluster];
102 int nLoops = nMatches;
103 std::vector<unsigned int> masked;
104 std::vector<int> maskedType;
105 for (
int imatch = 0; imatch < nLoops; ++imatch) {
106 ClusterType* bestCluster =
nullptr;
109 for (
unsigned int iCluster = 0; iCluster < nClusters; ++iCluster) {
111 if (masked.size() != 0 &&
find(masked.begin(), masked.end(), iCluster) != masked.end()) {
115 ClusterType* thisCluster =
clusters[iCluster];
118 if(imatch == 0 && thisCluster->e() <= energyThreshold) {
124 if ((maskedType.size() != 0 &&
find(maskedType.begin(), maskedType.end(),
125 thisCluster->getEfRecCluster()->getClusterType()) != maskedType.end())
126 || (thisCluster->getEfRecCluster()->getClusterType() == 4)) {
132 if (thisDistance < bestDistance) {
134 bestDistance = thisDistance;
135 bestCluster = thisCluster;
138 if (iMasked == -1 ||
nullptr == bestCluster)
break;
140 masked.push_back(iMasked);
141 maskedType.push_back(bestCluster->getEfRecCluster()->getClusterType());
145 assert(maskedType.size() == masked.size());
152 template<
class ClusterType>
155 double m_coneRSq = 1.64*1.64;
156 double coneRSq = m_coneRSq;
160 clusEta = theCluster->eta();
162 if (std::abs(clusEta)<0.6) ieta=0;
163 if (std::abs(clusEta)>=0.6 && std::abs(clusEta)<1.6) ieta = 1 +
int((std::abs(clusEta) - 0.6)/0.2) ;
164 if (std::abs(clusEta)>=1.6 && std::abs(clusEta)<2.0) ieta = 6 ;
165 if (std::abs(clusEta)>=2.0 && std::abs(clusEta)<2.5) ieta = 7 ;
166 if (std::abs(clusEta)>=2.5) ieta = 8 ;
168 double clusterEnergy = theCluster->e()/1000.0;
171 coneRSq = drcut*drcut;
173 if (coneRSq>m_coneRSq) coneRSq = m_coneRSq;
176 if (coneRSq<conemin*conemin) coneRSq = conemin*conemin;