CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
DTOccupancyCluster.h File Reference
#include "DTOccupancyPoint.h"
#include <vector>
#include <string>
#include <cmath>
#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 174 of file DTOccupancyCluster.cc.

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

Referenced by DTOccupancyClusterBuilder::sortClusters().

174  {
175  if (clusterTwo.nPoints() == 1 && clusterOne.nPoints() != 1) {
176  return true;
177  }
178  if (clusterTwo.nPoints() != 1 && clusterOne.nPoints() == 1) {
179  return false;
180  }
181 
182  if (clusterOne.nPoints() > clusterTwo.nPoints()) {
183  return true;
184  } else if (clusterOne.nPoints() < clusterTwo.nPoints()) {
185  return false;
186  } else {
187  if (fabs(clusterOne.averageRMS() - sqrt(clusterOne.averageMean())) <
188  fabs(clusterTwo.averageRMS() - sqrt(clusterTwo.averageMean()))) {
189  return true;
190  }
191  }
192  return false;
193 }
double averageRMS() const
average RMS of the cell occpuancy distributions of the layers in the cluster
T sqrt(T t)
Definition: SSEVec.h:19
double averageMean() const
average cell occupancy of the layers in the cluster
int nPoints() const
of layers belonging to the cluster