CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTOccupancyCluster Class Reference

#include <DTOccupancyCluster.h>

Public Member Functions

bool addPoint (const DTOccupancyPoint &anotherPoint)
 
double averageMean () const
 average cell occupancy of the layers in the cluster More...
 
double averageRMS () const
 average RMS of the cell occpuancy distributions of the layers in the cluster More...
 
double distance (const DTOccupancyPoint &point) const
 
 DTOccupancyCluster (const DTOccupancyPoint &firstPoint, const DTOccupancyPoint &secondPoint)
 Constructor. More...
 
 DTOccupancyCluster (const DTOccupancyPoint &singlePoint)
 Constructor. More...
 
TH2F * getHisto (std::string histoName, int nBinsX, double minX, double maxX, int nBinsY, double minY, double maxY, int fillColor) const
 get a TH2F displaying the cluster More...
 
std::set< DTLayerIdgetLayerIDs () const
 
bool isValid () const
 Check if the cluster candidate satisfies the quality requirements. More...
 
double maxMean () const
 max average cell occupancy of the layers in the cluster More...
 
double maxRMS () const
 max RMS of the cell occpuancy distributions of the layers in the cluster More...
 
int nPoints () const
 
virtual ~DTOccupancyCluster ()
 Destructor. More...
 

Private Member Functions

void computeRadius ()
 
bool qualityCriterion (const DTOccupancyPoint &anotherPoint)
 
bool qualityCriterion (const DTOccupancyPoint &firstPoint, const DTOccupancyPoint &secondPoint)
 

Private Attributes

double radius
 
double theMaxMean
 
double theMaxRMS
 
double theMeanSum
 
std::vector< DTOccupancyPointthePoints
 
double theRMSSum
 
bool theValidity
 

Detailed Description

Cluster of DTOccupancyPoint used bt DTOccupancyTest to spot problematic layers. Layers are clusterized in the plane average cell occupancy - RMS of the cell occupancies.

Author
G. Cerminara - INFN Torino

Definition at line 20 of file DTOccupancyCluster.h.

Constructor & Destructor Documentation

◆ DTOccupancyCluster() [1/2]

DTOccupancyCluster::DTOccupancyCluster ( const DTOccupancyPoint firstPoint,
const DTOccupancyPoint secondPoint 
)

Constructor.

Definition at line 19 of file DTOccupancyCluster.cc.

20  : radius(0), theMaxMean(-1.), theMaxRMS(-1.), theMeanSum(0.), theRMSSum(0.) {
21  if (!qualityCriterion(firstPoint, secondPoint)) {
22  theValidity = false;
23  } else {
24  // compute the cluster quantities
25  thePoints.push_back(firstPoint);
26  thePoints.push_back(secondPoint);
27  if (firstPoint.mean() > secondPoint.mean())
28  theMaxMean = firstPoint.mean();
29  else
30  theMaxMean = secondPoint.mean();
31 
32  if (firstPoint.rms() > secondPoint.rms())
33  theMaxRMS = firstPoint.rms();
34  else
35  theMaxRMS = secondPoint.rms();
36  theMeanSum += firstPoint.mean();
37  theRMSSum += firstPoint.rms();
38 
39  theMeanSum += secondPoint.mean();
40  theRMSSum += secondPoint.rms();
41 
42  computeRadius();
43  }
44 }

References computeRadius(), DTOccupancyPoint::mean(), qualityCriterion(), DTOccupancyPoint::rms(), theMaxMean, theMaxRMS, theMeanSum, thePoints, theRMSSum, and theValidity.

◆ DTOccupancyCluster() [2/2]

DTOccupancyCluster::DTOccupancyCluster ( const DTOccupancyPoint singlePoint)

Constructor.

Definition at line 46 of file DTOccupancyCluster.cc.

47  : radius(0),
48  theMaxMean(singlePoint.mean()),
49  theMaxRMS(singlePoint.rms()),
50  theMeanSum(singlePoint.mean()),
51  theRMSSum(singlePoint.rms()) {
52  theValidity = true;
53 
54  // compute the cluster quantities
55  thePoints.push_back(singlePoint);
56 }

References thePoints, and theValidity.

◆ ~DTOccupancyCluster()

DTOccupancyCluster::~DTOccupancyCluster ( )
virtual

Destructor.

Definition at line 58 of file DTOccupancyCluster.cc.

58 {}

Member Function Documentation

◆ addPoint()

bool DTOccupancyCluster::addPoint ( const DTOccupancyPoint anotherPoint)

