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 247 of file DTOccupancyCluster.cc.

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

Referenced by DTOccupancyClusterBuilder::sortClusters().

247  {
248  if(clusterTwo.nPoints() == 1 && clusterOne.nPoints() != 1) {
249  return true;
250  }
251  if(clusterTwo.nPoints() != 1 && clusterOne.nPoints() == 1) {
252  return false;
253  }
254 
255  if(clusterOne.nPoints() > clusterTwo.nPoints()) {
256  return true;
257  } else if(clusterOne.nPoints() < clusterTwo.nPoints()) {
258  return false;
259  } else {
260  if(fabs(clusterOne.averageRMS() - sqrt(clusterOne.averageMean())) <
261  fabs(clusterTwo.averageRMS() - sqrt(clusterTwo.averageMean()))) {
262  return true;
263  }
264  }
265  return false;
266 
267 }
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