#include "DTOccupancyPoint.h"
#include <vector>
#include <string>
#include <math.h>
#include <set>
Go to the source code of this file.
Classes | |
class | DTOccupancyCluster |
Cluster of DTOccupancyPoint used bt DTOccupancyTest to spot problematic layers. More... | |
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 funct::sqrt().
Referenced by DTOccupancyClusterBuilder::sortClusters().
00247 { 00248 if(clusterTwo.nPoints() == 1 && clusterOne.nPoints() != 1) { 00249 return true; 00250 } 00251 if(clusterTwo.nPoints() != 1 && clusterOne.nPoints() == 1) { 00252 return false; 00253 } 00254 00255 if(clusterOne.nPoints() > clusterTwo.nPoints()) { 00256 return true; 00257 } else if(clusterOne.nPoints() < clusterTwo.nPoints()) { 00258 return false; 00259 } else { 00260 if(fabs(clusterOne.averageRMS() - sqrt(clusterOne.averageMean())) < 00261 fabs(clusterTwo.averageRMS() - sqrt(clusterTwo.averageMean()))) { 00262 return true; 00263 } 00264 } 00265 return false; 00266 00267 }