CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
DTOccupancyCluster.h File Reference
#include "DTOccupancyPoint.h"
#include <vector>
#include <string>
#include <math.h>
#include <set>

Go to the source code of this file.

Classes

class  DTOccupancyCluster
 

Functions

bool clusterIsLessThan (const DTOccupancyCluster &clusterOne, const DTOccupancyCluster &clusterTwo)
 for DTOccupancyCluster sorting More...
 

Function Documentation

bool clusterIsLessThan ( const DTOccupancyCluster clusterOne,
const DTOccupancyCluster clusterTwo 
)

for DTOccupancyCluster sorting

Definition at line 245 of file DTOccupancyCluster.cc.

References DTOccupancyCluster::averageMean(), DTOccupancyCluster::averageRMS(), DTOccupancyCluster::nPoints(), and mathSSE::sqrt().

Referenced by DTOccupancyClusterBuilder::sortClusters().

245  {
246  if(clusterTwo.nPoints() == 1 && clusterOne.nPoints() != 1) {
247  return true;
248  }
249  if(clusterTwo.nPoints() != 1 && clusterOne.nPoints() == 1) {
250  return false;
251  }
252 
253  if(clusterOne.nPoints() > clusterTwo.nPoints()) {
254  return true;
255  } else if(clusterOne.nPoints() < clusterTwo.nPoints()) {
256  return false;
257  } else {
258  if(fabs(clusterOne.averageRMS() - sqrt(clusterOne.averageMean())) <
259  fabs(clusterTwo.averageRMS() - sqrt(clusterTwo.averageMean()))) {
260  return true;
261  }
262  }
263  return false;
264 
265 }
double averageRMS() const
average RMS of the cell occpuancy distributions of the layers in the cluster
T sqrt(T t)
Definition: SSEVec.h:48
double averageMean() const
average cell occupancy of the layers in the cluster
int nPoints() const
of layers belonging to the cluster