CMS 3D CMS Logo

EncodedTruthId.h
Go to the documentation of this file.
1 #ifndef TrackingAnalysis_EncodedTruthId_h
2 #define TrackingAnalysis_EncodedTruthId_h
3 
5 #include <iosfwd>
6 
7 class EncodedTruthId : public EncodedEventId {
8  friend std::ostream &operator<<(std::ostream &os, const EncodedTruthId &id);
9 
10 public:
11  // Constructors
14 
15  // Getters
16  int index() const { return index_; }
17 
18  // Operators
19  int operator==(const EncodedTruthId &id) const {
20  if (EncodedEventId::operator==(id)) {
21  return index_ == id.index_;
22  } else {
23  return EncodedEventId::operator==(id);
24  }
25  }
26 
27  int operator!=(const EncodedTruthId &id) const { return !(operator==(id)); }
28 
29  int operator<(const EncodedTruthId &id) const {
30  if (EncodedEventId::operator==(id)) {
31  return index_ < id.index_;
32  } else {
33  return (EncodedEventId::operator<(id));
34  }
35  }
36 
37 private:
38  int index_;
39 };
40 
41 std::ostream &operator<<(std::ostream &os, EncodedTruthId &id);
42 
43 #endif
int index() const
int operator==(const EncodedEventId &id) const
equality
friend std::ostream & operator<<(std::ostream &os, const EncodedTruthId &id)
int operator!=(const EncodedTruthId &id) const
int operator==(const EncodedTruthId &id) const
std::ostream & operator<<(std::ostream &os, EncodedTruthId &id)
int operator<(const EncodedTruthId &id) const