CMS 3D CMS Logo

MTDEtaRange.h
Go to the documentation of this file.
1 #ifndef Navigation_MTDEtaRange_H
2 #define Navigation_MTDEtaRange_H
3 
15 class MTDEtaRange {
16 public:
17  MTDEtaRange();
18  MTDEtaRange(float max, float min);
19  MTDEtaRange(const MTDEtaRange&);
22  inline float min() const { return theMin; }
23  inline float max() const { return theMax; }
24  bool isInside(float eta, float error = 0.) const;
25  bool isInside(const MTDEtaRange& range) const;
26  bool isCompatible(const MTDEtaRange& range) const;
27  MTDEtaRange add(const MTDEtaRange&) const;
28  MTDEtaRange minRange(const MTDEtaRange&) const;
29  MTDEtaRange subtract(const MTDEtaRange&) const;
30 
31 private:
32  float theMin;
33  float theMax;
34 };
35 #include <iostream>
36 inline std::ostream& operator<<(std::ostream& os, const MTDEtaRange& range) {
37  os << "(" << range.min() << " : " << range.max() << ")";
38  return os;
39 }
40 
41 #endif
float theMin
Definition: MTDEtaRange.h:32
MTDEtaRange add(const MTDEtaRange &) const
create maximum of ranges
Definition: MTDEtaRange.cc:57
MTDEtaRange & operator=(const MTDEtaRange &)
Assignment operator.
Definition: MTDEtaRange.cc:31
float min() const
Definition: MTDEtaRange.h:22
float theMax
Definition: MTDEtaRange.h:33
float max() const
Definition: MTDEtaRange.h:23
bool isInside(float eta, float error=0.) const
Definition: MTDEtaRange.cc:39
MTDEtaRange minRange(const MTDEtaRange &) const
MTDEtaRange subtract(const MTDEtaRange &) const
create new range of size this minus range
Definition: MTDEtaRange.cc:63
std::ostream & operator<<(std::ostream &os, const MTDEtaRange &range)
Definition: MTDEtaRange.h:36
bool isCompatible(const MTDEtaRange &range) const
true if this overlaps with range
Definition: MTDEtaRange.cc:51