CMS 3D CMS Logo

MuonEtaRange.cc
Go to the documentation of this file.
1 
14 #include <iostream>
15 
16 MuonEtaRange::MuonEtaRange() : theMin(0), theMax(0) {}
17 
19  if (max < min) {
20  edm::LogWarning("MuonEtaRange") << "Warning MuonEtaRange:: max < min!! correcting" << std::endl;
21  float tmp(min);
22  min = max;
23  max = tmp;
24  }
25  theMax = max;
26  theMin = min;
27 }
28 
29 MuonEtaRange::MuonEtaRange(const MuonEtaRange& range) : theMin(range.theMin), theMax(range.theMax) {}
32  if (this != &range) {
33  theMin = range.theMin;
34  theMax = range.theMax;
35  }
36  return *this;
37 }
38 
39 bool MuonEtaRange::isInside(float eta, float error) const {
40  if ((eta + error) > max() || (eta - error) < min())
41  return false;
42  return true;
43 }
46  if (min() > range.min() && max() < range.max())
47  return true;
48  return false;
49 }
52  if (range.min() > max() || range.max() < min())
53  return false;
54  return true;
55 }
58  float max = (theMax > range.theMax) ? theMax : range.theMax;
59  float min = (theMin < range.theMin) ? theMin : range.theMin;
60  return MuonEtaRange(max, min);
61 }
64  if (range.isInside(*this)) {
65  edm::LogInfo("MuonEtaRange") << "MuonEtaRange: range is inside!" << std::endl;
66  return *this;
67  }
68  if (!range.isCompatible(*this)) {
69  edm::LogInfo("MuonEtaRange") << "MuonEtaRange: no overlap between ranges" << std::endl;
70  return *this;
71  }
72 
73  float max = isInside(range.theMin) ? range.theMin : theMax;
74  float min = isInside(range.theMax) ? range.theMax : theMin;
75  return MuonEtaRange(max, min);
76 }
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
MuonEtaRange::MuonEtaRange
MuonEtaRange()
Definition: MuonEtaRange.cc:16
MessageLogger.h
min
T min(T a, T b)
Definition: MathUtil.h:58
MuonEtaRange::isInside
bool isInside(float eta, float error=0.) const
Definition: MuonEtaRange.cc:39
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
MuonEtaRange::operator=
MuonEtaRange & operator=(const MuonEtaRange &)
Assignment operator.
Definition: MuonEtaRange.cc:31
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
relativeConstraints.error
error
Definition: relativeConstraints.py:53
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
MuonEtaRange::subtract
MuonEtaRange subtract(const MuonEtaRange &) const
create new range of size this minus range
Definition: MuonEtaRange.cc:63
MuonEtaRange::theMin
float theMin
Definition: MuonEtaRange.h:32
MuonEtaRange.h
MuonEtaRange::max
float max() const
Definition: MuonEtaRange.h:23
MuonEtaRange
Definition: MuonEtaRange.h:15
PVValHelper::eta
Definition: PVValidationHelpers.h:69
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
MuonEtaRange::theMax
float theMax
Definition: MuonEtaRange.h:33
MuonEtaRange::add
MuonEtaRange add(const MuonEtaRange &) const
create maximum of ranges
Definition: MuonEtaRange.cc:57
MuonEtaRange::min
float min() const
Definition: MuonEtaRange.h:22
MuonEtaRange::isCompatible
bool isCompatible(const MuonEtaRange &range) const
true if this overlaps with range
Definition: MuonEtaRange.cc:51