CMS 3D CMS Logo

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

◆ clusterIsLessThan()

bool clusterIsLessThan ( const DTOccupancyCluster clusterOne,
const DTOccupancyCluster clusterTwo 
)

for DTOccupancyCluster sorting

Definition at line 174 of file DTOccupancyCluster.cc.

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 }

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

Referenced by DTOccupancyClusterBuilder::sortClusters().

mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DTOccupancyCluster::averageRMS
double averageRMS() const
average RMS of the cell occpuancy distributions of the layers in the cluster
Definition: DTOccupancyCluster.cc:103
DTOccupancyCluster::nPoints
int nPoints() const
Definition: DTOccupancyCluster.cc:164
DTOccupancyCluster::averageMean
double averageMean() const
average cell occupancy of the layers in the cluster
Definition: DTOccupancyCluster.cc:101