CMS 3D CMS Logo

EncodedTruthId.h

Go to the documentation of this file.
00001 #ifndef TrackingAnalysis_EncodedTruthId_h
00002 #define TrackingAnalysis_EncodedTruthId_h
00003 
00004 #include <iosfwd>
00005 #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
00006 
00007 class EncodedTruthId : public EncodedEventId {
00008 
00009   friend std::ostream& operator<< (std::ostream& os, const EncodedTruthId & id);
00010 
00011  public:
00012 
00013 // Constructors
00014   EncodedTruthId();
00015   EncodedTruthId(EncodedEventId eid, int index);
00016 
00017 // Getters
00018   int index() const { return index_; }
00019 
00020 // Operators
00021   int operator==(const EncodedTruthId& id) const {
00022     if (EncodedEventId::operator==(id)) {
00023       return index_ == id.index_;
00024     } else {
00025       return EncodedEventId::operator==(id);
00026     }
00027   }
00028 
00029   int operator!=(const EncodedTruthId& id) const { return !(operator==(id)); }
00030 
00031   int operator<( const EncodedTruthId& id) const {
00032     if (EncodedEventId::operator==(id)) {
00033       return index_ < id.index_;
00034     } else {
00035       return (EncodedEventId::operator<(id));
00036     }
00037   }
00038 
00039  private:
00040   int index_;
00041 };
00042 
00043 std::ostream& operator<<(std::ostream & os , EncodedTruthId& id);
00044 
00045 #endif

Generated on Tue Jun 9 17:47:28 2009 for CMSSW by  doxygen 1.5.4