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
EncodedTruthId::index_
int index_
Definition: EncodedTruthId.h:38
EncodedTruthId::index
int index() const
Definition: EncodedTruthId.h:16
EncodedTruthId::operator<<
friend std::ostream & operator<<(std::ostream &os, const EncodedTruthId &id)
EncodedEventId::operator==
int operator==(const EncodedEventId &id) const
equality
Definition: EncodedEventId.h:35
Utilities.operator
operator
Definition: Utilities.py:24
EncodedEventId
Definition: EncodedEventId.h:11
EncodedTruthId::EncodedTruthId
EncodedTruthId()
Definition: EncodedTruthId.cc:3
operator<<
std::ostream & operator<<(std::ostream &os, EncodedTruthId &id)
Definition: EncodedTruthId.cc:7
EncodedTruthId::operator==
int operator==(const EncodedTruthId &id) const
Definition: EncodedTruthId.h:19
EncodedTruthId::operator!=
int operator!=(const EncodedTruthId &id) const
Definition: EncodedTruthId.h:27
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
EncodedTruthId::operator<
int operator<(const EncodedTruthId &id) const
Definition: EncodedTruthId.h:29
EncodedTruthId
Definition: EncodedTruthId.h:7
EncodedEventId.h