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 
17  public:
18 
19  MTDEtaRange();
20  MTDEtaRange(float max, float min);
21  MTDEtaRange(const MTDEtaRange&);
24  inline float min() const { return theMin; }
25  inline float max() const { return theMax; }
26  bool isInside(float eta, float error=0.) const;
27  bool isInside(const MTDEtaRange& range) const;
28  bool isCompatible(const MTDEtaRange& range) const;
29  MTDEtaRange add(const MTDEtaRange&) const;
30  MTDEtaRange minRange(const MTDEtaRange&) const;
31  MTDEtaRange subtract(const MTDEtaRange&) const;
32  private:
33 
34  float theMin;
35  float theMax;
36 };
37 #include <iostream>
38 inline std::ostream& operator<<(std::ostream& os, const MTDEtaRange& range)
39 {
40  os << "(" << range.min() << " : " << range.max() << ")" ;
41  return os;
42 }
43 
44 #endif
float theMin
Definition: MTDEtaRange.h:34
MTDEtaRange add(const MTDEtaRange &) const
create maximum of ranges
Definition: MTDEtaRange.cc:59
MTDEtaRange & operator=(const MTDEtaRange &)
Assignment operator.
Definition: MTDEtaRange.cc:34
float min() const
Definition: MTDEtaRange.h:24
float theMax
Definition: MTDEtaRange.h:35
float max() const
Definition: MTDEtaRange.h:25
bool isInside(float eta, float error=0.) const
Definition: MTDEtaRange.cc:43
MTDEtaRange minRange(const MTDEtaRange &) const
MTDEtaRange subtract(const MTDEtaRange &) const
create new range of size this minus range
Definition: MTDEtaRange.cc:65
std::ostream & operator<<(std::ostream &os, const MTDEtaRange &range)
Definition: MTDEtaRange.h:38
bool isCompatible(const MTDEtaRange &range) const
true if this overlaps with range
Definition: MTDEtaRange.cc:54