Add a point to the cluster: returns false if the point does not satisfy the quality requirement

Definition at line 65 of file DTOccupancyCluster.cc.

65  {
66  LogTrace("DTDQM|DTMonitorClient|DTOccupancyTest|DTOccupancyCluster")
67  << " Add a point to the cluster: mean: " << anotherPoint.mean() << " rms: " << anotherPoint.rms() << endl;
68  if (qualityCriterion(anotherPoint)) {
69  LogTrace("DTDQM|DTMonitorClient|DTOccupancyTest|DTOccupancyCluster") << " point is valid" << endl;
70  thePoints.push_back(anotherPoint);
71  // Compute the new cluster size
72  computeRadius();
73  // compute the max mean and RMS
74  if (anotherPoint.mean() > theMaxMean) {
75  theMaxMean = anotherPoint.mean();
76  }
77  if (anotherPoint.rms() > theMaxRMS) {
78  theMaxRMS = anotherPoint.rms();
79  }
80  theMeanSum += anotherPoint.mean();
81  theRMSSum += anotherPoint.rms();
82  return true;
83  }
84  return false;
85 }

References computeRadius(), LogTrace, DTOccupancyPoint::mean(), qualityCriterion(), DTOccupancyPoint::rms(), theMaxMean, theMaxRMS, theMeanSum, thePoints, and theRMSSum.

Referenced by DTOccupancyClusterBuilder::buildNewCluster().

◆ averageMean()

double DTOccupancyCluster::averageMean ( ) const

average cell occupancy of the layers in the cluster

Definition at line 101 of file DTOccupancyCluster.cc.

101 { return theMeanSum / (double)thePoints.size(); }

References theMeanSum, and thePoints.

Referenced by DTOccupancyClusterBuilder::buildNewCluster(), clusterIsLessThan(), and qualityCriterion().

◆ averageRMS()

double DTOccupancyCluster::averageRMS ( ) const

average RMS of the cell occpuancy distributions of the layers in the cluster

Definition at line 103 of file DTOccupancyCluster.cc.

103 { return theRMSSum / (double)thePoints.size(); }

References thePoints, and theRMSSum.

Referenced by DTOccupancyClusterBuilder::buildNewCluster(), clusterIsLessThan(), and qualityCriterion().

◆ computeRadius()

void DTOccupancyCluster::computeRadius ( )
private

Definition at line 153 of file DTOccupancyCluster.cc.

153  {
154  double radius_squared = 0;
155  for (vector<DTOccupancyPoint>::const_iterator pt_i = thePoints.begin(); pt_i != thePoints.end(); ++pt_i) {
156  for (vector<DTOccupancyPoint>::const_iterator pt_j = thePoints.begin(); pt_j != thePoints.end(); ++pt_j) {
157  radius_squared += TMath::Power(pt_i->distance(*pt_j), 2);
158  }
159  }
160  radius_squared = radius_squared / (2 * TMath::Power(thePoints.size() + 1, 2));
161  radius = sqrt(radius_squared);
162 }

References radius, mathSSE::sqrt(), and thePoints.

Referenced by addPoint(), and DTOccupancyCluster().

◆ distance()

double DTOccupancyCluster::distance ( const DTOccupancyPoint point) const

Compute the distance of a single point from the cluster (minimum distance with respect to the cluster points)

Definition at line 89 of file DTOccupancyCluster.cc.

89  {
90  double dist = 99999999;
91  // compute the minimum distance from a point
92  for (vector<DTOccupancyPoint>::const_iterator pt = thePoints.begin(); pt != thePoints.end(); ++pt) {
93  double distance = point.distance(*pt);
94  if (distance < dist) {
95  dist = distance;
96  }
97  }
98  return dist;
99 }

References point, DiDispStaMuonMonitor_cfi::pt, and thePoints.

Referenced by DTOccupancyClusterBuilder::computeDistancesToCluster().

◆ getHisto()

TH2F * DTOccupancyCluster::getHisto ( std::string  histoName,
int  nBinsX,
double  minX,
double  maxX,
int  nBinsY,
double  minY,
double  maxY,
int  fillColor 
) const

get a TH2F displaying the cluster

Definition at line 109 of file DTOccupancyCluster.cc.

116  {
117  TH2F* histo = new TH2F(histoName.c_str(), histoName.c_str(), nBinsX, minX, maxX, nBinsY, minY, maxY);
118  histo->SetFillColor(fillColor);
119  for (vector<DTOccupancyPoint>::const_iterator pt = thePoints.begin(); pt != thePoints.end(); ++pt) {
120  histo->Fill((*pt).mean(), (*pt).rms());
121  }
122  return histo;
123 }

