CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_5_2_9/src/DQM/DTMonitorClient/src/DTOccupancyCluster.cc File Reference

#include "DTOccupancyCluster.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "TH2F.h"
#include "TMath.h"
#include <iostream>

Go to the source code of this file.

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;

}