CMS 3D CMS Logo

Classes | Functions

/data/refman/pasoursint/CMSSW_5_2_9/src/DQM/DTMonitorClient/src/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

Function Documentation

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;

}