References RecoTauValidation_cfi::fillColor, timingPdfMaker::histo, HltBtagPostValidation_cff::histoName, HGVHistoProducerAlgoBlock_cfi::maxX, HGVHistoProducerAlgoBlock_cfi::maxY, HGVHistoProducerAlgoBlock_cfi::minX, HGVHistoProducerAlgoBlock_cfi::minY, DiDispStaMuonMonitor_cfi::pt, and thePoints.

◆ getLayerIDs()

set< DTLayerId > DTOccupancyCluster::getLayerIDs ( ) const

Definition at line 166 of file DTOccupancyCluster.cc.

166  {
167  set<DTLayerId> ret;
168  for (vector<DTOccupancyPoint>::const_iterator point = thePoints.begin(); point != thePoints.end(); ++point) {
169  ret.insert((*point).layerId());
170  }
171  return ret;
172 }

References point, runTheMatrix::ret, and thePoints.

◆ isValid()

bool DTOccupancyCluster::isValid ( void  ) const

Check if the cluster candidate satisfies the quality requirements.

Definition at line 61 of file DTOccupancyCluster.cc.

61 { return theValidity; }

References theValidity.

Referenced by ntupleDataFormat._Object::_checkIsValid(), DTOccupancyClusterBuilder::buildNewCluster(), and core.AutoHandle.AutoHandle::ReallyLoad().

◆ maxMean()

double DTOccupancyCluster::maxMean ( ) const

max average cell occupancy of the layers in the cluster

Definition at line 105 of file DTOccupancyCluster.cc.

105 { return theMaxMean; }

References theMaxMean.

Referenced by DTOccupancyClusterBuilder::buildClusters(), and DTOccupancyClusterBuilder::buildNewCluster().

◆ maxRMS()

double DTOccupancyCluster::maxRMS ( ) const

max RMS of the cell occpuancy distributions of the layers in the cluster

Definition at line 107 of file DTOccupancyCluster.cc.

107 { return theMaxRMS; }

References theMaxRMS.

Referenced by DTOccupancyClusterBuilder::buildClusters(), and DTOccupancyClusterBuilder::buildNewCluster().

◆ nPoints()

int DTOccupancyCluster::nPoints ( ) const

of layers belonging to the cluster

Definition at line 164 of file DTOccupancyCluster.cc.

164 { return thePoints.size(); }

References thePoints.

Referenced by DTOccupancyClusterBuilder::buildNewCluster(), and clusterIsLessThan().

◆ qualityCriterion() [1/2]

bool DTOccupancyCluster::qualityCriterion ( const DTOccupancyPoint anotherPoint)
private

Definition at line 137 of file DTOccupancyCluster.cc.

137  {
138  double minrms = 0;
139  if (anotherPoint.rms() < averageRMS())
140  minrms = anotherPoint.rms();
141  else
142  minrms = averageRMS();
143 
144  if (fabs(averageMean() - anotherPoint.mean()) < averageRMS() &&
145  fabs(averageRMS() - anotherPoint.rms()) < 2 * minrms / 3.) {
146  theValidity = true;
147  return true;
148  }
149  theValidity = false;
150  return false;
151 }

References averageMean(), averageRMS(), DTOccupancyPoint::mean(), DTOccupancyPoint::rms(), and theValidity.

◆ qualityCriterion() [2/2]

bool DTOccupancyCluster::qualityCriterion ( const DTOccupancyPoint firstPoint,
const DTOccupancyPoint secondPoint 
)
private

Definition at line 125 of file DTOccupancyCluster.cc.

125  {
126  if (firstPoint.deltaMean(secondPoint) < computeAverageRMS(firstPoint, secondPoint) &&
127  firstPoint.deltaRMS(secondPoint) < computeMinRMS(firstPoint, secondPoint)) {
128  theValidity = true;
129 
130  return true;
131  }
132 
133  theValidity = false;
134  return false;
135 }

References computeAverageRMS(), computeMinRMS(), DTOccupancyPoint::deltaMean(), DTOccupancyPoint::deltaRMS(), and theValidity.

Referenced by addPoint(), and DTOccupancyCluster().

Member Data Documentation

◆ radius

double DTOccupancyCluster::radius
private

Definition at line 82 of file DTOccupancyCluster.h.

Referenced by computeRadius().

◆ theMaxMean

double DTOccupancyCluster::theMaxMean
private

