CMS 3D CMS Logo

DTOccupancyPoint.cc
Go to the documentation of this file.
1 
2 /*
3  * See header file for a description of this class.
4  *
5  * \author G. Cerminara - INFN Torino
6  */
7 
8 #include "DTOccupancyPoint.h"
9 
10 #include <cmath>
11 
12 DTOccupancyPoint::DTOccupancyPoint() : theMean(0.), theRMS(0.) {
13  debug = false; // FIXME: to be removed
14 }
15 
16 DTOccupancyPoint::DTOccupancyPoint(double mean, double rms) : theMean(mean), theRMS(rms) {
17  debug = false; // FIXME: to be removed
18 }
19 
21  : theMean(mean), theRMS(rms), theLayerId(layerId) {
22  debug = false; // FIXME: to be removed
23 }
24 
26 
27 double DTOccupancyPoint::mean() const { return theMean; }
28 
29 double DTOccupancyPoint::rms() const { return theRMS; }
30 
31 double DTOccupancyPoint::distance(const DTOccupancyPoint& anotherPoint) const {
32  return sqrt(deltaMean(anotherPoint) * deltaMean(anotherPoint) + deltaRMS(anotherPoint) * deltaRMS(anotherPoint));
33 }
34 
35 double DTOccupancyPoint::deltaMean(const DTOccupancyPoint& anotherPoint) const {
36  return fabs(mean() - anotherPoint.mean());
37 }
38 
39 double DTOccupancyPoint::deltaRMS(const DTOccupancyPoint& anotherPoint) const {
40  return fabs(rms() - anotherPoint.rms());
41 }
42 
44  // FIXME: should add the layer ID? not clear
45  if (theMean == other.mean() && theRMS == other.rms() && theLayerId == other.layerId())
46  return true;
47  return false;
48 }
49 
51  if (theMean != other.mean() || theRMS != other.rms() || theLayerId != other.layerId())
52  return true;
53  return false;
54 }
55 
57  if (distance(DTOccupancyPoint()) == other.distance(DTOccupancyPoint())) {
58  return false;
59  }
60 
61  if (fabs(distance(DTOccupancyPoint()) - other.distance(DTOccupancyPoint())) < 0.000001) {
62  if (layerId().rawId() < other.layerId().rawId()) {
63  return true;
64  } else {
65  return false;
66  }
67  }
68 
69  if (distance(DTOccupancyPoint()) < other.distance(DTOccupancyPoint()))
70  return true;
71  return false;
72 }
73 
74 double computeAverageRMS(const DTOccupancyPoint& onePoint, const DTOccupancyPoint& anotherPoint) {
75  double ret = (onePoint.rms() + anotherPoint.rms()) / 2.;
76  return ret;
77 }
78 
79 double computeMinRMS(const DTOccupancyPoint& onePoint, const DTOccupancyPoint& anotherPoint) {
80  double ret = -1;
81  if (onePoint.rms() > anotherPoint.rms()) {
82  ret = anotherPoint.rms();
83  } else {
84  ret = onePoint.rms();
85  }
86  return ret;
87 }
88 
90 
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
DTOccupancyPoint::operator==
bool operator==(const DTOccupancyPoint &other) const
Definition: DTOccupancyPoint.cc:43
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
DTOccupancyPoint::debug
bool debug
Definition: DTOccupancyPoint.h:55
DTOccupancyPoint
Definition: DTOccupancyPoint.h:13
DTOccupancyPoint::deltaMean
double deltaMean(const DTOccupancyPoint &anotherPoint) const
Definition: DTOccupancyPoint.cc:35
DTOccupancyPoint::layerId
DTLayerId layerId() const
Definition: DTOccupancyPoint.cc:91
DTOccupancyPoint::operator!=
bool operator!=(const DTOccupancyPoint &other) const
Definition: DTOccupancyPoint.cc:50
SiStripPI::rms
Definition: SiStripPayloadInspectorHelper.h:169
DTOccupancyPoint::deltaRMS
double deltaRMS(const DTOccupancyPoint &anotherPoint) const
Definition: DTOccupancyPoint.cc:39
DTOccupancyPoint::DTOccupancyPoint
DTOccupancyPoint()
Constructor.
Definition: DTOccupancyPoint.cc:12
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
computeAverageRMS
double computeAverageRMS(const DTOccupancyPoint &onePoint, const DTOccupancyPoint &anotherPoint)
Definition: DTOccupancyPoint.cc:74
trackingPlots.other
other
Definition: trackingPlots.py:1464
DTOccupancyPoint::theRMS
double theRMS
Definition: DTOccupancyPoint.h:52
DTLayerId
Definition: DTLayerId.h:12
DTOccupancyPoint::theLayerId
DTLayerId theLayerId
Definition: DTOccupancyPoint.h:53
DTOccupancyPoint::mean
double mean() const
average cell occupancy in the layer
Definition: DTOccupancyPoint.cc:27
DTOccupancyPoint::operator<
bool operator<(const DTOccupancyPoint &other) const
Definition: DTOccupancyPoint.cc:56
computeMinRMS
double computeMinRMS(const DTOccupancyPoint &onePoint, const DTOccupancyPoint &anotherPoint)
Definition: DTOccupancyPoint.cc:79
DTOccupancyPoint.h
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DTOccupancyPoint::theMean
double theMean
Definition: DTOccupancyPoint.h:51
DTOccupancyPoint::setLayerId
void setLayerId(DTLayerId layerId)
Definition: DTOccupancyPoint.cc:89
DTOccupancyPoint::~DTOccupancyPoint
virtual ~DTOccupancyPoint()
Destructor.
Definition: DTOccupancyPoint.cc:25
DTOccupancyPoint::distance
double distance(const DTOccupancyPoint &anotherPoint) const
distance from another point in the 2D plane
Definition: DTOccupancyPoint.cc:31
DTOccupancyPoint::rms
double rms() const
RMS of the distribution of the cell occupancies in the layer.
Definition: DTOccupancyPoint.cc:29