Go to the source code of this file.
Classes | |
class | DTOccupancyCluster |
Functions | |
bool | clusterIsLessThan (const DTOccupancyCluster &clusterOne, const DTOccupancyCluster &clusterTwo) |
for DTOccupancyCluster sorting |
bool clusterIsLessThan | ( | const DTOccupancyCluster & | clusterOne, |
const DTOccupancyCluster & | clusterTwo | ||
) |
for DTOccupancyCluster sorting
Definition at line 247 of file DTOccupancyCluster.cc.
References DTOccupancyCluster::averageMean(), DTOccupancyCluster::averageRMS(), DTOccupancyCluster::nPoints(), and mathSSE::sqrt().
Referenced by DTOccupancyClusterBuilder::sortClusters().
{ if(clusterTwo.nPoints() == 1 && clusterOne.nPoints() != 1) { return true; } if(clusterTwo.nPoints() != 1 && clusterOne.nPoints() == 1) { return false; } if(clusterOne.nPoints() > clusterTwo.nPoints()) { return true; } else if(clusterOne.nPoints() < clusterTwo.nPoints()) { return false; } else { if(fabs(clusterOne.averageRMS() - sqrt(clusterOne.averageMean())) < fabs(clusterTwo.averageRMS() - sqrt(clusterTwo.averageMean()))) { return true; } } return false; }