Definition at line 85 of file DTOccupancyCluster.h.

Referenced by addPoint(), DTOccupancyCluster(), and maxMean().

◆ theMaxRMS

double DTOccupancyCluster::theMaxRMS
private

Definition at line 86 of file DTOccupancyCluster.h.

Referenced by addPoint(), DTOccupancyCluster(), and maxRMS().

◆ theMeanSum

double DTOccupancyCluster::theMeanSum
private

Definition at line 87 of file DTOccupancyCluster.h.

Referenced by addPoint(), averageMean(), and DTOccupancyCluster().

◆ thePoints

std::vector<DTOccupancyPoint> DTOccupancyCluster::thePoints
private

◆ theRMSSum

double DTOccupancyCluster::theRMSSum
private

Definition at line 88 of file DTOccupancyCluster.h.

Referenced by addPoint(), averageRMS(), and DTOccupancyCluster().

◆ theValidity

bool DTOccupancyCluster::theValidity
private

Definition at line 81 of file DTOccupancyCluster.h.

Referenced by DTOccupancyCluster(), isValid(), and qualityCriterion().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
DTOccupancyCluster::computeRadius
void computeRadius()
Definition: DTOccupancyCluster.cc:153
DTOccupancyCluster::theValidity
bool theValidity
Definition: DTOccupancyCluster.h:81
DTOccupancyCluster::theMeanSum
double theMeanSum
Definition: DTOccupancyCluster.h:87
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
DTOccupancyCluster::theMaxRMS
double theMaxRMS
Definition: DTOccupancyCluster.h:86
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
DTOccupancyPoint::deltaMean
double deltaMean(const DTOccupancyPoint &anotherPoint) const
Definition: DTOccupancyPoint.cc:35
DTOccupancyCluster::thePoints
std::vector< DTOccupancyPoint > thePoints
Definition: DTOccupancyCluster.h:83
DTOccupancyPoint::deltaRMS
double deltaRMS(const DTOccupancyPoint &anotherPoint) const
Definition: DTOccupancyPoint.cc:39
HGVHistoProducerAlgoBlock_cfi.minX
minX
Definition: HGVHistoProducerAlgoBlock_cfi.py:168
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DTOccupancyCluster::distance
double distance(const DTOccupancyPoint &point) const
Definition: DTOccupancyCluster.cc:89
DTOccupancyCluster::qualityCriterion
bool qualityCriterion(const DTOccupancyPoint &firstPoint, const DTOccupancyPoint &secondPoint)
Definition: DTOccupancyCluster.cc:125
computeAverageRMS
double computeAverageRMS(const DTOccupancyPoint &onePoint, const DTOccupancyPoint &anotherPoint)
Definition: DTOccupancyPoint.cc:74
DTOccupancyCluster::theRMSSum
double theRMSSum
Definition: DTOccupancyCluster.h:88
DTOccupancyPoint::mean
double mean() const
average cell occupancy in the layer
Definition: DTOccupancyPoint.cc:27
HGVHistoProducerAlgoBlock_cfi.minY
minY
Definition: HGVHistoProducerAlgoBlock_cfi.py:173
computeMinRMS
double computeMinRMS(const DTOccupancyPoint &onePoint, const DTOccupancyPoint &anotherPoint)
Definition: DTOccupancyPoint.cc:79
DTOccupancyCluster::averageRMS
double averageRMS() const
average RMS of the cell occpuancy distributions of the layers in the cluster
Definition: DTOccupancyCluster.cc:103
DTOccupancyCluster::theMaxMean
double theMaxMean
Definition: DTOccupancyCluster.h:85
DTOccupancyCluster::radius
double radius
Definition: DTOccupancyCluster.h:82
HGVHistoProducerAlgoBlock_cfi.maxY
maxY
Definition: HGVHistoProducerAlgoBlock_cfi.py:174
HltBtagPostValidation_cff.histoName
histoName
Definition: HltBtagPostValidation_cff.py:17
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
RecoTauValidation_cfi.fillColor
fillColor
Definition: RecoTauValidation_cfi.py:295
DTOccupancyCluster::averageMean
double averageMean() const
average cell occupancy of the layers in the cluster
Definition: DTOccupancyCluster.cc:101
DTOccupancyPoint::rms
double rms() const
RMS of the distribution of the cell occupancies in the layer.
Definition: DTOccupancyPoint.cc:29
HGVHistoProducerAlgoBlock_cfi.maxX
maxX
Definition: HGVHistoProducerAlgoBlock_cfi.py:169