CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
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 More...
 

Function Documentation

bool clusterIsLessThan ( const DTOccupancyCluster clusterOne,
const DTOccupancyCluster clusterTwo 
)

for DTOccupancyCluster sorting

Definition at line 209 of file DTOccupancyCluster.cc.

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

Referenced by DTOccupancyClusterBuilder::sortClusters().

209  {
210  if(clusterTwo.nPoints() == 1 && clusterOne.nPoints() != 1) {
211  return true;
212  }
213  if(clusterTwo.nPoints() != 1 && clusterOne.nPoints() == 1) {
214  return false;
215  }
216 
217  if(clusterOne.nPoints() > clusterTwo.nPoints()) {
218  return true;
219  } else if(clusterOne.nPoints() < clusterTwo.nPoints()) {
220  return false;
221  } else {
222  if(fabs(clusterOne.averageRMS() - sqrt(clusterOne.averageMean())) <
223  fabs(clusterTwo.averageRMS() - sqrt(clusterTwo.averageMean()))) {
224  return true;
225  }
226  }
227  return false;
228 
229 }
double averageRMS() const
average RMS of the cell occpuancy distributions of the layers in the cluster
T sqrt(T t)
Definition: SSEVec.h:18
double averageMean() const
average cell occupancy of the layers in the cluster
int nPoints() const
of layers belonging to the cluster