#include <RecoMuon/Navigation/interface/MuonEtaRange.h>
Public Member Functions | |
MuonEtaRange | add (const MuonEtaRange &) const |
create maximum of ranges | |
bool | isCompatible (const MuonEtaRange &range) const |
true if this overlaps with range | |
bool | isInside (const MuonEtaRange &range) const |
true if this is completely inside range | |
bool | isInside (float eta, float error=0.) const |
float | max () const |
float | min () const |
MuonEtaRange | minRange (const MuonEtaRange &) const |
MuonEtaRange (const MuonEtaRange &) | |
MuonEtaRange (float max, float min) | |
MuonEtaRange () | |
MuonEtaRange & | operator= (const MuonEtaRange &) |
Assignment operator. | |
MuonEtaRange | subtract (const MuonEtaRange &) const |
create new range of size this minus range | |
~MuonEtaRange () | |
Private Attributes | |
float | theMax |
float | theMin |
Modification:
Modification:
Definition at line 17 of file MuonEtaRange.h.
MuonEtaRange::MuonEtaRange | ( | ) |
MuonEtaRange::MuonEtaRange | ( | float | max, | |
float | min | |||
) |
Definition at line 22 of file MuonEtaRange.cc.
References lat::endl(), theMax, theMin, and tmp.
00022 { 00023 if ( max < min ) { 00024 edm::LogWarning ("MuonEtaRange") << "Warning MuonEtaRange:: max < min!! correcting" <<std::endl; 00025 float tmp(min); 00026 min = max; 00027 max = tmp; 00028 } 00029 theMax = max; 00030 theMin = min; 00031 }
MuonEtaRange::MuonEtaRange | ( | const MuonEtaRange & | range | ) |
MuonEtaRange::~MuonEtaRange | ( | ) | [inline] |
MuonEtaRange MuonEtaRange::add | ( | const MuonEtaRange & | range | ) | const |
create maximum of ranges
Definition at line 61 of file MuonEtaRange.cc.
References max(), min(), MuonEtaRange(), theMax, and theMin.
00061 { 00062 float max = ( theMax > range.theMax ) ? theMax : range.theMax; 00063 float min = ( theMin < range.theMin ) ? theMin : range.theMin; 00064 return MuonEtaRange(max,min); 00065 }
bool MuonEtaRange::isCompatible | ( | const MuonEtaRange & | range | ) | const |
true if this overlaps with range
Definition at line 56 of file MuonEtaRange.cc.
Referenced by subtract().
00056 { 00057 if ( range.min() > max() || range.max() < min() ) return false; 00058 return true; 00059 }
bool MuonEtaRange::isInside | ( | const MuonEtaRange & | range | ) | const |
bool MuonEtaRange::isInside | ( | float | eta, | |
float | error = 0. | |||
) | const |
Definition at line 45 of file MuonEtaRange.cc.
Referenced by MuonTkNavigationSchool::linkBarrelLayers(), MuonTkNavigationSchool::linkEndcapLayers(), and subtract().
00045 { 00046 00047 if ( (eta+error) > max() || (eta-error) < min() ) return false; 00048 return true; 00049 }
float MuonEtaRange::max | ( | ) | const [inline] |
Definition at line 27 of file MuonEtaRange.h.
References theMax.
Referenced by add(), isCompatible(), isInside(), MuonTkNavigationSchool::linkBarrelLayers(), MuonTkNavigationSchool::linkEndcapLayers(), operator<<(), and subtract().
00027 { return theMax; }
float MuonEtaRange::min | ( | ) | const [inline] |
Definition at line 26 of file MuonEtaRange.h.
References theMin.
Referenced by add(), isCompatible(), isInside(), MuonTkNavigationSchool::linkBarrelLayers(), MuonTkNavigationSchool::linkEndcapLayers(), operator<<(), and subtract().
00026 { return theMin; }
MuonEtaRange MuonEtaRange::minRange | ( | const MuonEtaRange & | ) | const |
MuonEtaRange & MuonEtaRange::operator= | ( | const MuonEtaRange & | range | ) |
MuonEtaRange MuonEtaRange::subtract | ( | const MuonEtaRange & | range | ) | const |
create new range of size this minus range
Definition at line 67 of file MuonEtaRange.cc.
References lat::endl(), isCompatible(), isInside(), max(), min(), MuonEtaRange(), theMax, and theMin.
Referenced by MuonTkNavigationSchool::linkEndcapLayers().
00067 { 00068 00069 if ( range.isInside(*this) ) { 00070 edm::LogInfo ("MuonEtaRange") << "MuonEtaRange: range is inside!" << std::endl; 00071 return *this; 00072 } 00073 if ( !range.isCompatible(*this) ) { 00074 edm::LogInfo ("MuonEtaRange") << "MuonEtaRange: no overlap between ranges" << std::endl; 00075 return *this; 00076 } 00077 00078 float max = isInside(range.theMin) ? range.theMin : theMax; 00079 float min = isInside(range.theMax) ? range.theMax : theMin; 00080 return MuonEtaRange(max,min); 00081 }
float MuonEtaRange::theMax [private] |
Definition at line 37 of file MuonEtaRange.h.
Referenced by add(), max(), MuonEtaRange(), operator=(), and subtract().
float MuonEtaRange::theMin [private] |
Definition at line 36 of file MuonEtaRange.h.
Referenced by add(), min(), MuonEtaRange(), operator=(), and subtract().