00001
00002
00003
00004 #ifndef STJTREEINDEX_H
00005 #define STJTREEINDEX_H
00006
00007 #include <Rtypes.h>
00008 #include <TObject.h>
00009 #include <ostream>
00010
00011
00012 #ifdef major
00013 #undef major
00014 #endif
00015
00016 #ifdef minor
00017 #undef minor
00018 #endif
00019
00020 class StjTreeIndex : public TObject {
00021
00022 public:
00023 StjTreeIndex(Int_t major = 0, Int_t minor = 0) : _major(major), _minor(minor) { }
00024 virtual ~StjTreeIndex() { }
00025
00026 Int_t major() const { return _major; }
00027 Int_t minor() const { return _minor; }
00028
00029 private:
00030
00031 Int_t _major;
00032 Int_t _minor;
00033
00034 ClassDef(StjTreeIndex, 1)
00035
00036 };
00037
00038 inline bool operator<(const StjTreeIndex& v1, const StjTreeIndex& v2) {
00039 if(v1.major() != v2.major()) return v1.major() < v2.major();
00040 return v1.minor() < v2.minor();
00041 }
00042
00043 inline bool operator>(const StjTreeIndex& v1, const StjTreeIndex& v2) {
00044 return v2 < v1;
00045 }
00046
00047 inline bool operator==(const StjTreeIndex& v1, const StjTreeIndex& v2){
00048 return !( v1 > v2 ) && !( v2 > v1);
00049 }
00050
00051 inline bool operator!=(const StjTreeIndex& v1, const StjTreeIndex& v2)
00052 {
00053 return(!(v1 == v2));
00054 }
00055
00056 inline std::ostream& operator<<(std::ostream& out, const StjTreeIndex& v)
00057 {
00058 out << "StjTreeIndex: " << v.major() << " " << v.minor();
00059 return out;
00060 }
00061
00062 #endif // STJTREEINDEX_H